/* Generated by Cython 3.3.0 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [],
        "include_dirs": [
            "C:\\vcpkg\\installed\\x64-windows-release\\include"
        ],
        "libraries": [
            "libpq",
            "ws2_32"
        ],
        "library_dirs": [
            "C:\\vcpkg\\installed\\x64-windows-release\\lib"
        ],
        "name": "psycopg_binary.pq",
        "sources": [
            "psycopg_binary/pq.pyx"
        ]
    },
    "module_name": "psycopg_binary.pq"
}
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 < 0x03090000
    #error Cython requires Python 3.9+.
#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
    #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
#else
#define __PYX_ABI_VERSION "3_3_0"
#define CYTHON_HEX_VERSION 0x030300F0
#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
#ifdef __has_builtin
  #define __Pyx_has_cbuiltin(name) __has_builtin(name)
#else
  #define __Pyx_has_cbuiltin(name) (0)
#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(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
    #if Py_LIMITED_API < 0x03090000
      #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
    #endif
  #endif
  #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
    #ifdef _MSC_VER
      #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
        code for PyPy and GraalPy and is unlikely to work.")
    #else
      #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
        code for PyPy and GraalPy and is unlikely to work."
    #endif
  #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_VECTORCALL
  #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #ifndef CYTHON_VECTORCALL_TPNEW
    #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #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
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
  #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_OWN_PREP_RERAISE_STAR
    #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 1
  #endif
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
  #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
  #undef CYTHON_OPAQUE_OBJECTS
  #define CYTHON_OPAQUE_OBJECTS 0
  #elif !defined(CYTHON_OPAQUE_OBJECTS)
  #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
  #endif
#elif 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
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 0
  #endif
  #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
  #ifndef CYTHON_VECTORCALL
    #define CYTHON_VECTORCALL 1
  #endif
  #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
    #undef CYTHON_VECTORCALL_TPNEW
    #define CYTHON_VECTORCALL_TPNEW 0
  #elif !defined(CYTHON_VECTORCALL_TPNEW)
    #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
  #endif
  #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
  #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
    #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
  #undef CYTHON_OPAQUE_OBJECTS
  #define CYTHON_OPAQUE_OBJECTS 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
  #ifndef CYTHON_VECTORCALL
    #define CYTHON_VECTORCALL 1
  #endif
  #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
    #undef CYTHON_VECTORCALL_TPNEW
    #define CYTHON_VECTORCALL_TPNEW 0
  #elif !defined(CYTHON_VECTORCALL_TPNEW)
    #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
  #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
  #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
  #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
    #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
  #undef CYTHON_OPAQUE_OBJECTS
  #define CYTHON_OPAQUE_OBJECTS 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_VECTORCALL
    #define CYTHON_VECTORCALL 1
  #endif
  #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
    #undef CYTHON_VECTORCALL_TPNEW
    #define CYTHON_VECTORCALL_TPNEW 0
  #elif !defined(CYTHON_VECTORCALL_TPNEW)
    #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
  #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_OWN_PREP_RERAISE_STAR
    #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
  #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
  #ifndef CYTHON_OPAQUE_OBJECTS
    #define CYTHON_OPAQUE_OBJECTS 0
  #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
  #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
    #define CYTHON_UNUSED [[maybe_unused]]
  #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
#ifdef Py_UNREACHABLE
  #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
#elif __Pyx_has_cbuiltin(__builtin_unreachable)
  #define __Pyx_UNREACHABLE() __builtin_unreachable()
#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
  #define __Pyx_UNREACHABLE() __builtin_unreachable()
#elif defined(_MSC_VER)
  #define __Pyx_UNREACHABLE() __assume(0)
#else
  #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
#endif
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
#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  0
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
#else
#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
#endif

/* 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 >= 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 CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
#else
#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
#endif
static int __Pyx_init_tpflags_variables(void);
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
#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
#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
  #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_VECTORCALL
  #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
#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
#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 CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
#endif
#if CYTHON_COMPILING_IN_PYPY
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #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_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
    #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
    #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
    #define CYTHON_OPAQUE_SHARED_TYPES 1
#else
    #define __PYX_SHARED_SIZEOF(T) sizeof(T)
    #define __PYX_SHARED_RELATIVE_OFFSET 0
    #define CYTHON_OPAQUE_SHARED_TYPES 0
#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_Occurred()) {
        PyErr_WriteUnraisable(NULL);
    }
    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_KIND_04(u)      __Pyx_PyUnicode_KIND(u)
  #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
    #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
  static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
      return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
  }
#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)        Py_IS_TYPE(obj, &PySet_Type)
#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 __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if 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 && CYTHON_ASSUME_SAFE_SIZE)
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
#else
  #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
    __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared)  ((void)(unsafe_shared),\
      __Pyx_PyList_GetItemRef(o, i))
#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GET_ITEM_REF(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_GET_ITEM_REF(o, i, unsafe_shared) (\
      __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
      __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
  #endif
#elif CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared)  ((void)(unsafe_shared),\
      __Pyx_NewRef(PyList_GET_ITEM(o, i)))
#else
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared)  ((void)(unsafe_shared),\
      __Pyx_XNewRef(PyList_GetItem(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_PyDict_GET_SIZE(o) PyDict_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_PyDict_GET_SIZE(o) PyDict_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 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;
}
static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
    int count = 0;
    while (flag) {
        count += (int) (flag & 1);
        flag >>= 1;
    }
    return count;
}
static int __Pyx_init_tpflags_variables(void) {
    if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
        return 0;
    }
    PyObject *collections_abc = PyImport_ImportModule("collections.abc");
    if (!collections_abc) return -1;
    int result = 0;
    PyObject *sequence = NULL, *mapping = NULL;
#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
    if (PyObject_GetOptionalAttrString(collections_abc, "Sequence", &sequence) != 1) goto fail;
    if (PyObject_GetOptionalAttrString(collections_abc, "Mapping", &mapping) != 1) goto fail;
#else
    sequence = PyObject_GetAttrString(collections_abc, "Sequence");
    if (!sequence) goto fail_attr_lookup;
    mapping = PyObject_GetAttrString(collections_abc, "Mapping");
    if (!mapping) goto fail_attr_lookup;
#endif
    if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
    {
        unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
        unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
        unsigned long mutual_flags = sequence_flags & mapping_flags;
        sequence_flags = sequence_flags ^ mutual_flags;
        mapping_flags = mapping_flags ^ mutual_flags;
        if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
            __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
        }
        if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
            __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
        }
    }
    cleanup:
    Py_XDECREF(mapping);
    Py_XDECREF(sequence);
    Py_DECREF(collections_abc);
    return result;
#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
    fail_attr_lookup:
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    }
#endif
    fail:
    result = PyErr_Occurred() ? -1 : 0;
    goto cleanup;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
static int __Pyx_init_tpflags_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__psycopg_binary__pq
#define __PYX_HAVE_API__psycopg_binary__pq
/* Early includes */

#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
    typedef signed pid_t;
#else
    #include <fcntl.h>
#endif
    
#include "stdio.h"
#include "pg_config.h"
#include "libpq-fe.h"

/* Hack to allow the use of old libpq versions */
#if PG_VERSION_NUM < 100000
#define PQencryptPasswordConn(conn, passwd, user, algorithm) NULL
#endif

#if PG_VERSION_NUM < 120000
#define PQhostaddr(conn) NULL
#endif

#if PG_VERSION_NUM < 140000
#define PGRES_PIPELINE_SYNC 10
#define PGRES_PIPELINE_ABORTED 11
typedef enum {
    PQ_PIPELINE_OFF,
    PQ_PIPELINE_ON,
    PQ_PIPELINE_ABORTED
} PGpipelineStatus;
#define PQpipelineStatus(conn) PQ_PIPELINE_OFF
#define PQenterPipelineMode(conn) 0
#define PQexitPipelineMode(conn) 1
#define PQpipelineSync(conn) 0
#define PQsendFlushRequest(conn) 0
#define PQsetTraceFlags(conn, stream) do {} while (0)
#endif

#if PG_VERSION_NUM < 160000
#define PQconnectionUsedGSSAPI(conn) 0
#endif

#if PG_VERSION_NUM < 170000
typedef struct pg_cancel_conn PGcancelConn;
#define PQchangePassword(conn, user, passwd) NULL
#define PQclosePrepared(conn, name) NULL
#define PQclosePortal(conn, name) NULL
#define PQsendClosePrepared(conn, name) 0
#define PQsendClosePortal(conn, name) 0
#define PQcancelCreate(conn) NULL
#define PQcancelStart(cancelConn) 0
#define PQcancelBlocking(cancelConn) 0
#define PQcancelPoll(cancelConn) CONNECTION_OK
#define PQcancelStatus(cancelConn) 0
#define PQcancelSocket(cancelConn) -1
#define PQcancelErrorMessage(cancelConn) NULL
#define PQcancelReset(cancelConn) 0
#define PQcancelFinish(cancelConn) 0
#define PQsetChunkedRowsMode(conn, chunkSize) 0
#endif

#if PG_VERSION_NUM < 180000
#define PQfullProtocolVersion(conn) 0
#endif


#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
    /* We don't need a real definition for this because Windows is not affected
     * by the issue caused by closing the fds after fork.
     */
    #define getpid() (0)
#else
    #include <unistd.h>
#endif
    
#include <string.h>
#include <stdio.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_PyObject_RichCompareBool(a,b,cmp)  __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
#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)
#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(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_SignBits(x)  ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
  #define __Pyx_PyLong_Sign(x)  (1 - __Pyx_PyLong_SignBits(x))
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_SignBits(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_SignBits(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_SignBits(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)\
        (((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)  (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
      uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
      uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
      if (tag_a == tag_b) return 0;
      int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
      int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
      if (sign_a > sign_b) return -1;
      if (sign_a < sign_b) return 1;
      Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
      Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
      return (1 - sign_a) * (size_a - size_b);
  }
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_Sign(x)  ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
  #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]))
  #define __Pyx_PyLong_CompareSignAndSize(a, b)  (Py_SIZE(a) - Py_SIZE(b))
  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
  #define __Pyx_PyLong_IsNonZero(x)  (!__Pyx_PyLong_IsZero(x))
#else
  #define __Pyx_PyLong_IsNonZero(x)  PyObject_IsTrue(x)
#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 const char * const __pyx_cfilenm = __FILE__;

/* #### Code section: filename_table ### */

static const char* const __pyx_f[] = {
  "psycopg_binary/pq.pyx",
  "psycopg_binary/pq/pgconn.pyx",
  "(tree fragment)",
  "psycopg_binary/pq/pgresult.pyx",
  "psycopg_binary/pq/pgcancel.pyx",
  "psycopg_binary/pq/conninfo.pyx",
  "psycopg_binary/pq/escaping.pyx",
  "psycopg_binary/pq/pqbuffer.pyx",
  "cpython/type.pxd",
};
/* #### 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 */
#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

/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* IncludeStructmemberH.proto */
#include <structmember.h>

/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_14psycopg_binary_2pq_PGconn;
struct __pyx_obj_14psycopg_binary_2pq_PGresult;
struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn;
struct __pyx_obj_14psycopg_binary_2pq_PGcancel;
struct __pyx_obj_14psycopg_binary_2pq_Escaping;
struct __pyx_obj_14psycopg_binary_2pq_PQBuffer;
struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer;
struct __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc;
typedef struct __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc;

/* "psycopg_binary/pq.pxd":16
 * from psycopg_binary.pq cimport libpq
 * 
 * ctypedef char *(*conn_bytes_f) (const libpq.PGconn *) noexcept nogil             # <<<<<<<<<<<<<<
 * ctypedef int (*conn_int_f) (const libpq.PGconn *) noexcept nogil
 * ctypedef void *(*conn_f_with_param) (const libpq.PGconn *, const char *) noexcept nogil
*/
typedef char *(*__pyx_t_14psycopg_binary_2pq_conn_bytes_f)(PGconn const *);

/* "psycopg_binary/pq.pxd":17
 * 
 * ctypedef char *(*conn_bytes_f) (const libpq.PGconn *) noexcept nogil
 * ctypedef int (*conn_int_f) (const libpq.PGconn *) noexcept nogil             # <<<<<<<<<<<<<<
 * ctypedef void *(*conn_f_with_param) (const libpq.PGconn *, const char *) noexcept nogil
 * ctypedef int (*conn_int_f_with_param) (
*/
typedef int (*__pyx_t_14psycopg_binary_2pq_conn_int_f)(PGconn const *);

/* "psycopg_binary/pq.pxd":18
 * ctypedef char *(*conn_bytes_f) (const libpq.PGconn *) noexcept nogil
 * ctypedef int (*conn_int_f) (const libpq.PGconn *) noexcept nogil
 * ctypedef void *(*conn_f_with_param) (const libpq.PGconn *, const char *) noexcept nogil             # <<<<<<<<<<<<<<
 * ctypedef int (*conn_int_f_with_param) (
 *     const libpq.PGconn *, const char *
*/
typedef void *(*__pyx_t_14psycopg_binary_2pq_conn_f_with_param)(PGconn const *, char const *);

/* "psycopg_binary/pq.pxd":19
 * ctypedef int (*conn_int_f) (const libpq.PGconn *) noexcept nogil
 * ctypedef void *(*conn_f_with_param) (const libpq.PGconn *, const char *) noexcept nogil
 * ctypedef int (*conn_int_f_with_param) (             # <<<<<<<<<<<<<<
 *     const libpq.PGconn *, const char *
 * ) noexcept nogil
*/
typedef int (*__pyx_t_14psycopg_binary_2pq_conn_int_f_with_param)(PGconn const *, char const *);

/* "psycopg_binary/pq/pgconn.pyx":926
 * 
 * 
 * cdef (Py_ssize_t, libpq.Oid *, char * const*, int *, int *) _query_params_args(             # <<<<<<<<<<<<<<
 *     param_values: Sequence[bytes | None] | None,
 *     param_types: Sequence[int] | None,
*/
struct __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc {
  Py_ssize_t f0;
  Oid *f1;
  char *const *f2;
  int *f3;
  int *f4;
};

/* "psycopg_binary/pq.pxd":24
 * 
 * 
 * cdef class PGconn:             # <<<<<<<<<<<<<<
 *     cdef libpq.PGconn* _pgconn_ptr
 *     cdef object __weakref__
*/
struct __pyx_obj_14psycopg_binary_2pq_PGconn {
  PyObject_HEAD
  struct __pyx_vtabstruct_14psycopg_binary_2pq_PGconn *__pyx_vtab;
  PGconn *_pgconn_ptr;
  PyObject *__weakref__;
  PyObject *notice_handler;
  PyObject *notify_handler;
  pid_t _procpid;
};


/* "psycopg_binary/pq.pxd":38
 * 
 * 
 * cdef class PGresult:             # <<<<<<<<<<<<<<
 *     cdef libpq.PGresult* _pgresult_ptr
 * 
*/
struct __pyx_obj_14psycopg_binary_2pq_PGresult {
  PyObject_HEAD
  struct __pyx_vtabstruct_14psycopg_binary_2pq_PGresult *__pyx_vtab;
  PGresult *_pgresult_ptr;
};


/* "psycopg_binary/pq.pxd":45
 * 
 * 
 * cdef class PGcancelConn:             # <<<<<<<<<<<<<<
 *     cdef libpq.PGcancelConn* pgcancelconn_ptr
 * 
*/
struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn {
  PyObject_HEAD
  struct __pyx_vtabstruct_14psycopg_binary_2pq_PGcancelConn *__pyx_vtab;
  PGcancelConn *pgcancelconn_ptr;
};


/* "psycopg_binary/pq.pxd":52
 * 
 * 
 * cdef class PGcancel:             # <<<<<<<<<<<<<<
 *     cdef libpq.PGcancel* pgcancel_ptr
 * 
*/
struct __pyx_obj_14psycopg_binary_2pq_PGcancel {
  PyObject_HEAD
  struct __pyx_vtabstruct_14psycopg_binary_2pq_PGcancel *__pyx_vtab;
  PGcancel *pgcancel_ptr;
};


/* "psycopg_binary/pq.pxd":59
 * 
 * 
 * cdef class Escaping:             # <<<<<<<<<<<<<<
 *     cdef PGconn conn
 * 
*/
struct __pyx_obj_14psycopg_binary_2pq_Escaping {
  PyObject_HEAD
  struct __pyx_vtabstruct_14psycopg_binary_2pq_Escaping *__pyx_vtab;
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *conn;
};


/* "psycopg_binary/pq.pxd":69
 * 
 * 
 * cdef class PQBuffer:             # <<<<<<<<<<<<<<
 *     cdef unsigned char *buf
 *     cdef Py_ssize_t len
*/
struct __pyx_obj_14psycopg_binary_2pq_PQBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_14psycopg_binary_2pq_PQBuffer *__pyx_vtab;
  unsigned char *buf;
  Py_ssize_t len;
};


/* "psycopg_binary/pq.pxd":77
 * 
 * 
 * cdef class ViewBuffer:             # <<<<<<<<<<<<<<
 *     cdef unsigned char *buf
 *     cdef Py_ssize_t len
*/
struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_14psycopg_binary_2pq_ViewBuffer *__pyx_vtab;
  unsigned char *buf;
  Py_ssize_t len;
  PyObject *obj;
};



/* "psycopg_binary/pq/pgconn.pyx":48
 *         )
 * 
 * cdef class PGconn:             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):
*/

struct __pyx_vtabstruct_14psycopg_binary_2pq_PGconn {
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *(*_from_ptr)(PGconn *);
  int (*flush)(struct __pyx_obj_14psycopg_binary_2pq_PGconn *, int __pyx_skip_dispatch);
  PyObject *(*notifies)(struct __pyx_obj_14psycopg_binary_2pq_PGconn *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_14psycopg_binary_2pq_PGconn *__pyx_vtabptr_14psycopg_binary_2pq_PGconn;


/* "psycopg_binary/pq/pgresult.pyx":14
 * 
 * 
 * @cython.freelist(8)             # <<<<<<<<<<<<<<
 * cdef class PGresult:
 *     def __cinit__(self):
*/

struct __pyx_vtabstruct_14psycopg_binary_2pq_PGresult {
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *(*_from_ptr)(PGresult *);
};
static struct __pyx_vtabstruct_14psycopg_binary_2pq_PGresult *__pyx_vtabptr_14psycopg_binary_2pq_PGresult;


/* "psycopg_binary/pq/pgcancel.pyx":8
 * 
 * 
 * cdef class PGcancelConn:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self.pgcancelconn_ptr = NULL
*/

struct __pyx_vtabstruct_14psycopg_binary_2pq_PGcancelConn {
  struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *(*_from_ptr)(PGcancelConn *);
};
static struct __pyx_vtabstruct_14psycopg_binary_2pq_PGcancelConn *__pyx_vtabptr_14psycopg_binary_2pq_PGcancelConn;


/* "psycopg_binary/pq/pgcancel.pyx":79
 * 
 * 
 * cdef class PGcancel:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self.pgcancel_ptr = NULL
*/

struct __pyx_vtabstruct_14psycopg_binary_2pq_PGcancel {
  struct __pyx_obj_14psycopg_binary_2pq_PGcancel *(*_from_ptr)(PGcancel *);
};
static struct __pyx_vtabstruct_14psycopg_binary_2pq_PGcancel *__pyx_vtabptr_14psycopg_binary_2pq_PGcancel;


/* "psycopg_binary/pq/escaping.pyx":11
 * 
 * 
 * cdef class Escaping:             # <<<<<<<<<<<<<<
 *     def __init__(self, PGconn conn = None):
 *         self.conn = conn
*/

struct __pyx_vtabstruct_14psycopg_binary_2pq_Escaping {
  PyObject *(*escape_literal)(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*escape_identifier)(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*escape_string)(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*escape_bytea)(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*unescape_bytea)(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, unsigned char const *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_14psycopg_binary_2pq_Escaping *__pyx_vtabptr_14psycopg_binary_2pq_Escaping;


/* "psycopg_binary/pq/pqbuffer.pyx":13
 * 
 * 
 * @cython.freelist(32)             # <<<<<<<<<<<<<<
 * cdef class PQBuffer:
 *     """
*/

struct __pyx_vtabstruct_14psycopg_binary_2pq_PQBuffer {
  struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *(*_from_buffer)(unsigned char *, Py_ssize_t);
};
static struct __pyx_vtabstruct_14psycopg_binary_2pq_PQBuffer *__pyx_vtabptr_14psycopg_binary_2pq_PQBuffer;


/* "psycopg_binary/pq/pqbuffer.pyx":56
 * 
 * 
 * @cython.freelist(32)             # <<<<<<<<<<<<<<
 * cdef class ViewBuffer:
 *     """
*/

struct __pyx_vtabstruct_14psycopg_binary_2pq_ViewBuffer {
  struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *(*_from_buffer)(PyObject *, unsigned char *, Py_ssize_t);
};
static struct __pyx_vtabstruct_14psycopg_binary_2pq_ViewBuffer *__pyx_vtabptr_14psycopg_binary_2pq_ViewBuffer;
/* #### 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)

/* FastTypeChecks.proto (used by GivenExceptionMatches) */
#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);
#define __Pyx_PyAnySet_Check(obj)  __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
#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_PyAnySet_Check(obj)  PyAnySet_Check(obj)
#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 GivenExceptionMatches) */
#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

/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
#if CYTHON_COMPILING_IN_CPYTHON
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_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)

/* 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

/* 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);

/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
#if 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);
#endif

/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
#else
CYTHON_UNUSED static PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* TupleFromArray.proto (used by fastcall) */


/* IncludeStringH.proto (used by PyObjectCompare) */
#include <string.h>

/* PyObjectCompare.proto (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);

/* UnicodeEquals.proto (used by fastcall) */
#define __Pyx_PyUnicode_Equals(s1, s2)  __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)

/* 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_VECTORCALL
    #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_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
    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
#if CYTHON_VECTORCALL_TPNEW
    #if !CYTHON_VECTORCALL
        #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
    #endif
    #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
    #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
    #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
    #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
    #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
#else
    #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_VECTORCALL
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
#endif

/* IgnoreException.proto (used by GetModuleGlobalName) */
static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)

/* 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

/* 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

/* 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 PyObjectCallOneArg) */
#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 nargsf, PyObject *kwargs);

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* JoinPyUnicode.proto */
#define __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH\
    (!CYTHON_COMPILING_IN_GRAAL && !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API)

/* JoinPyUnicode.export */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind);

/* RaiseException.export */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* RaiseArgTupleInvalid.export */
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) */
#define __Pyx_PyDict_items_TypePtr  (&PyDictKeys_Type)
#define __Pyx_PyDict_items_Check(obj)  PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
#define __Pyx_PyDict_items_CheckExact(obj)  Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
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)

/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
} __Pyx_CachedCFunction;

/* UnpackUnboundCMethod_impl.export */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);

/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
#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) */
#define __Pyx_PyDict_values_TypePtr  (&PyDictKeys_Type)
#define __Pyx_PyDict_values_Check(obj)  PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
#define __Pyx_PyDict_values_CheckExact(obj)  Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
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);

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL
#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

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif

/* PyMemoryError_Check.proto */
#define __Pyx_PyExc_MemoryError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_MemoryError)

/* FormatTypeName.proto (used by pybuiltin_invalid) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%N"
#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
#elif CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#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

/* pybuiltin_invalid.export */
static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *builtin_type_name, const char *argname);

/* pyint_simplify.proto */
static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none);

/* 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

/* PyAssertionError_Check.proto */
#define __Pyx_PyExc_AssertionError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_AssertionError)

/* 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
);

/* ArgTypeTestError.export */
static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact);

/* RaiseErrorWithObjectType1.proto (used by RaiseUnexpectedTypeError) */
#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
CYTHON_UNUSED
static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj);

/* RaiseUnexpectedTypeError.proto */
CYTHON_UNUSED
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* RaiseUnboundLocalError.proto */
static void __Pyx_RaiseUnboundLocalError(const char *varname);

/* PyObjectCompare.proto */
static CYTHON_INLINE int __Pyx_PyObject_CompareBoolNe_object_str(PyObject *op1, PyObject *op2, int pyop);

/* PyObjectCompare.proto */
static CYTHON_INLINE int __Pyx_PyObject_CompareBoolNe_object_object(PyObject *op1, PyObject *op2, int pyop);

/* PyTypeError_Check.proto */
#define __Pyx_PyExc_TypeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_TypeError)

/* PyException_Check.proto */
#define __Pyx_PyExc_Exception_Check(obj)  __Pyx_TypeCheck(obj, PyExc_Exception)

/* RaiseErrorWithObjectTypes.proto (used by ExtTypeTest) */
#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
CYTHON_UNUSED
static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* 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

/* 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

/* 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

/* PyValueError_Check.proto */
#define __Pyx_PyExc_ValueError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ValueError)

/* 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_Py_ssize_t(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

/* PyFrozenDict.proto (used by GetItemInt) */
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyFrozenDict_TypePtr  ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
#define __Pyx_PyFrozenDict_New(it)  __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
#define __Pyx_PyFrozenDict_NewEmpty()  __Pyx_PyFrozenDict_New(NULL)
#define __Pyx_PyFrozenDict_Check(obj)  PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
#define __Pyx_PyFrozenDict_CheckExact(obj)  Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
#define __Pyx_PyAnyDict_Check(obj)   __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
    return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
}
#define __Pyx_PyAnyDict_CheckExact(obj)  __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
    return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
}
#elif PY_VERSION_HEX >= 0x030f00a6 ||\
    (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
#define __Pyx_PyFrozenDict_TypePtr  (&PyFrozenDict_Type)
#define __Pyx_PyFrozenDict_New(it)  PyFrozenDict_New(it)
#define __Pyx_PyFrozenDict_NewEmpty()  PyFrozenDict_New(NULL)
#define __Pyx_PyFrozenDict_Check(obj)  PyFrozenDict_Check(obj)
#define __Pyx_PyFrozenDict_CheckExact(obj)  PyFrozenDict_CheckExact(obj)
#define __Pyx_PyAnyDict_Check(obj)  PyAnyDict_Check(obj)
#define __Pyx_PyAnyDict_CheckExact(obj)  PyAnyDict_CheckExact(obj)
#else
#define __Pyx_PyFrozenDict_TypePtr  (&PyDict_Type)
static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
    if (!it) {
        return PyDict_New();
    } else if (PyDict_Check(it)) {
        return PyDict_Copy(it);
    } else {
        PyObject *dict = PyDict_New();
        if (!dict) return NULL;
        PyObject *result = PyNumber_InPlaceOr(dict, it);
        Py_DECREF(dict);
        return result;
    }
}
#define __Pyx_PyFrozenDict_NewEmpty()  PyDict_New()
#define __Pyx_PyFrozenDict_Check(obj)  PyDict_Check(obj)
#define __Pyx_PyFrozenDict_CheckExact(obj)  PyDict_CheckExact(obj)
#define __Pyx_PyAnyDict_Check(obj)  PyDict_Check(obj)
#define __Pyx_PyAnyDict_CheckExact(obj)  PyDict_CheckExact(obj)
#endif

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, 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, 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 wraparound, int boundscheck, int unsafe_shared);

/* decode_c_string_utf16.proto (used by decode_c_string) */
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_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, 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));

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x);
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectVectorcallKwds.proto */
#if CYTHON_VECTORCALL
#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
#else
#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n);
CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
#endif

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* AllocateExtensionType.proto */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);

/* CallSlotAsVectorcall.proto */
#if CYTHON_VECTORCALL_TPNEW
typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k);
#endif

/* RaiseErrorWithObjectType.proto (used by CallNewInitFromVectorcall) */
#define __Pyx_RaiseTypeErrorWithObjectType(message, obj)  __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj)  __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
CYTHON_UNUSED
static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);

/* CallNewInitFromVectorcall.proto */
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif

/* DeallocKeepAlive.proto */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_DeallocKeepAliveBegin(o) do {\
        _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
        _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
        _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
    } while (0)
#define __Pyx_DeallocKeepAliveEnd(o)\
        _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
#else
#define __Pyx_DeallocKeepAliveBegin(o) Py_SET_REFCNT(o, Py_REFCNT(o) + 1)
#define __Pyx_DeallocKeepAliveEnd(o)   Py_SET_REFCNT(o, Py_REFCNT(o) - 1)
#endif

/* CallTypeTraverse.proto */
#if !CYTHON_USE_TYPE_SPECS
#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

/* 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

/* CallSlotAsVectorcall.proto */
#if CYTHON_VECTORCALL_TPNEW
typedef int (*__Pyx_tpinitvectorcallfunc)(PyObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k);
#endif

/* FunctionExport.proto */
static int __Pyx_ExportFunction(PyObject *api_dict, const char *name, void (*f)(void), const char *sig);

/* GetApiDict.proto */
static PyObject *__Pyx_ApiExport_GetApiDict(void);

/* PyObjectCallMethod0.proto (used by PyType_Ready) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* GetTypeDictOffset.proto (used by ValidateBasesTuple) */
#if !CYTHON_USE_TYPE_SLOTS
CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result);
#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, int has_dictoffset, PyObject *bases);
#endif

/* PyType_Ready.export */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

/* GetVTable.proto (used by MergeVTables) */
static int __Pyx_GetVtable(PyTypeObject *type, void** table);

/* MergeVTables.proto (used by SetVTable) */
static int __Pyx_MergeVtables(PyTypeObject *type);

/* SetVTable.export */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

/* LimitedApiGetTypeTypeDict.proto (used by DelItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
#endif

/* DelItemOnTypeDict.proto (used by SetupReduce) */
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

/* DelItemOnTypeDict.export */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);

/* SetItemOnTypeDict.proto (used by SetupReduce) */
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* SetItemOnTypeDict.export */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);

/* SetupReduce.export */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
#define __PYX_HAVE_RT_ImportType_proto_3_3_0
#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_3_0(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_3_0 {
   __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
};
static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size);
#endif

/* 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

/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
CYTHON_UNUSED static PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);

/* ListFromArray.proto (used by ImportImpl) */


/* 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);

/* ImportFrom.export */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* dict_setdefault.proto (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);

/* AddModuleRef.proto (used by FetchSharedCythonModule) */
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
     __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);

/* VerifyCachedType.proto (used by FetchCommonType) */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize);

/* FetchCommonType.proto (used by CommonTypesMetaclass) */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);

/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED

/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
#define __Pyx_CyFunction_USED
#if CYTHON_OPAQUE_SHARED_TYPES
#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
#else
#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
#endif
#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_as_CyFunctionObject(f))->func_closure)
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx__CyFunction_GetClassObj(f)\
      ((f)->func_classobj)
#else
  #define __Pyx__CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_GetClassObj(f)\
    __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_OPAQUE_OBJECTS
    PyObject_HEAD
#endif
    PyMethodDef *func_methoddef;
    PyObject *func_module;
#else
    PyCMethodObject func;
#endif
#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
    __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 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;
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
    PyObject *func_is_coroutine;
#endif
} __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)  Py_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 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_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

/* PyMethodNew.proto (used by CythonFunctionShared) */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);

/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
#if 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) */
static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
#if CYTHON_VECTORCALL
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);
#endif

/* CythonFunction.export */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static PyTypeObject *__Pyx_Get_CyFunction_Type(void);

/* ClassMethod.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include "descrobject.h"
#endif
CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method);

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

/* 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);

/* PyObjectCall2Args.proto (used by Py3ClassCreate) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */
#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

/* Py3ClassCreate.export */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* CLineInTraceback.proto (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);

/* PyObjectCallMethod1.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* CheckUnpickleChecksumError.export */
static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members);

/* UpdateUnpickledDict.export */
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);

/* CheckUnpickleChecksum.proto */
static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);

/* PyObjectVectorcallMethodKwds.proto (used by CIntToPy) */
#if CYTHON_VECTORCALL
#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int 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_PY_LONG_LONG(PY_LONG_LONG value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PGPing(PGPing value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_ConnStatusType(ConnStatusType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PGTransactionStatusType(PGTransactionStatusType value);

/* CIntFromPy.proto */
static CYTHON_INLINE Oid __Pyx_PyLong_As_Oid(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_ExecStatusType(ExecStatusType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PGpipelineStatus(PGpipelineStatus value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Oid(Oid value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PostgresPollingStatusType(PostgresPollingStatusType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);

/* 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);

/* 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);

/* DecompressString_LZSS.proto */
static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#include <stdlib.h>
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_VECTORCALL
        #define __PYX_VECTORCALL_ABI_SUFFIX  "_vectorcall"
    #else
        #define __PYX_VECTORCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_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
#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
    #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
#else
    #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
#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 __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."

static struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_f_14psycopg_binary_2pq_6PGconn__from_ptr(PGconn *__pyx_v_ptr); /* proto*/
static int __pyx_f_14psycopg_binary_2pq_6PGconn_flush(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_6PGconn_notifies(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(PGresult *__pyx_v_ptr); /* proto*/
static struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_f_14psycopg_binary_2pq_12PGcancelConn__from_ptr(PGcancelConn *__pyx_v_ptr); /* proto*/
static struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_f_14psycopg_binary_2pq_8PGcancel__from_ptr(PGcancel *__pyx_v_ptr); /* proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_8Escaping_escape_literal(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_8Escaping_escape_identifier(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_8Escaping_escape_string(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_8Escaping_escape_bytea(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_8Escaping_unescape_bytea(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, unsigned char const *__pyx_v_data, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_f_14psycopg_binary_2pq_8PQBuffer__from_buffer(unsigned char *__pyx_v_buf, Py_ssize_t __pyx_v_length); /* proto*/
static struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_f_14psycopg_binary_2pq_10ViewBuffer__from_buffer(PyObject *__pyx_v_obj, unsigned char *__pyx_v_buf, Py_ssize_t __pyx_v_length); /* proto*/

/* Module declarations from "psycopg_binary.pq.libpq" */

/* Module declarations from "cython" */

/* Module declarations from "libc.string" */

/* Module declarations from "libc.stdio" */

/* Module declarations from "cpython.mem" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.type" */

/* Module declarations from "cpython" */

/* Module declarations from "cpython.object" */

/* Module declarations from "cpython.bytes" */

/* Module declarations from "cpython.sequence" */

/* Module declarations from "cpython.memoryview" */

/* Module declarations from "cpython.buffer" */

/* Module declarations from "psycopg_binary.pq" */
static int __pyx_f_14psycopg_binary_2pq__buffer_as_string_and_size(PyObject *, char **, Py_ssize_t *); /*proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq__check_supported(PyObject *, int); /*proto*/
static void *__pyx_f_14psycopg_binary_2pq__call_libpq_with_param(struct __pyx_obj_14psycopg_binary_2pq_PGconn *, __pyx_t_14psycopg_binary_2pq_conn_f_with_param, char const *); /*proto*/
static int __pyx_f_14psycopg_binary_2pq__call_libpq_int(struct __pyx_obj_14psycopg_binary_2pq_PGconn *, __pyx_t_14psycopg_binary_2pq_conn_int_f); /*proto*/
static int __pyx_f_14psycopg_binary_2pq__call_libpq_int_with_param(struct __pyx_obj_14psycopg_binary_2pq_PGconn *, __pyx_t_14psycopg_binary_2pq_conn_int_f_with_param, char const *); /*proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq__call_libpq_bytes(struct __pyx_obj_14psycopg_binary_2pq_PGconn *, __pyx_t_14psycopg_binary_2pq_conn_bytes_f); /*proto*/
static void __pyx_f_14psycopg_binary_2pq_notice_receiver(void *, PGresult const *); /*proto*/
static __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_f_14psycopg_binary_2pq__query_params_args(PyObject *, PyObject *, PyObject *); /*proto*/
static void __pyx_f_14psycopg_binary_2pq__clear_query_params(Oid *, char *const *, int *, int *); /*proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq__options_from_array(PQconninfoOption *); /*proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq___pyx_unpickle_Escaping__set_state(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "psycopg_binary.pq"
extern int __pyx_module_is_main_psycopg_binary__pq;
int __pyx_module_is_main_psycopg_binary__pq = 0;

/* Implementation of "psycopg_binary.pq" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_id;
/* #### Code section: string_decls ### */
static const char __pyx_k_w[] = "w";
static const char __pyx_k_UTF8[] = "UTF8";
static const char __pyx_k_conn[] = "conn";
static const char __pyx_k_ignore[] = "ignore";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_client_encoding[] = "client_encoding";
static const char __pyx_k_libpq_Python_wrapper_using_cyth[] = "\nlibpq Python wrapper using cython bindings.\n";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_14psycopg_binary_2pq_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_6PGconn___cinit__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static void __pyx_pf_14psycopg_binary_2pq_6PGconn_2__dealloc__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_4__repr__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_pf_14psycopg_binary_2pq_6PGconn_6connect(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, char const *__pyx_v_conninfo); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_pf_14psycopg_binary_2pq_6PGconn_8connect_start(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, char const *__pyx_v_conninfo); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_10connect_poll(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_12finish(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_10pgconn_ptr___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_4info___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_14reset(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_16reset_start(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_18reset_poll(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_20ping(CYTHON_UNUSED PyTypeObject *__pyx_v_self, char const *__pyx_v_conninfo); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_2db___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_4user___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_8password___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_4host___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_8hostaddr___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_4port___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_3tty___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_7options___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_6status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_18transaction_status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_22parameter_status(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_13error_message___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_24get_error_message(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_9_encoding___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_16protocol_version___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_21full_protocol_version___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_14server_version___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_6socket___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_11backend_pid___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_14needs_password___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_13used_password___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_11used_gssapi___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_10ssl_in_use___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_26exec_(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_28send_query(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_30exec_params(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_types, PyObject *__pyx_v_param_formats, int __pyx_v_result_format); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_32send_query_params(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_types, PyObject *__pyx_v_param_formats, int __pyx_v_result_format); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_34send_prepare(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, char const *__pyx_v_command, PyObject *__pyx_v_param_types); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_36send_query_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_formats, int __pyx_v_result_format); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_38prepare(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, char const *__pyx_v_command, PyObject *__pyx_v_param_types); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_40exec_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_formats, int __pyx_v_result_format); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_42describe_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_44send_describe_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_46describe_portal(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_48send_describe_portal(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_50close_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_52send_close_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_54close_portal(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_56send_close_portal(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_58get_result(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_60consume_input(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_62is_busy(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_11nonblocking___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_6PGconn_11nonblocking_2__set__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, int __pyx_v_arg); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_64flush(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_66set_single_row_mode(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_68set_chunked_rows_mode(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_pf_14psycopg_binary_2pq_6PGconn_70cancel_conn(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_pf_14psycopg_binary_2pq_6PGconn_72get_cancel(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_74notifies(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_76put_copy_data(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_78put_copy_end(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_error); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_80get_copy_data(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, int __pyx_v_async_); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_82trace(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_fileno); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_84set_trace_flags(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_flags); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_86untrace(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_88encrypt_password(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_passwd, char const *__pyx_v_user, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_90change_password(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_user, char const *__pyx_v_passwd); /* proto */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_92make_empty_result(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, int __pyx_v_exec_status); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_15pipeline_status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_94enter_pipeline_mode(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_96exit_pipeline_mode(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_98pipeline_sync(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_100send_flush_request(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_14notice_handler___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_6PGconn_14notice_handler_2__set__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_6PGconn_14notice_handler_4__del__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_14notify_handler___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_6PGconn_14notify_handler_2__set__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_6PGconn_14notify_handler_4__del__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_102__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_104__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_8PGresult___cinit__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static void __pyx_pf_14psycopg_binary_2pq_8PGresult_2__dealloc__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_4__repr__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_6clear(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_12pgresult_ptr___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_6status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_13error_message___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_8get_error_message(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_10error_field(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_fieldcode); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_7ntuples___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_7nfields___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_12fname(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_14ftable(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_16ftablecol(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_18fformat(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_20ftype(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_22fmod(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_24fsize(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_13binary_tuples___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_26get_value(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_row_number, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_7nparams___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_28param_type(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_param_number); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_14command_status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_14command_tuples___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_9oid_value___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_30set_attributes(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, PyObject *__pyx_v_descriptions); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_12PGcancelConn___cinit__(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static void __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_2__dealloc__(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_4start(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_6blocking(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_8poll(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_6status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_6socket___get__(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_13error_message___get__(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_10get_error_message(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_12reset(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_14finish(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_16_ensure_pgcancelconn(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_8PGcancel___cinit__(struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_self); /* proto */
static void __pyx_pf_14psycopg_binary_2pq_8PGcancel_2__dealloc__(struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGcancel_4free(struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGcancel_6cancel(struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGcancel_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGcancel_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8Conninfo_get_defaults(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8Conninfo_2parse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, char const *__pyx_v_conninfo); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8Conninfo_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_8Escaping___init__(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_conn); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_2escape_literal(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_4escape_identifier(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_6escape_string(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_8escape_bytea(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_10unescape_bytea(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, unsigned char const *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_12__reduce_cython__(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_14__setstate_cython__(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_8PQBuffer___cinit__(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self); /* proto */
static void __pyx_pf_14psycopg_binary_2pq_8PQBuffer_2__dealloc__(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PQBuffer_4__repr__(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_8PQBuffer_6__getbuffer__(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags); /* proto */
static void __pyx_pf_14psycopg_binary_2pq_8PQBuffer_8__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PQBuffer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_8PQBuffer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_10ViewBuffer___cinit__(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_10ViewBuffer_2__repr__(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_self); /* proto */
static int __pyx_pf_14psycopg_binary_2pq_10ViewBuffer_4__getbuffer__(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags); /* proto */
static void __pyx_pf_14psycopg_binary_2pq_10ViewBuffer_6__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_10ViewBuffer_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_10ViewBuffer_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_14psycopg_binary_2pq_2__pyx_unpickle_Escaping(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__initialisation_14psycopg_binary_2pq_PGconn(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGconn(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_PGconn(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_14psycopg_binary_2pq_PGconn __pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGconn
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_PGconn(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_PGresult(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGresult(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_PGresult(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_14psycopg_binary_2pq_PGresult __pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGresult
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_PGresult(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_PGcancelConn(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGcancelConn(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_PGcancelConn(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_14psycopg_binary_2pq_PGcancelConn __pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGcancelConn
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_PGcancelConn(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_PGcancel(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGcancel(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_PGcancel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_14psycopg_binary_2pq_PGcancel __pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGcancel
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_PGcancel(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_Escaping(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_Escaping(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_Escaping(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_14psycopg_binary_2pq_Escaping __pyx_tp_new_vectorcall_14psycopg_binary_2pq_Escaping
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_Escaping(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_14psycopg_binary_2pq_Escaping(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_init_14psycopg_binary_2pq_Escaping __pyx_pw_14psycopg_binary_2pq_8Escaping_1__init__
#endif
static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_PQBuffer(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PQBuffer(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_PQBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_14psycopg_binary_2pq_PQBuffer __pyx_tp_new_vectorcall_14psycopg_binary_2pq_PQBuffer
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_PQBuffer(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_ViewBuffer(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_ViewBuffer(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
); /*proto*/
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_ViewBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif
#if !CYTHON_VECTORCALL_TPNEW
#define __pyx_tp_new_14psycopg_binary_2pq_ViewBuffer __pyx_tp_new_vectorcall_14psycopg_binary_2pq_ViewBuffer
#endif
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_ViewBuffer(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
#endif
/* #### 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

#ifdef __cplusplus
namespace {
  #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;
    PyObject *__pyx_type_14psycopg_binary_2pq_PGconn;
    PyObject *__pyx_type_14psycopg_binary_2pq_PGresult;
    PyObject *__pyx_type_14psycopg_binary_2pq_PGcancelConn;
    PyObject *__pyx_type_14psycopg_binary_2pq_PGcancel;
    PyObject *__pyx_type_14psycopg_binary_2pq_Escaping;
    PyObject *__pyx_type_14psycopg_binary_2pq_PQBuffer;
    PyObject *__pyx_type_14psycopg_binary_2pq_ViewBuffer;
    PyTypeObject *__pyx_ptype_14psycopg_binary_2pq_PGconn;
    PyTypeObject *__pyx_ptype_14psycopg_binary_2pq_PGresult;
    PyTypeObject *__pyx_ptype_14psycopg_binary_2pq_PGcancelConn;
    PyTypeObject *__pyx_ptype_14psycopg_binary_2pq_PGcancel;
    PyTypeObject *__pyx_ptype_14psycopg_binary_2pq_Escaping;
    PyTypeObject *__pyx_ptype_14psycopg_binary_2pq_PQBuffer;
    PyTypeObject *__pyx_ptype_14psycopg_binary_2pq_ViewBuffer;
    __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
    __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
    __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
    int __pyx_k__7;
    int __pyx_k__8;
    int __pyx_k__9;
    int __pyx_k__10;
    PyObject *__pyx_tuple[5];
    PyObject *__pyx_codeobj_tab[94];
    PyObject *__pyx_string_tab[525];
    PyObject *__pyx_number_tab[1];
/* #### Code section: module_state_contents ### */
/* PyFrozenDict.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_PyFrozenDictType;
#endif


#if CYTHON_USE_FREELISTS
struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_freelist_14psycopg_binary_2pq_PGresult[8];
int __pyx_freecount_14psycopg_binary_2pq_PGresult;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_freelist_14psycopg_binary_2pq_PQBuffer[32];
int __pyx_freecount_14psycopg_binary_2pq_PQBuffer;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_freelist_14psycopg_binary_2pq_ViewBuffer[32];
int __pyx_freecount_14psycopg_binary_2pq_ViewBuffer;
#endif
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CythonFunctionPerModule.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;

/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;
#ifdef __cplusplus
} /* anonymous namespace */
#endif

#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__6 __pyx_string_tab[0]
#define __pyx_kp_u__3 __pyx_string_tab[1]
#define __pyx_kp_u__12 __pyx_string_tab[2]
#define __pyx_kp_u__11 __pyx_string_tab[3]
#define __pyx_kp_u_at_0x __pyx_string_tab[4]
#define __pyx_kp_u_available_instead __pyx_string_tab[5]
#define __pyx_kp_u_bytes __pyx_string_tab[6]
#define __pyx_kp_u_on_the_client_version __pyx_string_tab[7]
#define __pyx_kp_u_param_formats_2 __pyx_string_tab[8]
#define __pyx_kp_u_param_types_2 __pyx_string_tab[9]
#define __pyx_kp_u_param_values_but __pyx_string_tab[10]
#define __pyx_kp_u_requires_libpq_from_PostgreSQL __pyx_string_tab[11]
#define __pyx_kp_u_PGresult_None __pyx_string_tab[12]
#define __pyx_kp_u__14 __pyx_string_tab[13]
#define __pyx_kp_u_tree_fragment __pyx_string_tab[14]
#define __pyx_kp_u__15 __pyx_string_tab[15]
#define __pyx_kp_u__13 __pyx_string_tab[16]
#define __pyx_kp_u_ __pyx_string_tab[17]
#define __pyx_kp_u__2 __pyx_string_tab[18]
#define __pyx_kp_u__4 __pyx_string_tab[19]
#define __pyx_kp_u__5 __pyx_string_tab[20]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[21]
#define __pyx_kp_u_PQsendFlushRequest __pyx_string_tab[22]
#define __pyx_kp_u_PQsetResultAttrs_failed __pyx_string_tab[23]
#define __pyx_kp_u_Sequence_bytes_None_None __pyx_string_tab[24]
#define __pyx_kp_u_Sequence_bytes_None __pyx_string_tab[25]
#define __pyx_kp_u_Sequence_int_None __pyx_string_tab[26]
#define __pyx_kp_u_at_0x_2 __pyx_string_tab[27]
#define __pyx_kp_u_add_note __pyx_string_tab[28]
#define __pyx_kp_u_bytes_or_buffer_expected_got __pyx_string_tab[29]
#define __pyx_kp_u_bytes_None __pyx_string_tab[30]
#define __pyx_kp_u_cancel_connection_not_opened __pyx_string_tab[31]
#define __pyx_kp_u_cancel_failed __pyx_string_tab[32]
#define __pyx_kp_u_close_prepared_failed __pyx_string_tab[33]
#define __pyx_kp_u_connection_not_in_pipeline_mode __pyx_string_tab[34]
#define __pyx_kp_u_consuming_input_failed __pyx_string_tab[35]
#define __pyx_kp_u_couldn_t_allocate_PGconn __pyx_string_tab[36]
#define __pyx_kp_u_couldn_t_allocate_connection_def __pyx_string_tab[37]
#define __pyx_kp_u_couldn_t_allocate_connection_inf __pyx_string_tab[38]
#define __pyx_kp_u_couldn_t_allocate_empty_PGresult __pyx_string_tab[39]
#define __pyx_kp_u_couldn_t_allocate_for_escape_byt __pyx_string_tab[40]
#define __pyx_kp_u_couldn_t_allocate_for_unescape_b __pyx_string_tab[41]
#define __pyx_kp_u_couldn_t_allocate_on_conninfo_pa __pyx_string_tab[42]
#define __pyx_kp_u_couldn_t_create_cancel_object __pyx_string_tab[43]
#define __pyx_kp_u_couldn_t_create_cancelConn_objec __pyx_string_tab[44]
#define __pyx_kp_u_couldn_t_reset_connection __pyx_string_tab[45]
#define __pyx_kp_u_couldn_t_send_cancellation __pyx_string_tab[46]
#define __pyx_kp_u_currently_only_supported_on_Linu __pyx_string_tab[47]
#define __pyx_kp_u_describe_prepared_failed __pyx_string_tab[48]
#define __pyx_kp_u_disable __pyx_string_tab[49]
#define __pyx_kp_u_enable __pyx_string_tab[50]
#define __pyx_kp_u_error_in_notice_receiver_s __pyx_string_tab[51]
#define __pyx_kp_u_escape_identifier_failed __pyx_string_tab[52]
#define __pyx_kp_u_escape_identifier_failed_no_conn __pyx_string_tab[53]
#define __pyx_kp_u_escape_literal_failed __pyx_string_tab[54]
#define __pyx_kp_u_escape_literal_failed_no_connect __pyx_string_tab[55]
#define __pyx_kp_u_escape_string_failed __pyx_string_tab[56]
#define __pyx_kp_u_executing_prepared_query_failed __pyx_string_tab[57]
#define __pyx_kp_u_executing_query_failed __pyx_string_tab[58]
#define __pyx_kp_u_failed_to_enter_pipeline_mode __pyx_string_tab[59]
#define __pyx_kp_u_failed_to_sync_pipeline __pyx_string_tab[60]
#define __pyx_kp_u_flush_request_failed __pyx_string_tab[61]
#define __pyx_kp_u_flushing_failed __pyx_string_tab[62]
#define __pyx_kp_u_flushing_failed_the_connection_i __pyx_string_tab[63]
#define __pyx_kp_u_gc __pyx_string_tab[64]
#define __pyx_kp_u_got __pyx_string_tab[65]
#define __pyx_kp_u_isenabled __pyx_string_tab[66]
#define __pyx_kp_u_list_ConninfoOption __pyx_string_tab[67]
#define __pyx_kp_u_list_PGresAttDesc __pyx_string_tab[68]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[69]
#define __pyx_kp_u_password_encryption_failed __pyx_string_tab[70]
#define __pyx_kp_u_preparing_query_failed __pyx_string_tab[71]
#define __pyx_kp_u_psycopg_binary_pq_pyx __pyx_string_tab[72]
#define __pyx_kp_u_psycopg_binary_pq_conninfo_pyx __pyx_string_tab[73]
#define __pyx_kp_u_psycopg_binary_pq_escaping_pyx __pyx_string_tab[74]
#define __pyx_kp_u_psycopg_binary_pq_pgcancel_pyx __pyx_string_tab[75]
#define __pyx_kp_u_psycopg_binary_pq_pgconn_pyx __pyx_string_tab[76]
#define __pyx_kp_u_psycopg_binary_pq_pgresult_pyx __pyx_string_tab[77]
#define __pyx_kp_u_receiving_copy_data_failed __pyx_string_tab[78]
#define __pyx_kp_u_sending_close_prepared_failed __pyx_string_tab[79]
#define __pyx_kp_u_sending_copy_data_failed __pyx_string_tab[80]
#define __pyx_kp_u_sending_copy_end_failed __pyx_string_tab[81]
#define __pyx_kp_u_sending_describe_prepared_failed __pyx_string_tab[82]
#define __pyx_kp_u_sending_prepared_query_failed __pyx_string_tab[83]
#define __pyx_kp_u_sending_query_and_params_failed __pyx_string_tab[84]
#define __pyx_kp_u_sending_query_failed __pyx_string_tab[85]
#define __pyx_kp_u_setting_chunked_rows_mode_failed __pyx_string_tab[86]
#define __pyx_kp_u_setting_nonblocking_failed __pyx_string_tab[87]
#define __pyx_kp_u_setting_single_row_mode_failed __pyx_string_tab[88]
#define __pyx_kp_u_the_cancel_connection_is_closed __pyx_string_tab[89]
#define __pyx_kp_u_the_connection_is_closed __pyx_string_tab[90]
#define __pyx_kp_u_the_connection_is_lost __pyx_string_tab[91]
#define __pyx_kp_u_tuple_int_memoryview __pyx_string_tab[92]
#define __pyx_kp_u_utf_8 __pyx_string_tab[93]
#define __pyx_n_u_COMMAND_OK __pyx_string_tab[94]
#define __pyx_n_u_Conninfo __pyx_string_tab[95]
#define __pyx_n_u_Conninfo___repr __pyx_string_tab[96]
#define __pyx_n_u_Conninfo_get_defaults __pyx_string_tab[97]
#define __pyx_n_u_Conninfo_parse __pyx_string_tab[98]
#define __pyx_n_u_ConninfoOption __pyx_string_tab[99]
#define __pyx_n_u_Escaping __pyx_string_tab[100]
#define __pyx_n_u_Escaping___reduce_cython __pyx_string_tab[101]
#define __pyx_n_u_Escaping___setstate_cython __pyx_string_tab[102]
#define __pyx_n_u_Escaping_escape_bytea __pyx_string_tab[103]
#define __pyx_n_u_Escaping_escape_identifier __pyx_string_tab[104]
#define __pyx_n_u_Escaping_escape_literal __pyx_string_tab[105]
#define __pyx_n_u_Escaping_escape_string __pyx_string_tab[106]
#define __pyx_n_u_Escaping_unescape_bytea __pyx_string_tab[107]
#define __pyx_n_u_ExecStatus __pyx_string_tab[108]
#define __pyx_n_u_Format __pyx_string_tab[109]
#define __pyx_n_u_None __pyx_string_tab[110]
#define __pyx_n_u_NotSupportedError __pyx_string_tab[111]
#define __pyx_n_u_OperationalError __pyx_string_tab[112]
#define __pyx_n_u_PGcancel __pyx_string_tab[113]
#define __pyx_n_u_PGcancel___reduce_cython __pyx_string_tab[114]
#define __pyx_n_u_PGcancel___setstate_cython __pyx_string_tab[115]
#define __pyx_n_u_PGcancel_cancel __pyx_string_tab[116]
#define __pyx_n_u_PGcancel_free __pyx_string_tab[117]
#define __pyx_n_u_PGcancelConn __pyx_string_tab[118]
#define __pyx_n_u_PGcancelConn___reduce_cython __pyx_string_tab[119]
#define __pyx_n_u_PGcancelConn___setstate_cython __pyx_string_tab[120]
#define __pyx_n_u_PGcancelConn__ensure_pgcancelcon __pyx_string_tab[121]
#define __pyx_n_u_PGcancelConn_blocking __pyx_string_tab[122]
#define __pyx_n_u_PGcancelConn_finish __pyx_string_tab[123]
#define __pyx_n_u_PGcancelConn_get_error_message __pyx_string_tab[124]
#define __pyx_n_u_PGcancelConn_poll __pyx_string_tab[125]
#define __pyx_n_u_PGcancelConn_reset __pyx_string_tab[126]
#define __pyx_n_u_PGcancelConn_start __pyx_string_tab[127]
#define __pyx_n_u_PGconn __pyx_string_tab[128]
#define __pyx_n_u_PGconn___reduce_cython __pyx_string_tab[129]
#define __pyx_n_u_PGconn___setstate_cython __pyx_string_tab[130]
#define __pyx_n_u_PGconn_cancel_conn __pyx_string_tab[131]
#define __pyx_n_u_PGconn_change_password __pyx_string_tab[132]
#define __pyx_n_u_PGconn_close_portal __pyx_string_tab[133]
#define __pyx_n_u_PGconn_close_prepared __pyx_string_tab[134]
#define __pyx_n_u_PGconn_connect __pyx_string_tab[135]
#define __pyx_n_u_PGconn_connect_poll __pyx_string_tab[136]
#define __pyx_n_u_PGconn_connect_start __pyx_string_tab[137]
#define __pyx_n_u_PGconn_consume_input __pyx_string_tab[138]
#define __pyx_n_u_PGconn_describe_portal __pyx_string_tab[139]
#define __pyx_n_u_PGconn_describe_prepared __pyx_string_tab[140]
#define __pyx_n_u_PGconn_encrypt_password __pyx_string_tab[141]
#define __pyx_n_u_PGconn_enter_pipeline_mode __pyx_string_tab[142]
#define __pyx_n_u_PGconn_exec __pyx_string_tab[143]
#define __pyx_n_u_PGconn_exec_params __pyx_string_tab[144]
#define __pyx_n_u_PGconn_exec_prepared __pyx_string_tab[145]
#define __pyx_n_u_PGconn_exit_pipeline_mode __pyx_string_tab[146]
#define __pyx_n_u_PGconn_finish __pyx_string_tab[147]
#define __pyx_n_u_PGconn_flush __pyx_string_tab[148]
#define __pyx_n_u_PGconn_get_cancel __pyx_string_tab[149]
#define __pyx_n_u_PGconn_get_copy_data __pyx_string_tab[150]
#define __pyx_n_u_PGconn_get_error_message __pyx_string_tab[151]
#define __pyx_n_u_PGconn_get_result __pyx_string_tab[152]
#define __pyx_n_u_PGconn_is_busy __pyx_string_tab[153]
#define __pyx_n_u_PGconn_make_empty_result __pyx_string_tab[154]
#define __pyx_n_u_PGconn_notifies __pyx_string_tab[155]
#define __pyx_n_u_PGconn_parameter_status __pyx_string_tab[156]
#define __pyx_n_u_PGconn_ping __pyx_string_tab[157]
#define __pyx_n_u_PGconn_pipeline_sync __pyx_string_tab[158]
#define __pyx_n_u_PGconn_prepare __pyx_string_tab[159]
#define __pyx_n_u_PGconn_put_copy_data __pyx_string_tab[160]
#define __pyx_n_u_PGconn_put_copy_end __pyx_string_tab[161]
#define __pyx_n_u_PGconn_reset __pyx_string_tab[162]
#define __pyx_n_u_PGconn_reset_poll __pyx_string_tab[163]
#define __pyx_n_u_PGconn_reset_start __pyx_string_tab[164]
#define __pyx_n_u_PGconn_send_close_portal __pyx_string_tab[165]
#define __pyx_n_u_PGconn_send_close_prepared __pyx_string_tab[166]
#define __pyx_n_u_PGconn_send_describe_portal __pyx_string_tab[167]
#define __pyx_n_u_PGconn_send_describe_prepared __pyx_string_tab[168]
#define __pyx_n_u_PGconn_send_flush_request __pyx_string_tab[169]
#define __pyx_n_u_PGconn_send_prepare __pyx_string_tab[170]
#define __pyx_n_u_PGconn_send_query __pyx_string_tab[171]
#define __pyx_n_u_PGconn_send_query_params __pyx_string_tab[172]
#define __pyx_n_u_PGconn_send_query_prepared __pyx_string_tab[173]
#define __pyx_n_u_PGconn_set_chunked_rows_mode __pyx_string_tab[174]
#define __pyx_n_u_PGconn_set_single_row_mode __pyx_string_tab[175]
#define __pyx_n_u_PGconn_set_trace_flags __pyx_string_tab[176]
#define __pyx_n_u_PGconn_trace __pyx_string_tab[177]
#define __pyx_n_u_PGconn_untrace __pyx_string_tab[178]
#define __pyx_n_u_PGnotify __pyx_string_tab[179]
#define __pyx_n_u_PGresAttDesc __pyx_string_tab[180]
#define __pyx_n_u_PGresult __pyx_string_tab[181]
#define __pyx_n_u_PGresult___reduce_cython __pyx_string_tab[182]
#define __pyx_n_u_PGresult___setstate_cython __pyx_string_tab[183]
#define __pyx_n_u_PGresult_clear __pyx_string_tab[184]
#define __pyx_n_u_PGresult_error_field __pyx_string_tab[185]
#define __pyx_n_u_PGresult_fformat __pyx_string_tab[186]
#define __pyx_n_u_PGresult_fmod __pyx_string_tab[187]
#define __pyx_n_u_PGresult_fname __pyx_string_tab[188]
#define __pyx_n_u_PGresult_fsize __pyx_string_tab[189]
#define __pyx_n_u_PGresult_ftable __pyx_string_tab[190]
#define __pyx_n_u_PGresult_ftablecol __pyx_string_tab[191]
#define __pyx_n_u_PGresult_ftype __pyx_string_tab[192]
#define __pyx_n_u_PGresult_get_error_message __pyx_string_tab[193]
#define __pyx_n_u_PGresult_get_value __pyx_string_tab[194]
#define __pyx_n_u_PGresult_param_type __pyx_string_tab[195]
#define __pyx_n_u_PGresult_set_attributes __pyx_string_tab[196]
#define __pyx_n_u_PQBuffer __pyx_string_tab[197]
#define __pyx_n_u_PQBuffer___reduce_cython __pyx_string_tab[198]
#define __pyx_n_u_PQBuffer___setstate_cython __pyx_string_tab[199]
#define __pyx_n_u_PQcancelCreate __pyx_string_tab[200]
#define __pyx_n_u_PQchangePassword __pyx_string_tab[201]
#define __pyx_n_u_PQclosePortal __pyx_string_tab[202]
#define __pyx_n_u_PQclosePrepared __pyx_string_tab[203]
#define __pyx_n_u_PQconnectionUsedGSSAPI __pyx_string_tab[204]
#define __pyx_n_u_PQencryptPasswordConn __pyx_string_tab[205]
#define __pyx_n_u_PQenterPipelineMode __pyx_string_tab[206]
#define __pyx_n_u_PQexitPipelineMode __pyx_string_tab[207]
#define __pyx_n_u_PQfullProtocolVersion __pyx_string_tab[208]
#define __pyx_n_u_PQhostaddr __pyx_string_tab[209]
#define __pyx_n_u_PQpipelineSync __pyx_string_tab[210]
#define __pyx_n_u_PQsendClosePortal __pyx_string_tab[211]
#define __pyx_n_u_PQsendClosePrepared __pyx_string_tab[212]
#define __pyx_n_u_PQsetTraceFlags __pyx_string_tab[213]
#define __pyx_n_u_PqFormat __pyx_string_tab[214]
#define __pyx_n_u_TEXT __pyx_string_tab[215]
#define __pyx_n_u_Trace __pyx_string_tab[216]
#define __pyx_n_u_ViewBuffer __pyx_string_tab[217]
#define __pyx_n_u_ViewBuffer___reduce_cython __pyx_string_tab[218]
#define __pyx_n_u_ViewBuffer___setstate_cython __pyx_string_tab[219]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[220]
#define __pyx_n_u_annotate __pyx_string_tab[221]
#define __pyx_n_u_build_version __pyx_string_tab[222]
#define __pyx_n_u_class __pyx_string_tab[223]
#define __pyx_n_u_dict __pyx_string_tab[224]
#define __pyx_n_u_doc __pyx_string_tab[225]
#define __pyx_n_u_func __pyx_string_tab[226]
#define __pyx_n_u_getstate __pyx_string_tab[227]
#define __pyx_n_u_impl __pyx_string_tab[228]
#define __pyx_n_u_main __pyx_string_tab[229]
#define __pyx_n_u_metaclass __pyx_string_tab[230]
#define __pyx_n_u_module __pyx_string_tab[231]
#define __pyx_n_u_name_2 __pyx_string_tab[232]
#define __pyx_n_u_new __pyx_string_tab[233]
#define __pyx_n_u_prepare_2 __pyx_string_tab[234]
#define __pyx_n_u_pyx_capi __pyx_string_tab[235]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[236]
#define __pyx_n_u_pyx_result __pyx_string_tab[237]
#define __pyx_n_u_pyx_state __pyx_string_tab[238]
#define __pyx_n_u_pyx_type __pyx_string_tab[239]
#define __pyx_n_u_pyx_unpickle_Escaping __pyx_string_tab[240]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[241]
#define __pyx_n_u_qualname __pyx_string_tab[242]
#define __pyx_n_u_reduce __pyx_string_tab[243]
#define __pyx_n_u_reduce_cython __pyx_string_tab[244]
#define __pyx_n_u_reduce_ex __pyx_string_tab[245]
#define __pyx_n_u_repr __pyx_string_tab[246]
#define __pyx_n_u_set_name __pyx_string_tab[247]
#define __pyx_n_u_setstate __pyx_string_tab[248]
#define __pyx_n_u_setstate_cython __pyx_string_tab[249]
#define __pyx_n_u_test __pyx_string_tab[250]
#define __pyx_n_u_clean_error_message __pyx_string_tab[251]
#define __pyx_n_u_dict_2 __pyx_string_tab[252]
#define __pyx_n_u_encoding_2 __pyx_string_tab[253]
#define __pyx_n_u_ensure_pgcancelconn __pyx_string_tab[254]
#define __pyx_n_u_is_coroutine __pyx_string_tab[255]
#define __pyx_n_u_algorithm __pyx_string_tab[256]
#define __pyx_n_u_ascii __pyx_string_tab[257]
#define __pyx_n_u_async __pyx_string_tab[258]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[259]
#define __pyx_n_u_attrs __pyx_string_tab[260]
#define __pyx_n_u_atttypmod __pyx_string_tab[261]
#define __pyx_n_u_atypes __pyx_string_tab[262]
#define __pyx_n_u_binary __pyx_string_tab[263]
#define __pyx_n_u_blocking __pyx_string_tab[264]
#define __pyx_n_u_buf __pyx_string_tab[265]
#define __pyx_n_u_buffer __pyx_string_tab[266]
#define __pyx_n_u_buffer_ptr __pyx_string_tab[267]
#define __pyx_n_u_bytes_2 __pyx_string_tab[268]
#define __pyx_n_u_calgo __pyx_string_tab[269]
#define __pyx_n_u_cancel __pyx_string_tab[270]
#define __pyx_n_u_cancel_conn __pyx_string_tab[271]
#define __pyx_n_u_cbuffer __pyx_string_tab[272]
#define __pyx_n_u_ccol __pyx_string_tab[273]
#define __pyx_n_u_cerr __pyx_string_tab[274]
#define __pyx_n_u_cformats __pyx_string_tab[275]
#define __pyx_n_u_change_password __pyx_string_tab[276]
#define __pyx_n_u_clear __pyx_string_tab[277]
#define __pyx_n_u_clengths __pyx_string_tab[278]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[279]
#define __pyx_n_u_close_portal __pyx_string_tab[280]
#define __pyx_n_u_close_prepared __pyx_string_tab[281]
#define __pyx_n_u_cls __pyx_string_tab[282]
#define __pyx_n_u_cnparams __pyx_string_tab[283]
#define __pyx_n_u_column_number __pyx_string_tab[284]
#define __pyx_n_u_columnid __pyx_string_tab[285]
#define __pyx_n_u_command __pyx_string_tab[286]
#define __pyx_n_u_compiled __pyx_string_tab[287]
#define __pyx_n_u_conn __pyx_string_tab[288]
#define __pyx_n_u_connect __pyx_string_tab[289]
#define __pyx_n_u_connect_poll __pyx_string_tab[290]
#define __pyx_n_u_connect_start __pyx_string_tab[291]
#define __pyx_n_u_connection_summary __pyx_string_tab[292]
#define __pyx_n_u_conninfo __pyx_string_tab[293]
#define __pyx_n_u_consume_input __pyx_string_tab[294]
#define __pyx_n_u_crow __pyx_string_tab[295]
#define __pyx_n_u_ctypes __pyx_string_tab[296]
#define __pyx_n_u_cvalues __pyx_string_tab[297]
#define __pyx_n_u_data __pyx_string_tab[298]
#define __pyx_n_u_decode __pyx_string_tab[299]
#define __pyx_n_u_descr __pyx_string_tab[300]
#define __pyx_n_u_describe_portal __pyx_string_tab[301]
#define __pyx_n_u_describe_prepared __pyx_string_tab[302]
#define __pyx_n_u_descriptions __pyx_string_tab[303]
#define __pyx_n_u_dispchar __pyx_string_tab[304]
#define __pyx_n_u_dispsize __pyx_string_tab[305]
#define __pyx_n_u_e __pyx_string_tab[306]
#define __pyx_n_u_encoding __pyx_string_tab[307]
#define __pyx_n_u_encrypt_password __pyx_string_tab[308]
#define __pyx_n_u_enter_pipeline_mode __pyx_string_tab[309]
#define __pyx_n_u_envvar __pyx_string_tab[310]
#define __pyx_n_u_errmsg __pyx_string_tab[311]
#define __pyx_n_u_error __pyx_string_tab[312]
#define __pyx_n_u_error_field __pyx_string_tab[313]
#define __pyx_n_u_error_message __pyx_string_tab[314]
#define __pyx_n_u_errors __pyx_string_tab[315]
#define __pyx_n_u_escape_bytea __pyx_string_tab[316]
#define __pyx_n_u_escape_identifier __pyx_string_tab[317]
#define __pyx_n_u_escape_literal __pyx_string_tab[318]
#define __pyx_n_u_escape_string __pyx_string_tab[319]
#define __pyx_n_u_exc __pyx_string_tab[320]
#define __pyx_n_u_exception __pyx_string_tab[321]
#define __pyx_n_u_exec __pyx_string_tab[322]
#define __pyx_n_u_exec_params __pyx_string_tab[323]
#define __pyx_n_u_exec_prepared __pyx_string_tab[324]
#define __pyx_n_u_exec_status __pyx_string_tab[325]
#define __pyx_n_u_exit_pipeline_mode __pyx_string_tab[326]
#define __pyx_n_u_f __pyx_string_tab[327]
#define __pyx_n_u_fformat __pyx_string_tab[328]
#define __pyx_n_u_fieldcode __pyx_string_tab[329]
#define __pyx_n_u_fileno __pyx_string_tab[330]
#define __pyx_n_u_finish __pyx_string_tab[331]
#define __pyx_n_u_flags __pyx_string_tab[332]
#define __pyx_n_u_flush __pyx_string_tab[333]
#define __pyx_n_u_fmod __pyx_string_tab[334]
#define __pyx_n_u_fname __pyx_string_tab[335]
#define __pyx_n_u_format __pyx_string_tab[336]
#define __pyx_n_u_free __pyx_string_tab[337]
#define __pyx_n_u_fsize __pyx_string_tab[338]
#define __pyx_n_u_ftable __pyx_string_tab[339]
#define __pyx_n_u_ftablecol __pyx_string_tab[340]
#define __pyx_n_u_ftype __pyx_string_tab[341]
#define __pyx_n_u_getLogger __pyx_string_tab[342]
#define __pyx_n_u_get_cancel __pyx_string_tab[343]
#define __pyx_n_u_get_copy_data __pyx_string_tab[344]
#define __pyx_n_u_get_defaults __pyx_string_tab[345]
#define __pyx_n_u_get_error_message __pyx_string_tab[346]
#define __pyx_n_u_get_result __pyx_string_tab[347]
#define __pyx_n_u_get_value __pyx_string_tab[348]
#define __pyx_n_u_i __pyx_string_tab[349]
#define __pyx_n_u_id __pyx_string_tab[350]
#define __pyx_n_u_int __pyx_string_tab[351]
#define __pyx_n_u_is_busy __pyx_string_tab[352]
#define __pyx_n_u_items __pyx_string_tab[353]
#define __pyx_n_u_keyword __pyx_string_tab[354]
#define __pyx_n_u_label __pyx_string_tab[355]
#define __pyx_n_u_length __pyx_string_tab[356]
#define __pyx_n_u_linux __pyx_string_tab[357]
#define __pyx_n_u_logger __pyx_string_tab[358]
#define __pyx_n_u_logging __pyx_string_tab[359]
#define __pyx_n_u_make_empty_result __pyx_string_tab[360]
#define __pyx_n_u_name __pyx_string_tab[361]
#define __pyx_n_u_nbytes __pyx_string_tab[362]
#define __pyx_n_u_notifies __pyx_string_tab[363]
#define __pyx_n_u_nparams __pyx_string_tab[364]
#define __pyx_n_u_num __pyx_string_tab[365]
#define __pyx_n_u_opts __pyx_string_tab[366]
#define __pyx_n_u_out __pyx_string_tab[367]
#define __pyx_n_u_param_formats __pyx_string_tab[368]
#define __pyx_n_u_param_number __pyx_string_tab[369]
#define __pyx_n_u_param_type __pyx_string_tab[370]
#define __pyx_n_u_param_types __pyx_string_tab[371]
#define __pyx_n_u_param_values __pyx_string_tab[372]
#define __pyx_n_u_parameter_status __pyx_string_tab[373]
#define __pyx_n_u_parse __pyx_string_tab[374]
#define __pyx_n_u_passwd __pyx_string_tab[375]
#define __pyx_n_u_pg2pyenc __pyx_string_tab[376]
#define __pyx_n_u_pgconn __pyx_string_tab[377]
#define __pyx_n_u_pgconn_ptr __pyx_string_tab[378]
#define __pyx_n_u_pgresult __pyx_string_tab[379]
#define __pyx_n_u_ping __pyx_string_tab[380]
#define __pyx_n_u_pipeline_sync __pyx_string_tab[381]
#define __pyx_n_u_platform __pyx_string_tab[382]
#define __pyx_n_u_poll __pyx_string_tab[383]
#define __pyx_n_u_pop __pyx_string_tab[384]
#define __pyx_n_u_prepare __pyx_string_tab[385]
#define __pyx_n_u_psycopg __pyx_string_tab[386]
#define __pyx_n_u_psycopg__encodings __pyx_string_tab[387]
#define __pyx_n_u_psycopg_pq __pyx_string_tab[388]
#define __pyx_n_u_psycopg_pq__enums __pyx_string_tab[389]
#define __pyx_n_u_psycopg_pq_misc __pyx_string_tab[390]
#define __pyx_n_u_psycopg_binary_pq __pyx_string_tab[391]
#define __pyx_n_u_ptr __pyx_string_tab[392]
#define __pyx_n_u_put_copy_data __pyx_string_tab[393]
#define __pyx_n_u_put_copy_end __pyx_string_tab[394]
#define __pyx_n_u_res __pyx_string_tab[395]
#define __pyx_n_u_reset __pyx_string_tab[396]
#define __pyx_n_u_reset_poll __pyx_string_tab[397]
#define __pyx_n_u_reset_start __pyx_string_tab[398]
#define __pyx_n_u_result_format __pyx_string_tab[399]
#define __pyx_n_u_return __pyx_string_tab[400]
#define __pyx_n_u_row_number __pyx_string_tab[401]
#define __pyx_n_u_rv __pyx_string_tab[402]
#define __pyx_n_u_s __pyx_string_tab[403]
#define __pyx_n_u_self __pyx_string_tab[404]
#define __pyx_n_u_send_close_portal __pyx_string_tab[405]
#define __pyx_n_u_send_close_prepared __pyx_string_tab[406]
#define __pyx_n_u_send_describe_portal __pyx_string_tab[407]
#define __pyx_n_u_send_describe_prepared __pyx_string_tab[408]
#define __pyx_n_u_send_flush_request __pyx_string_tab[409]
#define __pyx_n_u_send_prepare __pyx_string_tab[410]
#define __pyx_n_u_send_query __pyx_string_tab[411]
#define __pyx_n_u_send_query_params __pyx_string_tab[412]
#define __pyx_n_u_send_query_prepared __pyx_string_tab[413]
#define __pyx_n_u_set_attributes __pyx_string_tab[414]
#define __pyx_n_u_set_chunked_rows_mode __pyx_string_tab[415]
#define __pyx_n_u_set_single_row_mode __pyx_string_tab[416]
#define __pyx_n_u_set_trace_flags __pyx_string_tab[417]
#define __pyx_n_u_setdefault __pyx_string_tab[418]
#define __pyx_n_u_size __pyx_string_tab[419]
#define __pyx_n_u_ssl __pyx_string_tab[420]
#define __pyx_n_u_start __pyx_string_tab[421]
#define __pyx_n_u_state __pyx_string_tab[422]
#define __pyx_n_u_status __pyx_string_tab[423]
#define __pyx_n_u_str __pyx_string_tab[424]
#define __pyx_n_u_stream __pyx_string_tab[425]
#define __pyx_n_u_sys __pyx_string_tab[426]
#define __pyx_n_u_tableid __pyx_string_tab[427]
#define __pyx_n_u_trace __pyx_string_tab[428]
#define __pyx_n_u_types_fast __pyx_string_tab[429]
#define __pyx_n_u_typid __pyx_string_tab[430]
#define __pyx_n_u_typlen __pyx_string_tab[431]
#define __pyx_n_u_unescape_bytea __pyx_string_tab[432]
#define __pyx_n_u_untrace __pyx_string_tab[433]
#define __pyx_n_u_update __pyx_string_tab[434]
#define __pyx_n_u_use_setstate __pyx_string_tab[435]
#define __pyx_n_u_user __pyx_string_tab[436]
#define __pyx_n_u_v __pyx_string_tab[437]
#define __pyx_n_u_val __pyx_string_tab[438]
#define __pyx_n_u_values __pyx_string_tab[439]
#define __pyx_n_u_version __pyx_string_tab[440]
#define __pyx_n_u_version_pretty __pyx_string_tab[441]
#define __pyx_n_u_x __pyx_string_tab[442]
#define __pyx_kp_b__6 __pyx_string_tab[443]
#define __pyx_kp_b_int_PyObject_char_Py_ssize_t__bu __pyx_string_tab[444]
#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[445]
#define __pyx_kp_b_iso88591_Q __pyx_string_tab[446]
#define __pyx_kp_b_iso88591_avQ __pyx_string_tab[447]
#define __pyx_kp_b_iso88591_q_0_kQR_881A_7_nA_1 __pyx_string_tab[448]
#define __pyx_kp_b_iso88591_Q_q_l_vWE_Q_q_t6_q_Qg_q_Qg __pyx_string_tab[449]
#define __pyx_kp_b_iso88591_A_s_4q_hgQa __pyx_string_tab[450]
#define __pyx_kp_b_iso88591_A_1_5_1_Qa_AQ_q __pyx_string_tab[451]
#define __pyx_kp_b_iso88591_A_G1A __pyx_string_tab[452]
#define __pyx_kp_b_iso88591_A_A_11A_AQ_5_1_wc_k_a_waxq_q_a_A __pyx_string_tab[453]
#define __pyx_kp_b_iso88591_A_Qa_4q_Qa_Zq __pyx_string_tab[454]
#define __pyx_kp_b_iso88591_A45_4q_Qa_Zq __pyx_string_tab[455]
#define __pyx_kp_b_iso88591_A_A_2_1_A_Q_Qd_a_4q_A_at3EQ_U_1 __pyx_string_tab[456]
#define __pyx_kp_b_iso88591_A_Q_Q_6_q_S_A_at3EQ __pyx_string_tab[457]
#define __pyx_kp_b_iso88591_A_WA_4q_1_3j_9Cq_1A_1_1 __pyx_string_tab[458]
#define __pyx_kp_b_iso88591_A_4vWA_t5_S_a_7q_aq_4s_Q_3aq_S_q __pyx_string_tab[459]
#define __pyx_kp_b_iso88591_A_A_a_A_8J_q_WA_3d_q_A_j_Ja_1HIZ __pyx_string_tab[460]
#define __pyx_kp_b_iso88591_A_A_a_A_8J_q_WA_3d_q_Q_j_Ja_1HIZ __pyx_string_tab[461]
#define __pyx_kp_b_iso88591_A_a_A_8J_WA_3d_q_e1_j_1HIZq_c_AQ __pyx_string_tab[462]
#define __pyx_kp_b_iso88591_A_a_A_8J_WA_3d_q_a_e_5J_j_1HIZq __pyx_string_tab[463]
#define __pyx_kp_b_iso88591_A_A_wa_a_aq_1_axr_U_1_auH_A_WA_3_2 __pyx_string_tab[464]
#define __pyx_kp_b_iso88591_A_A_wa_a_aq_1_axr_U_1_auH_A_WA_3 __pyx_string_tab[465]
#define __pyx_kp_b_iso88591_A_4vS_AQ_4uM_A_AQ_6_q_1D_5_4s_A __pyx_string_tab[466]
#define __pyx_kp_b_iso88591_A_6_q_4vS_AQ_4uM_A_AQ_at5_e1_4s __pyx_string_tab[467]
#define __pyx_kp_b_iso88591_A_4vWE_T_m3a_AQ_6_q_4vWA_E_8_XQa __pyx_string_tab[468]
#define __pyx_kp_b_iso88591_A_6_q_4vWA_t5_S_a_hl_7_Bb_a_E_y __pyx_string_tab[469]
#define __pyx_kp_b_iso88591_a_4_WA_at1 __pyx_string_tab[470]
#define __pyx_kp_b_iso88591_a_M_a __pyx_string_tab[471]
#define __pyx_kp_b_iso88591_q_4_gQ_a __pyx_string_tab[472]
#define __pyx_kp_b_iso88591_q_1D __pyx_string_tab[473]
#define __pyx_kp_b_iso88591_q_Q_3d_q_Qa_c_AQ __pyx_string_tab[474]
#define __pyx_kp_b_iso88591_q_9N_4q_A_at3EQ __pyx_string_tab[475]
#define __pyx_kp_b_iso88591_4_Q_A __pyx_string_tab[476]
#define __pyx_kp_b_iso88591_Q_t_q_at1_O1 __pyx_string_tab[477]
#define __pyx_kp_b_iso88591_IQd_gQ_4q_A_WAXQ __pyx_string_tab[478]
#define __pyx_kp_b_iso88591_Q_1D __pyx_string_tab[479]
#define __pyx_kp_b_iso88591_WA_iq_A_q __pyx_string_tab[480]
#define __pyx_kp_b_iso88591_9_Qd_A_at3EQ __pyx_string_tab[481]
#define __pyx_kp_b_iso88591_A_av_6a __pyx_string_tab[482]
#define __pyx_kp_b_iso88591_A_Q_1D_4q_AQ_z __pyx_string_tab[483]
#define __pyx_kp_b_iso88591_A_Q_L_Q_9Cq_1_z __pyx_string_tab[484]
#define __pyx_kp_b_iso88591_HA_3j_1_Qa_q_Q_nA __pyx_string_tab[485]
#define __pyx_kp_b_iso88591_Q_1_Q_at1_4q_AQ_Qa __pyx_string_tab[486]
#define __pyx_kp_b_iso88591_Q_Q_m1D_4q_AQ __pyx_string_tab[487]
#define __pyx_kp_b_iso88591_a_av_6a __pyx_string_tab[488]
#define __pyx_kp_b_iso88591_q_Q_oQd_2S_A_4_A __pyx_string_tab[489]
#define __pyx_kp_b_iso88591_q_1_Q_oQd_3c_AQ_3c_AQ __pyx_string_tab[490]
#define __pyx_kp_b_iso88591_Q_3d_q_4q_c_AQ_3b_A_8_Oq_q __pyx_string_tab[491]
#define __pyx_kp_b_iso88591_6_1A_Q_m1D_a_3b_A_1D0B_q __pyx_string_tab[492]
#define __pyx_kp_b_iso88591_A_0_Q_a_3c_A_q __pyx_string_tab[493]
#define __pyx_kp_b_iso88591_A_q_Q_a_3c_AT_1 __pyx_string_tab[494]
#define __pyx_kp_b_iso88591_Q_Q_a_4q_AQ __pyx_string_tab[495]
#define __pyx_kp_b_iso88591_Q_0_Q_4q_3c_AQ __pyx_string_tab[496]
#define __pyx_kp_b_iso88591_Zq_A_Q_Q_nA __pyx_string_tab[497]
#define __pyx_kp_b_iso88591_a_4_A_AQ __pyx_string_tab[498]
#define __pyx_kp_b_iso88591_q_81IQa_Q_nAT_y_Q_3b_A_AT1C1_q __pyx_string_tab[499]
#define __pyx_kp_b_iso88591_G1D_0 __pyx_string_tab[500]
#define __pyx_kp_b_iso88591_HAT_1 __pyx_string_tab[501]
#define __pyx_kp_b_iso88591_XQd_3gQ_1_1 __pyx_string_tab[502]
#define __pyx_kp_b_iso88591_q_1D_8_D __pyx_string_tab[503]
#define __pyx_kp_b_iso88591_A_1D_8 __pyx_string_tab[504]
#define __pyx_kp_b_iso88591_Q_Q_1D_a_4q_AQ __pyx_string_tab[505]
#define __pyx_kp_b_iso88591_1_IQd_2 __pyx_string_tab[506]
#define __pyx_kp_b_iso88591_1_c_1_E_aq_L_HE_KuA_L_Q_Je1_IU __pyx_string_tab[507]
#define __pyx_kp_b_iso88591_1_Q_1L_7_a_A_at3EQ_gQ_Q_7_1_81 __pyx_string_tab[508]
#define __pyx_kp_b_iso88591_A_Jat_31 __pyx_string_tab[509]
#define __pyx_kp_b_iso88591_A_1_6Fa_3gQ_1_1 __pyx_string_tab[510]
#define __pyx_kp_b_iso88591_A_WA_3d_q_q_A_c_AQ_9Cq_A_4_A_z __pyx_string_tab[511]
#define __pyx_kp_b_iso88591_a_L_5Q __pyx_string_tab[512]
#define __pyx_kp_b_iso88591_0_Q_3d_q_Q_c_AQ_3c_A_z __pyx_string_tab[513]
#define __pyx_kp_b_iso88591_1_WA_3d_q_a_1_c_AQ_4q_A_q __pyx_string_tab[514]
#define __pyx_kp_b_iso88591_2_A_Q_3d_q_q_c_AQ_3c_A_z __pyx_string_tab[515]
#define __pyx_kp_b_iso88591_31_44J_Q_3c_A_AT1C1_z __pyx_string_tab[516]
#define __pyx_kp_b_iso88591_4A_n_B_a_3gQ_1_1 __pyx_string_tab[517]
#define __pyx_kp_b_iso88591_4A_Q_N_8_4q_Qa_z __pyx_string_tab[518]
#define __pyx_kp_b_iso88591_5Q_a_Q_3d_q_A_c_AQ_4q_A_1_6H __pyx_string_tab[519]
#define __pyx_kp_b_iso88591_5Q_44J_q_3c_A_AT1C1_z __pyx_string_tab[520]
#define __pyx_kp_b_iso88591_7q_0_Q_3d_q_a_1_c_AQ_4q_A_1_6H __pyx_string_tab[521]
#define __pyx_kp_b_iso88591_8_0_EQ_4q_A_4AT9K1 __pyx_string_tab[522]
#define __pyx_kp_b_iso88591_0_Gq_4q_A_4AT9K1 __pyx_string_tab[523]
#define __pyx_kp_b_iso88591_a_1D0_a_1_5V1_1Ba_L_5V1_q_q __pyx_string_tab[524]
#define __pyx_int_8405287 __pyx_number_tab[0]
/* #### 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_14psycopg_binary_2pq_PGconn);
  Py_CLEAR(clear_module_state->__pyx_type_14psycopg_binary_2pq_PGconn);
  Py_CLEAR(clear_module_state->__pyx_ptype_14psycopg_binary_2pq_PGresult);
  Py_CLEAR(clear_module_state->__pyx_type_14psycopg_binary_2pq_PGresult);
  Py_CLEAR(clear_module_state->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn);
  Py_CLEAR(clear_module_state->__pyx_type_14psycopg_binary_2pq_PGcancelConn);
  Py_CLEAR(clear_module_state->__pyx_ptype_14psycopg_binary_2pq_PGcancel);
  Py_CLEAR(clear_module_state->__pyx_type_14psycopg_binary_2pq_PGcancel);
  Py_CLEAR(clear_module_state->__pyx_ptype_14psycopg_binary_2pq_Escaping);
  Py_CLEAR(clear_module_state->__pyx_type_14psycopg_binary_2pq_Escaping);
  Py_CLEAR(clear_module_state->__pyx_ptype_14psycopg_binary_2pq_PQBuffer);
  Py_CLEAR(clear_module_state->__pyx_type_14psycopg_binary_2pq_PQBuffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer);
  Py_CLEAR(clear_module_state->__pyx_type_14psycopg_binary_2pq_ViewBuffer);
  Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
  Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
  Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
  for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<94; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<525; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<1; ++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);

/* CythonFunctionPerModule.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);

/* #### 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_14psycopg_binary_2pq_PGconn);
  Py_VISIT(traverse_module_state->__pyx_type_14psycopg_binary_2pq_PGconn);
  Py_VISIT(traverse_module_state->__pyx_ptype_14psycopg_binary_2pq_PGresult);
  Py_VISIT(traverse_module_state->__pyx_type_14psycopg_binary_2pq_PGresult);
  Py_VISIT(traverse_module_state->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn);
  Py_VISIT(traverse_module_state->__pyx_type_14psycopg_binary_2pq_PGcancelConn);
  Py_VISIT(traverse_module_state->__pyx_ptype_14psycopg_binary_2pq_PGcancel);
  Py_VISIT(traverse_module_state->__pyx_type_14psycopg_binary_2pq_PGcancel);
  Py_VISIT(traverse_module_state->__pyx_ptype_14psycopg_binary_2pq_Escaping);
  Py_VISIT(traverse_module_state->__pyx_type_14psycopg_binary_2pq_Escaping);
  Py_VISIT(traverse_module_state->__pyx_ptype_14psycopg_binary_2pq_PQBuffer);
  Py_VISIT(traverse_module_state->__pyx_type_14psycopg_binary_2pq_PQBuffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer);
  Py_VISIT(traverse_module_state->__pyx_type_14psycopg_binary_2pq_ViewBuffer);
  Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
  Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
  Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
  for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<94; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<525; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<1; ++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);

/* CythonFunctionPerModule.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);

/* #### Code section: module_state_traverse_end ### */
return 0;
}
#endif
/* #### Code section: module_code ### */

/* "psycopg_binary/pq.pyx":19
 * 
 * 
 * def version():             # <<<<<<<<<<<<<<
 *     return libpq.PQlibVersion()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_1version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_1version = {"version", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_1version, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_1version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("version (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_version(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_version(CYTHON_UNUSED PyObject *__pyx_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("version", 0);

  /* "psycopg_binary/pq.pyx":20
 * 
 * def version():
 *     return libpq.PQlibVersion()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(PQlibVersion()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq.pyx":19
 * 
 * 
 * def version():             # <<<<<<<<<<<<<<
 *     return libpq.PQlibVersion()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":40
 * 
 * 
 * cdef object _check_supported(fname, int pgversion):             # <<<<<<<<<<<<<<
 *     if libpq.PG_VERSION_NUM < pgversion:
 *         raise e.NotSupportedError(
*/

static PyObject *__pyx_f_14psycopg_binary_2pq__check_supported(PyObject *__pyx_v_fname, int __pyx_v_pgversion) {
  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 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[6];
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  size_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_supported", 0);

  /* "psycopg_binary/pq/pgconn.pyx":41
 * 
 * cdef object _check_supported(fname, int pgversion):
 *     if libpq.PG_VERSION_NUM < pgversion:             # <<<<<<<<<<<<<<
 *         raise e.NotSupportedError(
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"
*/
  __pyx_t_1 = (PG_VERSION_NUM < __pyx_v_pgversion);

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgconn.pyx":42
 * cdef object _check_supported(fname, int pgversion):
 *     if libpq.PG_VERSION_NUM < pgversion:
 *         raise e.NotSupportedError(             # <<<<<<<<<<<<<<
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"
 *             f" on the client; version {version_pretty(libpq.PG_VERSION_NUM)}"
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NotSupportedError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":43
 *     if libpq.PG_VERSION_NUM < pgversion:
 *         raise e.NotSupportedError(
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"             # <<<<<<<<<<<<<<
 *             f" on the client; version {version_pretty(libpq.PG_VERSION_NUM)}"
 *             " available instead"
*/
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_fname, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_version_pretty); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_pgversion); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":44
 *         raise e.NotSupportedError(
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"
 *             f" on the client; version {version_pretty(libpq.PG_VERSION_NUM)}"             # <<<<<<<<<<<<<<
 *             " available instead"
 *         )
*/
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_version_pretty); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = __Pyx_PyLong_From_int(PG_VERSION_NUM); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10[0] = __pyx_t_4;
    __pyx_t_10[1] = __pyx_mstate_global->__pyx_kp_u_requires_libpq_from_PostgreSQL;
    __pyx_t_10[2] = __pyx_t_7;
    __pyx_t_10[3] = __pyx_mstate_global->__pyx_kp_u_on_the_client_version;
    __pyx_t_10[4] = __pyx_t_6;
    __pyx_t_10[5] = __pyx_mstate_global->__pyx_kp_u_available_instead;

    /* "psycopg_binary/pq/pgconn.pyx":43
 *     if libpq.PG_VERSION_NUM < pgversion:
 *         raise e.NotSupportedError(
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"             # <<<<<<<<<<<<<<
 *             f" on the client; version {version_pretty(libpq.PG_VERSION_NUM)}"
 *             " available instead"
*/
    __pyx_t_11 = 74;
    #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
    __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[0]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[2]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[4]);
    #endif
    __pyx_t_12 = 0;
    #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
    __pyx_t_12 |= __Pyx_PyUnicode_KIND_04(__pyx_t_10[0]) | __Pyx_PyUnicode_KIND_04(__pyx_t_10[2]) | __Pyx_PyUnicode_KIND_04(__pyx_t_10[4]);
    #endif
    __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_10, 6, __pyx_t_11, __pyx_t_12);
    if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = 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_13 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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(1, 42, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":41
 * 
 * cdef object _check_supported(fname, int pgversion):
 *     if libpq.PG_VERSION_NUM < pgversion:             # <<<<<<<<<<<<<<
 *         raise e.NotSupportedError(
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":40
 * 
 * 
 * cdef object _check_supported(fname, int pgversion):             # <<<<<<<<<<<<<<
 *     if libpq.PG_VERSION_NUM < pgversion:
 *         raise e.NotSupportedError(
*/

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("psycopg_binary.pq._check_supported", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":49
 * 
 * cdef class PGconn:
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):
 *         cdef PGconn rv = PGconn.__new__(PGconn)
*/

static struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_f_14psycopg_binary_2pq_6PGconn__from_ptr(PGconn *__pyx_v_ptr) {
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_rv = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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("_from_ptr", 0);

  /* "psycopg_binary/pq/pgconn.pyx":51
 *     @staticmethod
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):
 *         cdef PGconn rv = PGconn.__new__(PGconn)             # <<<<<<<<<<<<<<
 *         rv._pgconn_ptr = ptr
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_14psycopg_binary_2pq_PGconn(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":52
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):
 *         cdef PGconn rv = PGconn.__new__(PGconn)
 *         rv._pgconn_ptr = ptr             # <<<<<<<<<<<<<<
 * 
 *         libpq.PQsetNoticeReceiver(
*/
  __pyx_v_rv->_pgconn_ptr = __pyx_v_ptr;

  /* "psycopg_binary/pq/pgconn.pyx":54
 *         rv._pgconn_ptr = ptr
 * 
 *         libpq.PQsetNoticeReceiver(             # <<<<<<<<<<<<<<
 *             ptr, <libpq.PQnoticeReceiver>notice_receiver, <void *>rv)
 *         return rv
*/
  (void)(PQsetNoticeReceiver(__pyx_v_ptr, ((PQnoticeReceiver)__pyx_f_14psycopg_binary_2pq_notice_receiver), ((void *)__pyx_v_rv)));

  /* "psycopg_binary/pq/pgconn.pyx":56
 *         libpq.PQsetNoticeReceiver(
 *             ptr, <libpq.PQnoticeReceiver>notice_receiver, <void *>rv)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":49
 * 
 * cdef class PGconn:
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):
 *         cdef PGconn rv = PGconn.__new__(PGconn)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn._from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":58
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._pgconn_ptr = NULL
 *         self._procpid = getpid()
*/

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL_TPNEW
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #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
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__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_FASTCALL_TPNEW(__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_14psycopg_binary_2pq_6PGconn___cinit__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_6PGconn___cinit__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_r;

  /* "psycopg_binary/pq/pgconn.pyx":59
 * 
 *     def __cinit__(self):
 *         self._pgconn_ptr = NULL             # <<<<<<<<<<<<<<
 *         self._procpid = getpid()
 * 
*/
  __pyx_v_self->_pgconn_ptr = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":60
 *     def __cinit__(self):
 *         self._pgconn_ptr = NULL
 *         self._procpid = getpid()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
  __pyx_v_self->_procpid = getpid();

  /* "psycopg_binary/pq/pgconn.pyx":58
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._pgconn_ptr = NULL
 *         self._procpid = getpid()
*/

  /* function exit code */
  __pyx_r = 0;

  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":62
 *         self._procpid = getpid()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         # Close the connection only if it was created in this process,
 *         # not if this object is being GC'd after fork.
*/

/* Python wrapper */
static void __pyx_pw_14psycopg_binary_2pq_6PGconn_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_14psycopg_binary_2pq_6PGconn_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_14psycopg_binary_2pq_6PGconn_2__dealloc__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_14psycopg_binary_2pq_6PGconn_2__dealloc__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  __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("__dealloc__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":65
 *         # Close the connection only if it was created in this process,
 *         # not if this object is being GC'd after fork.
 *         if self._procpid == getpid():             # <<<<<<<<<<<<<<
 *             self.finish()
 * 
*/
  __pyx_t_1 = (__pyx_v_self->_procpid == getpid());

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":66
 *         # not if this object is being GC'd after fork.
 *         if self._procpid == getpid():
 *             self.finish()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self) -> str:
*/
    __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_finish, __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(1, 66, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":65
 *         # Close the connection only if it was created in this process,
 *         # not if this object is being GC'd after fork.
 *         if self._procpid == getpid():             # <<<<<<<<<<<<<<
 *             self.finish()
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":62
 *         self._procpid = getpid()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         # Close the connection only if it was created in this process,
 *         # not if this object is being GC'd after fork.
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("psycopg_binary.pq.PGconn.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;

  __Pyx_RefNannyFinishContext();
}

/* "psycopg_binary/pq/pgconn.pyx":68
 *             self.finish()
 * 
 *     def __repr__(self) -> str:             # <<<<<<<<<<<<<<
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         info = connection_summary(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_5__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_14psycopg_binary_2pq_6PGconn_4__repr__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_4__repr__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_v_cls = NULL;
  PyObject *__pyx_v_info = 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[3];
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8[7];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":69
 * 
 *     def __repr__(self) -> str:
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *         info = connection_summary(self)
 *         return f"<{cls} {info} at 0x{id(self):x}>"
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __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_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_qualname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4[0] = __pyx_t_1;
  __pyx_t_4[1] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_4[2] = __pyx_t_2;
  __pyx_t_5 = 1;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[0]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[2]);
  #endif
  __pyx_t_6 = 0;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[0]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[2]);
  #endif
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_5, __pyx_t_6);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 69, __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_v_cls = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":70
 *     def __repr__(self) -> str:
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         info = connection_summary(self)             # <<<<<<<<<<<<<<
 *         return f"<{cls} {info} at 0x{id(self):x}>"
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_connection_summary); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = 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_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __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_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_info = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":71
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         info = connection_summary(self)
 *         return f"<{cls} {info} at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_info, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_8[1] = __pyx_v_cls;
  __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_8[3] = __pyx_t_3;
  __pyx_t_8[4] = __pyx_mstate_global->__pyx_kp_u_at_0x;
  __pyx_t_8[5] = __pyx_t_2;
  __pyx_t_8[6] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_5 = 9;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8[3]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8[5]);
  #endif
  __pyx_t_6 = 0;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_8[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_8[3]) | __Pyx_PyUnicode_KIND_04(__pyx_t_8[5]);
  #endif
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_8, 7, __pyx_t_5, __pyx_t_6);
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":68
 *             self.finish()
 * 
 *     def __repr__(self) -> str:             # <<<<<<<<<<<<<<
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         info = connection_summary(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cls);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":73
 *         return f"<{cls} {info} at 0x{id(self):x}>"
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_pw_14psycopg_binary_2pq_6PGconn_7connect(PyObject *__pyx_v_cls, PyObject *__pyx_arg_conninfo); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_7connect = {"connect", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_7connect, METH_O, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_pw_14psycopg_binary_2pq_6PGconn_7connect(PyObject *__pyx_v_cls, PyObject *__pyx_arg_conninfo) {
  char const *__pyx_v_conninfo;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_conninfo); {
    __pyx_v_conninfo = __Pyx_PyObject_AsString(__pyx_arg_conninfo); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(1, 74, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_6connect(((PyTypeObject*)__pyx_v_cls), ((char const *)__pyx_v_conninfo));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_pf_14psycopg_binary_2pq_6PGconn_6connect(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, char const *__pyx_v_conninfo) {
  PGconn *__pyx_v_pgconn;
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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("connect", 0);

  /* "psycopg_binary/pq/pgconn.pyx":75
 *     @classmethod
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)             # <<<<<<<<<<<<<<
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")
*/
  __pyx_v_pgconn = PQconnectdb(__pyx_v_conninfo);

  /* "psycopg_binary/pq/pgconn.pyx":76
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 *         if not pgconn:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGconn")
 * 
*/
  __pyx_t_1 = (!(__pyx_v_pgconn != 0));

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgconn.pyx":77
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")             # <<<<<<<<<<<<<<
 * 
 *         return PGconn._from_ptr(pgconn)
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_PGconn};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __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, 77, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":76
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 *         if not pgconn:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGconn")
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":79
 *             raise MemoryError("couldn't allocate PGconn")
 * 
 *         return PGconn._from_ptr(pgconn)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_6PGconn__from_ptr(__pyx_v_pgconn)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_t_2);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":73
 *         return f"<{cls} {info} at 0x{id(self):x}>"
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":81
 *         return PGconn._from_ptr(pgconn)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_pw_14psycopg_binary_2pq_6PGconn_9connect_start(PyObject *__pyx_v_cls, PyObject *__pyx_arg_conninfo); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_9connect_start = {"connect_start", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_9connect_start, METH_O, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_pw_14psycopg_binary_2pq_6PGconn_9connect_start(PyObject *__pyx_v_cls, PyObject *__pyx_arg_conninfo) {
  char const *__pyx_v_conninfo;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect_start (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_conninfo); {
    __pyx_v_conninfo = __Pyx_PyObject_AsString(__pyx_arg_conninfo); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(1, 82, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.connect_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_8connect_start(((PyTypeObject*)__pyx_v_cls), ((char const *)__pyx_v_conninfo));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_pf_14psycopg_binary_2pq_6PGconn_8connect_start(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, char const *__pyx_v_conninfo) {
  PGconn *__pyx_v_pgconn;
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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("connect_start", 0);

  /* "psycopg_binary/pq/pgconn.pyx":83
 *     @classmethod
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)             # <<<<<<<<<<<<<<
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")
*/
  __pyx_v_pgconn = PQconnectStart(__pyx_v_conninfo);

  /* "psycopg_binary/pq/pgconn.pyx":84
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 *         if not pgconn:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGconn")
 * 
*/
  __pyx_t_1 = (!(__pyx_v_pgconn != 0));

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgconn.pyx":85
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")             # <<<<<<<<<<<<<<
 * 
 *         return PGconn._from_ptr(pgconn)
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_PGconn};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __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, 85, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":84
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 *         if not pgconn:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGconn")
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":87
 *             raise MemoryError("couldn't allocate PGconn")
 * 
 *         return PGconn._from_ptr(pgconn)             # <<<<<<<<<<<<<<
 * 
 *     def connect_poll(self) -> int:
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_6PGconn__from_ptr(__pyx_v_pgconn)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_t_2);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":81
 *         return PGconn._from_ptr(pgconn)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.connect_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":89
 *         return PGconn._from_ptr(pgconn)
 * 
 *     def connect_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_11connect_poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_11connect_poll = {"connect_poll", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_11connect_poll, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_11connect_poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect_poll (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_10connect_poll(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_10connect_poll(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect_poll", 0);

  /* "psycopg_binary/pq/pgconn.pyx":90
 * 
 *     def connect_poll(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)             # <<<<<<<<<<<<<<
 * 
 *     def finish(self) -> None:
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_int_f)PQconnectPoll)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 90, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  if (__Pyx_PyInt_FromNumber(&__pyx_t_2, NULL, 0) < (0)) __PYX_ERR(1, 90, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":89
 *         return PGconn._from_ptr(pgconn)
 * 
 *     def connect_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.connect_poll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":92
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr is not NULL:
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_13finish(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_13finish = {"finish", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_13finish, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_13finish(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finish (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_12finish(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_12finish(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("finish", 0);

  /* "psycopg_binary/pq/pgconn.pyx":93
 * 
 *     def finish(self) -> None:
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if self._pgconn_ptr is not NULL:
 *                 libpq.PQfinish(self._pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":94
 *     def finish(self) -> None:
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *                 libpq.PQfinish(self._pgconn_ptr)
 *                 self._pgconn_ptr = NULL
*/
        __pyx_t_2 = (__pyx_v_self->_pgconn_ptr != NULL);

        if (__pyx_t_2) {


          /* "psycopg_binary/pq/pgconn.pyx":95
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr is not NULL:
 *                 libpq.PQfinish(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *                 self._pgconn_ptr = NULL
 * 
*/
          PQfinish(__pyx_v_self->_pgconn_ptr);

          /* "psycopg_binary/pq/pgconn.pyx":96
 *             if self._pgconn_ptr is not NULL:
 *                 libpq.PQfinish(self._pgconn_ptr)
 *                 self._pgconn_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
          __pyx_v_self->_pgconn_ptr = NULL;

          /* "psycopg_binary/pq/pgconn.pyx":94
 *     def finish(self) -> None:
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *                 libpq.PQfinish(self._pgconn_ptr)
 *                 self._pgconn_ptr = NULL
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":93
 * 
 *     def finish(self) -> None:
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if self._pgconn_ptr is not NULL:
 *                 libpq.PQfinish(self._pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":92
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr is not NULL:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":98
 *                 self._pgconn_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgconn_ptr(self) -> int | None:
 *         cdef long long ptr = -1
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_10pgconn_ptr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_10pgconn_ptr_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_14psycopg_binary_2pq_6PGconn_10pgconn_ptr___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_10pgconn_ptr___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PY_LONG_LONG __pyx_v_ptr;
  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("__get__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":100
 *     @property
 *     def pgconn_ptr(self) -> int | None:
 *         cdef long long ptr = -1             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr:
*/
  __pyx_v_ptr = -1LL;

  /* "psycopg_binary/pq/pgconn.pyx":101
 *     def pgconn_ptr(self) -> int | None:
 *         cdef long long ptr = -1
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if self._pgconn_ptr:
 *                 ptr = <long long><void *>self._pgconn_ptr
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":102
 *         cdef long long ptr = -1
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr:             # <<<<<<<<<<<<<<
 *                 ptr = <long long><void *>self._pgconn_ptr
 *         return ptr if ptr != -1 else None
*/
        __pyx_t_2 = (__pyx_v_self->_pgconn_ptr != 0);

        if (__pyx_t_2) {


          /* "psycopg_binary/pq/pgconn.pyx":103
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr:
 *                 ptr = <long long><void *>self._pgconn_ptr             # <<<<<<<<<<<<<<
 *         return ptr if ptr != -1 else None
 * 
*/
          __pyx_v_ptr = ((PY_LONG_LONG)((void *)__pyx_v_self->_pgconn_ptr));

          /* "psycopg_binary/pq/pgconn.pyx":102
 *         cdef long long ptr = -1
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr:             # <<<<<<<<<<<<<<
 *                 ptr = <long long><void *>self._pgconn_ptr
 *         return ptr if ptr != -1 else None
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":101
 *     def pgconn_ptr(self) -> int | None:
 *         cdef long long ptr = -1
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if self._pgconn_ptr:
 *                 ptr = <long long><void *>self._pgconn_ptr
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":104
 *             if self._pgconn_ptr:
 *                 ptr = <long long><void *>self._pgconn_ptr
 *         return ptr if ptr != -1 else None             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = (__pyx_v_ptr != -1LL);

  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyLong_From_PY_LONG_LONG(__pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":98
 *                 self._pgconn_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgconn_ptr(self) -> int | None:
 *         cdef long long ptr = -1
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.pgconn_ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":106
 *         return ptr if ptr != -1 else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def info(self) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_4info_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_4info_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_14psycopg_binary_2pq_6PGconn_4info___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_4info___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PQconninfoOption *__pyx_v_opts;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":110
 *         cdef libpq.PQconninfoOption *opts
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 opts = libpq.PQconninfo(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":111
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 opts = libpq.PQconninfo(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":112
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 opts = libpq.PQconninfo(pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_opts = PQconninfo(__pyx_v_pgconn_ptr);

          /* "psycopg_binary/pq/pgconn.pyx":111
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 opts = libpq.PQconninfo(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":110
 *         cdef libpq.PQconninfoOption *opts
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 opts = libpq.PQconninfo(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":113
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 opts = libpq.PQconninfo(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if opts is NULL:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":114
 *                 opts = libpq.PQconninfo(pgconn_ptr)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if opts is NULL:
 *             raise MemoryError("couldn't allocate connection info")
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 114, __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_the_connection_is_closed};
      __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(1, 114, __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, 114, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":113
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 opts = libpq.PQconninfo(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if opts is NULL:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":115
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if opts is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate connection info")
 *         rv = _options_from_array(opts)
*/
  __pyx_t_3 = (__pyx_v_opts == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":116
 *             raise e.OperationalError("the connection is closed")
 *         if opts is NULL:
 *             raise MemoryError("couldn't allocate connection info")             # <<<<<<<<<<<<<<
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
*/
    __pyx_t_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_connection_inf};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __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;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 116, __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, 116, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":115
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if opts is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate connection info")
 *         rv = _options_from_array(opts)
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":117
 *         if opts is NULL:
 *             raise MemoryError("couldn't allocate connection info")
 *         rv = _options_from_array(opts)             # <<<<<<<<<<<<<<
 *         libpq.PQconninfoFree(opts)
 *         return rv
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__options_from_array(__pyx_v_opts); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":118
 *             raise MemoryError("couldn't allocate connection info")
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQconninfoFree(__pyx_v_opts);

  /* "psycopg_binary/pq/pgconn.pyx":119
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def reset(self) -> None:
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":106
 *         return ptr if ptr != -1 else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def info(self) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts
*/

  /* 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_AddTraceback("psycopg_binary.pq.PGconn.info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":121
 *         return rv
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_15reset = {"reset", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_15reset, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_14reset(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_14reset(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "psycopg_binary/pq/pgconn.pyx":123
 *     def reset(self) -> None:
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 libpq.PQreset(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":124
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 libpq.PQreset(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":125
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 libpq.PQreset(pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          PQreset(__pyx_v_pgconn_ptr);

          /* "psycopg_binary/pq/pgconn.pyx":124
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 libpq.PQreset(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":123
 *     def reset(self) -> None:
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 libpq.PQreset(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":126
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 libpq.PQreset(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":127
 *                 libpq.PQreset(pgconn_ptr)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *     def reset_start(self) -> None:
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 127, __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_the_connection_is_closed};
      __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(1, 127, __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, 127, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":126
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 libpq.PQreset(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":121
 *         return rv
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
*/

  /* 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_AddTraceback("psycopg_binary.pq.PGconn.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":129
 *             raise e.OperationalError("the connection is closed")
 * 
 *     def reset_start(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_17reset_start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_17reset_start = {"reset_start", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_17reset_start, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_17reset_start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_start (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_16reset_start(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_16reset_start(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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("reset_start", 0);

  /* "psycopg_binary/pq/pgconn.pyx":131
 *     def reset_start(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQresetStart(self._pgconn_ptr)
 *         if not rv:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":132
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQresetStart(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError("couldn't reset connection")
*/
        __pyx_v_rv = PQresetStart(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":131
 *     def reset_start(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQresetStart(self._pgconn_ptr)
 *         if not rv:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":133
 *         with cython.critical_section(self):
 *             rv = libpq.PQresetStart(self._pgconn_ptr)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't reset connection")
 * 
*/
  __pyx_t_2 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":134
 *             rv = libpq.PQresetStart(self._pgconn_ptr)
 *         if not rv:
 *             raise e.OperationalError("couldn't reset connection")             # <<<<<<<<<<<<<<
 * 
 *     def reset_poll(self) -> int:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 134, __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_couldn_t_reset_connection};
      __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(1, 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(1, 134, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":133
 *         with cython.critical_section(self):
 *             rv = libpq.PQresetStart(self._pgconn_ptr)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't reset connection")
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":129
 *             raise e.OperationalError("the connection is closed")
 * 
 *     def reset_start(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/

  /* 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("psycopg_binary.pq.PGconn.reset_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":136
 *             raise e.OperationalError("couldn't reset connection")
 * 
 *     def reset_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_19reset_poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_19reset_poll = {"reset_poll", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_19reset_poll, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_19reset_poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_poll (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_18reset_poll(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_18reset_poll(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset_poll", 0);

  /* "psycopg_binary/pq/pgconn.pyx":137
 * 
 *     def reset_poll(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQresetPoll)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_int_f)PQresetPoll)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  if (__Pyx_PyInt_FromNumber(&__pyx_t_2, NULL, 0) < (0)) __PYX_ERR(1, 137, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":136
 *             raise e.OperationalError("couldn't reset connection")
 * 
 *     def reset_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.reset_poll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":139
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_21ping(PyObject *__pyx_v_self, PyObject *__pyx_arg_conninfo); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_21ping = {"ping", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_21ping, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_21ping(PyObject *__pyx_v_self, PyObject *__pyx_arg_conninfo) {
  char const *__pyx_v_conninfo;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ping (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_conninfo); {
    __pyx_v_conninfo = __Pyx_PyObject_AsString(__pyx_arg_conninfo); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(1, 140, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_20ping(((PyTypeObject*)__pyx_v_self), ((char const *)__pyx_v_conninfo));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_20ping(CYTHON_UNUSED PyTypeObject *__pyx_v_self, char const *__pyx_v_conninfo) {
  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("ping", 0);

  /* "psycopg_binary/pq/pgconn.pyx":141
 *     @classmethod
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_From_PGPing(PQping(__pyx_v_conninfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(1, 141, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":139
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":143
 *         return libpq.PQping(conninfo)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def db(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQdb)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_2db_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_2db_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_14psycopg_binary_2pq_6PGconn_2db___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_2db___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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);

  /* "psycopg_binary/pq/pgconn.pyx":145
 *     @property
 *     def db(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQdb)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_bytes(__pyx_v_self, PQdb); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":143
 *         return libpq.PQping(conninfo)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def db(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQdb)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.db.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":147
 *         return _call_libpq_bytes(self, libpq.PQdb)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def user(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQuser)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_4user_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_4user_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_14psycopg_binary_2pq_6PGconn_4user___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_4user___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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);

  /* "psycopg_binary/pq/pgconn.pyx":149
 *     @property
 *     def user(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQuser)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_bytes(__pyx_v_self, PQuser); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":147
 *         return _call_libpq_bytes(self, libpq.PQdb)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def user(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQuser)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.user.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":151
 *         return _call_libpq_bytes(self, libpq.PQuser)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def password(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQpass)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_8password_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_8password_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_14psycopg_binary_2pq_6PGconn_8password___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_8password___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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);

  /* "psycopg_binary/pq/pgconn.pyx":153
 *     @property
 *     def password(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQpass)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_bytes(__pyx_v_self, PQpass); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":151
 *         return _call_libpq_bytes(self, libpq.PQuser)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def password(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQpass)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.password.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":155
 *         return _call_libpq_bytes(self, libpq.PQpass)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def host(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQhost)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_4host_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_4host_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_14psycopg_binary_2pq_6PGconn_4host___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_4host___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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);

  /* "psycopg_binary/pq/pgconn.pyx":157
 *     @property
 *     def host(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQhost)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_bytes(__pyx_v_self, PQhost); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":155
 *         return _call_libpq_bytes(self, libpq.PQpass)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def host(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQhost)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.host.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":159
 *         return _call_libpq_bytes(self, libpq.PQhost)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def hostaddr(self) -> bytes:
 *         _check_supported("PQhostaddr", 120000)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_8hostaddr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_8hostaddr_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_14psycopg_binary_2pq_6PGconn_8hostaddr___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_8hostaddr___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  char *__pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":161
 *     @property
 *     def hostaddr(self) -> bytes:
 *         _check_supported("PQhostaddr", 120000)             # <<<<<<<<<<<<<<
 *         cdef char *rv = NULL
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQhostaddr, 0x1D4C0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":162
 *     def hostaddr(self) -> bytes:
 *         _check_supported("PQhostaddr", 120000)
 *         cdef char *rv = NULL             # <<<<<<<<<<<<<<
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
*/
  __pyx_v_rv = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":164
 *         cdef char *rv = NULL
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":165
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":166
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQhostaddr(pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQhostaddr(__pyx_v_pgconn_ptr);

          /* "psycopg_binary/pq/pgconn.pyx":165
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":164
 *         cdef char *rv = NULL
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":167
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         assert rv is not NULL
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":168
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         assert rv is not NULL
 *         return rv
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 168, __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_the_connection_is_closed};
      __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(1, 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(1, 168, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":167
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         assert rv is not NULL
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":169
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         assert rv is not NULL             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = (__pyx_v_rv != NULL);

    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(1, 169, __pyx_L1_error)
    }

  }
  #else
  if ((1)); else __PYX_ERR(1, 169, __pyx_L1_error)
  #endif

  /* "psycopg_binary/pq/pgconn.pyx":170
 *             raise e.OperationalError("the connection is closed")
 *         assert rv is not NULL
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":159
 *         return _call_libpq_bytes(self, libpq.PQhost)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def hostaddr(self) -> bytes:
 *         _check_supported("PQhostaddr", 120000)
*/

  /* 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_AddTraceback("psycopg_binary.pq.PGconn.hostaddr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":172
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def port(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQport)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_4port_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_4port_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_14psycopg_binary_2pq_6PGconn_4port___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_4port___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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);

  /* "psycopg_binary/pq/pgconn.pyx":174
 *     @property
 *     def port(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQport)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_bytes(__pyx_v_self, PQport); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":172
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def port(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQport)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.port.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":176
 *         return _call_libpq_bytes(self, libpq.PQport)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def tty(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQtty)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_3tty_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_3tty_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_14psycopg_binary_2pq_6PGconn_3tty___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_3tty___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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);

  /* "psycopg_binary/pq/pgconn.pyx":178
 *     @property
 *     def tty(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQtty)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_bytes(__pyx_v_self, PQtty); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":176
 *         return _call_libpq_bytes(self, libpq.PQport)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def tty(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQtty)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.tty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":180
 *         return _call_libpq_bytes(self, libpq.PQtty)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def options(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQoptions)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_7options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_7options_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_14psycopg_binary_2pq_6PGconn_7options___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_7options___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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);

  /* "psycopg_binary/pq/pgconn.pyx":182
 *     @property
 *     def options(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQoptions)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_bytes(__pyx_v_self, PQoptions); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":180
 *         return _call_libpq_bytes(self, libpq.PQtty)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def options(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQoptions)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.options.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":184
 *         return _call_libpq_bytes(self, libpq.PQoptions)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         cdef libpq.ConnStatusType rv
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_6status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_6status_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_14psycopg_binary_2pq_6PGconn_6status___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_6status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  ConnStatusType __pyx_v_rv;
  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);

  /* "psycopg_binary/pq/pgconn.pyx":187
 *     def status(self) -> int:
 *         cdef libpq.ConnStatusType rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQstatus(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":188
 *         cdef libpq.ConnStatusType rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQstatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
        __pyx_v_rv = PQstatus(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":187
 *     def status(self) -> int:
 *         cdef libpq.ConnStatusType rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQstatus(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":189
 *         with cython.critical_section(self):
 *             rv = libpq.PQstatus(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_From_ConnStatusType(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":184
 *         return _call_libpq_bytes(self, libpq.PQoptions)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         cdef libpq.ConnStatusType rv
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":191
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def transaction_status(self) -> int:
 *         cdef libpq.PGTransactionStatusType rv
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_18transaction_status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_18transaction_status_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_14psycopg_binary_2pq_6PGconn_18transaction_status___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_18transaction_status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PGTransactionStatusType __pyx_v_rv;
  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);

  /* "psycopg_binary/pq/pgconn.pyx":194
 *     def transaction_status(self) -> int:
 *         cdef libpq.PGTransactionStatusType rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQtransactionStatus(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":195
 *         cdef libpq.PGTransactionStatusType rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQtransactionStatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
        __pyx_v_rv = PQtransactionStatus(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":194
 *     def transaction_status(self) -> int:
 *         cdef libpq.PGTransactionStatusType rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQtransactionStatus(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":196
 *         with cython.critical_section(self):
 *             rv = libpq.PQtransactionStatus(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:
*/
  __pyx_t_1 = __Pyx_PyLong_From_PGTransactionStatusType(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":191
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def transaction_status(self) -> int:
 *         cdef libpq.PGTransactionStatusType rv
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.transaction_status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":198
 *         return rv
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef const char *rv = <const char *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQparameterStatus, name)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_23parameter_status(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_23parameter_status = {"parameter_status", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_23parameter_status, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_23parameter_status(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parameter_status (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 198, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.parameter_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_22parameter_status(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_22parameter_status(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  char const *__pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  void *__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("parameter_status", 0);

  /* "psycopg_binary/pq/pgconn.pyx":199
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:
 *         cdef const char *rv = <const char *>_call_libpq_with_param(             # <<<<<<<<<<<<<<
 *             self, <conn_f_with_param>libpq.PQparameterStatus, name)
 *         if rv is not NULL:
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_with_param(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_f_with_param)PQparameterStatus), __pyx_v_name); if (unlikely(__pyx_t_1 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 199, __pyx_L1_error)
  __pyx_v_rv = ((char const *)__pyx_t_1);


  /* "psycopg_binary/pq/pgconn.pyx":201
 *         cdef const char *rv = <const char *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQparameterStatus, name)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  __pyx_t_2 = (__pyx_v_rv != NULL);

  if (__pyx_t_2) {


    /* "psycopg_binary/pq/pgconn.pyx":202
 *             self, <conn_f_with_param>libpq.PQparameterStatus, name)
 *         if rv is not NULL:
 *             return rv             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((PyObject*)__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgconn.pyx":201
 *         cdef const char *rv = <const char *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQparameterStatus, name)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":204
 *             return rv
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  /*else*/ {
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":198
 *         return rv
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef const char *rv = <const char *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQparameterStatus, name)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.parameter_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":206
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         cdef char *rv
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_13error_message_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_13error_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_14psycopg_binary_2pq_6PGconn_13error_message___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_13error_message___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  char *__pyx_v_rv;
  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);

  /* "psycopg_binary/pq/pgconn.pyx":209
 *     def error_message(self) -> bytes:
 *         cdef char *rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQerrorMessage(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":210
 *         cdef char *rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQerrorMessage(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
        __pyx_v_rv = PQerrorMessage(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":209
 *     def error_message(self) -> bytes:
 *         cdef char *rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQerrorMessage(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":211
 *         with cython.critical_section(self):
 *             rv = libpq.PQerrorMessage(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def get_error_message(self, encoding: str = "") -> str:
*/
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":206
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         cdef char *rv
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.error_message.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":213
 *         return rv
 * 
 *     def get_error_message(self, encoding: str = "") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_25get_error_message(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_6PGconn_25get_error_message = {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_25get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_25get_error_message(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_encoding = 0;
  #if !CYTHON_VECTORCALL
  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_error_message (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_encoding,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, 213, __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, 213, __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_error_message", 0) < (0)) __PYX_ERR(1, 213, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__6));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 213, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__6));
    }
    __pyx_v_encoding = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_error_message", 0, 0, 1, __pyx_nargs); __PYX_ERR(1, 213, __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("psycopg_binary.pq.PGconn.get_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 2))) __PYX_ERR(1, 213, __pyx_L1_error)
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_24get_error_message(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), __pyx_v_encoding);

  /* 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_14psycopg_binary_2pq_6PGconn_24get_error_message(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_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;
  int __pyx_t_6;
  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("get_error_message", 0);

  /* "psycopg_binary/pq/pgconn.pyx":214
 * 
 *     def get_error_message(self, encoding: str = "") -> str:
 *         return _clean_error_message(self.error_message, encoding or self._encoding)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_clean_error_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 214, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __Pyx_INCREF(__pyx_v_encoding);
    __pyx_t_5 = __pyx_v_encoding;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_encoding_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_5 = __pyx_t_7;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_L3_bool_binop_done:;
  __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[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_8, (3-__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_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 214, __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(1, 214, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":213
 *         return rv
 * 
 *     def get_error_message(self, encoding: str = "") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
*/

  /* 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("psycopg_binary.pq.PGconn.get_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":216
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def _encoding(self) -> str:
 *         cdef const char *pgenc
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_9_encoding_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_9_encoding_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_14psycopg_binary_2pq_6PGconn_9_encoding___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_9_encoding___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  char const *__pyx_v_pgenc;
  int __pyx_v_status;
  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("__get__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":220
 *         cdef const char *pgenc
 *         cdef int status
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             status = libpq.PQstatus(self._pgconn_ptr)
 *             if status == libpq.CONNECTION_OK:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":221
 *         cdef int status
 *         with cython.critical_section(self):
 *             status = libpq.PQstatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *             if status == libpq.CONNECTION_OK:
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
*/
        __pyx_v_status = PQstatus(__pyx_v_self->_pgconn_ptr);

        /* "psycopg_binary/pq/pgconn.pyx":222
 *         with cython.critical_section(self):
 *             status = libpq.PQstatus(self._pgconn_ptr)
 *             if status == libpq.CONNECTION_OK:             # <<<<<<<<<<<<<<
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *                 if pgenc is NULL:
*/
        __pyx_t_2 = (__pyx_v_status == CONNECTION_OK);

        if (__pyx_t_2) {


          /* "psycopg_binary/pq/pgconn.pyx":223
 *             status = libpq.PQstatus(self._pgconn_ptr)
 *             if status == libpq.CONNECTION_OK:
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")             # <<<<<<<<<<<<<<
 *                 if pgenc is NULL:
 *                     pgenc = b"UTF8"
*/
          __pyx_v_pgenc = PQparameterStatus(__pyx_v_self->_pgconn_ptr, __pyx_k_client_encoding);

          /* "psycopg_binary/pq/pgconn.pyx":224
 *             if status == libpq.CONNECTION_OK:
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *                 if pgenc is NULL:             # <<<<<<<<<<<<<<
 *                     pgenc = b"UTF8"
 *         if status == libpq.CONNECTION_OK:
*/
          __pyx_t_2 = (__pyx_v_pgenc == NULL);

          if (__pyx_t_2) {


            /* "psycopg_binary/pq/pgconn.pyx":225
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *                 if pgenc is NULL:
 *                     pgenc = b"UTF8"             # <<<<<<<<<<<<<<
 *         if status == libpq.CONNECTION_OK:
 *             return pg2pyenc(pgenc)
*/
            __pyx_v_pgenc = __pyx_k_UTF8;

            /* "psycopg_binary/pq/pgconn.pyx":224
 *             if status == libpq.CONNECTION_OK:
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *                 if pgenc is NULL:             # <<<<<<<<<<<<<<
 *                     pgenc = b"UTF8"
 *         if status == libpq.CONNECTION_OK:
*/
          }

          /* "psycopg_binary/pq/pgconn.pyx":222
 *         with cython.critical_section(self):
 *             status = libpq.PQstatus(self._pgconn_ptr)
 *             if status == libpq.CONNECTION_OK:             # <<<<<<<<<<<<<<
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *                 if pgenc is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":220
 *         cdef const char *pgenc
 *         cdef int status
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             status = libpq.PQstatus(self._pgconn_ptr)
 *             if status == libpq.CONNECTION_OK:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":226
 *                 if pgenc is NULL:
 *                     pgenc = b"UTF8"
 *         if status == libpq.CONNECTION_OK:             # <<<<<<<<<<<<<<
 *             return pg2pyenc(pgenc)
 *         else:
*/
  __pyx_t_2 = (__pyx_v_status == CONNECTION_OK);

  if (__pyx_t_2) {


    /* "psycopg_binary/pq/pgconn.pyx":227
 *                     pgenc = b"UTF8"
 *         if status == libpq.CONNECTION_OK:
 *             return pg2pyenc(pgenc)             # <<<<<<<<<<<<<<
 *         else:
 *             return "utf-8"
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pg2pyenc); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_pgenc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 227, __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[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(1, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_1;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgconn.pyx":226
 *                 if pgenc is NULL:
 *                     pgenc = b"UTF8"
 *         if status == libpq.CONNECTION_OK:             # <<<<<<<<<<<<<<
 *             return pg2pyenc(pgenc)
 *         else:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":229
 *             return pg2pyenc(pgenc)
 *         else:
 *             return "utf-8"             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  /*else*/ {
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_utf_8);
        __pyx_r = __pyx_mstate_global->__pyx_kp_u_utf_8;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":216
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def _encoding(self) -> str:
 *         cdef const char *pgenc
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn._encoding.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":231
 *             return "utf-8"
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def protocol_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQprotocolVersion)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_16protocol_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_16protocol_version_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_14psycopg_binary_2pq_6PGconn_16protocol_version___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_16protocol_version___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":233
 *     @property
 *     def protocol_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQprotocolVersion)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_int_f)PQprotocolVersion)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 233, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":231
 *             return "utf-8"
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def protocol_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQprotocolVersion)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.protocol_version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":235
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQprotocolVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def full_protocol_version(self) -> int:
 *         _check_supported("PQfullProtocolVersion", 180000)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_21full_protocol_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_21full_protocol_version_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_14psycopg_binary_2pq_6PGconn_21full_protocol_version___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_21full_protocol_version___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":237
 *     @property
 *     def full_protocol_version(self) -> int:
 *         _check_supported("PQfullProtocolVersion", 180000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQfullProtocolVersion, 0x2BF20); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":240
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":241
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":242
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQfullProtocolVersion(__pyx_v_pgconn_ptr);

          /* "psycopg_binary/pq/pgconn.pyx":241
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":240
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":243
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         return rv
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":244
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 244, __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_the_connection_is_closed};
      __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(1, 244, __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, 244, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":243
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         return rv
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":245
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":235
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQprotocolVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def full_protocol_version(self) -> int:
 *         _check_supported("PQfullProtocolVersion", 180000)
*/

  /* 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_AddTraceback("psycopg_binary.pq.PGconn.full_protocol_version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":247
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def server_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQserverVersion)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_14server_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_14server_version_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_14psycopg_binary_2pq_6PGconn_14server_version___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_14server_version___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":249
 *     @property
 *     def server_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQserverVersion)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_int_f)PQserverVersion)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 249, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":247
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def server_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQserverVersion)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.server_version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":251
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQserverVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def socket(self) -> int:
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>libpq.PQsocket)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_6socket_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_6socket_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_14psycopg_binary_2pq_6PGconn_6socket___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_6socket___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":253
 *     @property
 *     def socket(self) -> int:
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>libpq.PQsocket)             # <<<<<<<<<<<<<<
 *         if rv == -1:
 *             raise e.OperationalError("the connection is lost")
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_int_f)PQsocket)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 253, __pyx_L1_error)
  __pyx_v_rv = __pyx_t_1;

  /* "psycopg_binary/pq/pgconn.pyx":254
 *     def socket(self) -> int:
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>libpq.PQsocket)
 *         if rv == -1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is lost")
 *         return rv
*/
  __pyx_t_2 = (__pyx_v_rv == -1L);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":255
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>libpq.PQsocket)
 *         if rv == -1:
 *             raise e.OperationalError("the connection is lost")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 255, __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_the_connection_is_lost};
      __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, 255, __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, 255, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":254
 *     def socket(self) -> int:
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>libpq.PQsocket)
 *         if rv == -1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is lost")
 *         return rv
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":256
 *         if rv == -1:
 *             raise e.OperationalError("the connection is lost")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_3;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":251
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQserverVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def socket(self) -> int:
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>libpq.PQsocket)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.socket.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":258
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def backend_pid(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQbackendPID)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_11backend_pid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_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_14psycopg_binary_2pq_6PGconn_11backend_pid___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_11backend_pid___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":260
 *     @property
 *     def backend_pid(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQbackendPID)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_int_f)PQbackendPID)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 260, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":258
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def backend_pid(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQbackendPID)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.backend_pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":262
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQbackendPID)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def needs_password(self) -> bool:
 *         cdef int rv
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_14needs_password_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_14needs_password_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_14psycopg_binary_2pq_6PGconn_14needs_password___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_14needs_password___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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);

  /* "psycopg_binary/pq/pgconn.pyx":265
 *     def needs_password(self) -> bool:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionNeedsPassword(self._pgconn_ptr)
 *         return bool(rv)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":266
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionNeedsPassword(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return bool(rv)
 * 
*/
        __pyx_v_rv = PQconnectionNeedsPassword(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":265
 *     def needs_password(self) -> bool:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionNeedsPassword(self._pgconn_ptr)
 *         return bool(rv)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":267
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionNeedsPassword(self._pgconn_ptr)
 *         return bool(rv)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!(__pyx_v_rv != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":262
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQbackendPID)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def needs_password(self) -> bool:
 *         cdef int rv
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.needs_password.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":269
 *         return bool(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def used_password(self) -> bool:
 *         cdef int rv
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_13used_password_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_13used_password_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_14psycopg_binary_2pq_6PGconn_13used_password___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_13used_password___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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);

  /* "psycopg_binary/pq/pgconn.pyx":272
 *     def used_password(self) -> bool:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionUsedPassword(self._pgconn_ptr)
 *         return bool(rv)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":273
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionUsedPassword(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return bool(rv)
 * 
*/
        __pyx_v_rv = PQconnectionUsedPassword(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":272
 *     def used_password(self) -> bool:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionUsedPassword(self._pgconn_ptr)
 *         return bool(rv)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":274
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionUsedPassword(self._pgconn_ptr)
 *         return bool(rv)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!(__pyx_v_rv != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":269
 *         return bool(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def used_password(self) -> bool:
 *         cdef int rv
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.used_password.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":276
 *         return bool(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def used_gssapi(self) -> bool:
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_11used_gssapi_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_11used_gssapi_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_14psycopg_binary_2pq_6PGconn_11used_gssapi___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_11used_gssapi___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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);

  /* "psycopg_binary/pq/pgconn.pyx":278
 *     @property
 *     def used_gssapi(self) -> bool:
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQconnectionUsedGSSAPI, 0x27100); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":280
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionUsedGSSAPI(self._pgconn_ptr)
 *         return bool(rv)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":281
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionUsedGSSAPI(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return bool(rv)
 * 
*/
        __pyx_v_rv = PQconnectionUsedGSSAPI(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":280
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionUsedGSSAPI(self._pgconn_ptr)
 *         return bool(rv)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":282
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionUsedGSSAPI(self._pgconn_ptr)
 *         return bool(rv)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!(__pyx_v_rv != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":276
 *         return bool(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def used_gssapi(self) -> bool:
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.used_gssapi.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":284
 *         return bool(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ssl_in_use(self) -> bool:
 *         return bool(_call_libpq_int(self, <conn_int_f>libpq.PQsslInUse))
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_10ssl_in_use_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_10ssl_in_use_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_14psycopg_binary_2pq_6PGconn_10ssl_in_use___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_10ssl_in_use___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":286
 *     @property
 *     def ssl_in_use(self) -> bool:
 *         return bool(_call_libpq_int(self, <conn_int_f>libpq.PQsslInUse))             # <<<<<<<<<<<<<<
 * 
 *     def exec_(self, const char *command) -> PGresult:
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_int_f)PQsslInUse)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 286, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!(__pyx_t_1 != 0)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":284
 *         return bool(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ssl_in_use(self) -> bool:
 *         return bool(_call_libpq_int(self, <conn_int_f>libpq.PQsslInUse))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.ssl_in_use.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":288
 *         return bool(_call_libpq_int(self, <conn_int_f>libpq.PQsslInUse))
 * 
 *     def exec_(self, const char *command) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         cdef libpq.PGconn *pgconn_ptr
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_27exec_(PyObject *__pyx_v_self, PyObject *__pyx_arg_command); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_27exec_ = {"exec_", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_27exec_, METH_O, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_27exec_(PyObject *__pyx_v_self, PyObject *__pyx_arg_command) {
  char const *__pyx_v_command;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exec_ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_command); {
    __pyx_v_command = __Pyx_PyObject_AsString(__pyx_arg_command); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 288, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.exec_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_26exec_(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_command));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_26exec_(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command) {
  PGresult *__pyx_v_pgresult;
  PGconn *__pyx_v_pgconn_ptr;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_", 0);

  /* "psycopg_binary/pq/pgconn.pyx":291
 *         cdef libpq.PGresult *pgresult
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_binary/pq/pgconn.pyx":292
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
*/
              __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

              __pyx_v_pgconn_ptr = __pyx_t_2;
              __pyx_t_3 = (__pyx_t_2 != NULL);


              if (__pyx_t_3) {


                /* "psycopg_binary/pq/pgconn.pyx":293
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
                __pyx_v_pgresult = PQexec(__pyx_v_pgconn_ptr, __pyx_v_command);

                /* "psycopg_binary/pq/pgconn.pyx":292
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
*/
              }
            }

            /* "psycopg_binary/pq/pgconn.pyx":291
 *         cdef libpq.PGresult *pgresult
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":294
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":295
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if pgresult is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 295, __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_the_connection_is_closed};
      __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(1, 295, __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, 295, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":294
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":296
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  __pyx_t_3 = (__pyx_v_pgresult == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":297
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"executing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(pgresult)
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":298
 *         if pgresult is NULL:
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(pgresult)
 * 
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_executing_query_failed, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __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(1, 297, __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, 297, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":296
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":299
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(pgresult)             # <<<<<<<<<<<<<<
 * 
 *     def send_query(self, const char *command) -> None:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(__pyx_v_pgresult)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_1);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":288
 *         return bool(_call_libpq_int(self, <conn_int_f>libpq.PQsslInUse))
 * 
 *     def exec_(self, const char *command) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         cdef libpq.PGconn *pgconn_ptr
*/

  /* 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_8);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.exec_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;



  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":301
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_29send_query(PyObject *__pyx_v_self, PyObject *__pyx_arg_command); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_29send_query = {"send_query", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_29send_query, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_29send_query(PyObject *__pyx_v_self, PyObject *__pyx_arg_command) {
  char const *__pyx_v_command;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_query (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_command); {
    __pyx_v_command = __Pyx_PyObject_AsString(__pyx_arg_command); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 301, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_28send_query(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_command));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_28send_query(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command) {
  int __pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query", 0);

  /* "psycopg_binary/pq/pgconn.pyx":304
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_binary/pq/pgconn.pyx":305
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
*/
              __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

              __pyx_v_pgconn_ptr = __pyx_t_2;
              __pyx_t_3 = (__pyx_t_2 != NULL);


              if (__pyx_t_3) {


                /* "psycopg_binary/pq/pgconn.pyx":306
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
                __pyx_v_rv = PQsendQuery(__pyx_v_pgconn_ptr, __pyx_v_command);

                /* "psycopg_binary/pq/pgconn.pyx":305
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
*/
              }
            }

            /* "psycopg_binary/pq/pgconn.pyx":304
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":307
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":308
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 308, __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_the_connection_is_closed};
      __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(1, 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(1, 308, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":307
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":309
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query failed: {self.get_error_message()}")
*/
  __pyx_t_3 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":310
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query failed: {self.get_error_message()}")
 * 
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":311
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending query failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 * 
 *     def exec_params(
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_query_failed, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __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(1, 310, __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, 310, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":309
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":301
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/

  /* 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_8);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;



  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":313
 *                 f"sending query failed: {self.get_error_message()}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_31exec_params(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_6PGconn_31exec_params = {"exec_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_31exec_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_31exec_params(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_command;
  PyObject *__pyx_v_param_values = 0;
  PyObject *__pyx_v_param_types = 0;
  PyObject *__pyx_v_param_formats = 0;
  int __pyx_v_result_format;
  #if !CYTHON_VECTORCALL
  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;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exec_params (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_command,&__pyx_mstate_global->__pyx_n_u_param_values,&__pyx_mstate_global->__pyx_n_u_param_types,&__pyx_mstate_global->__pyx_n_u_param_formats,&__pyx_mstate_global->__pyx_n_u_result_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, 313, __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(1, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, "exec_params", 0) < (0)) __PYX_ERR(1, 313, __pyx_L3_error)

      /* "psycopg_binary/pq/pgconn.pyx":317
 *         const char *command,
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "psycopg_binary/pq/pgconn.pyx":318
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("exec_params", 0, 2, 5, i); __PYX_ERR(1, 313, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 313, __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, 313, __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, 313, __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, 313, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 313, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "psycopg_binary/pq/pgconn.pyx":317
 *         const char *command,
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "psycopg_binary/pq/pgconn.pyx":318
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_command = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 315, __pyx_L3_error)
    __pyx_v_param_values = values[1];
    __pyx_v_param_types = values[2];
    __pyx_v_param_formats = values[3];
    if (values[4]) {
      __pyx_v_result_format = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 319, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_mstate_global->__pyx_k__7;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("exec_params", 0, 2, 5, __pyx_nargs); __PYX_ERR(1, 313, __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("psycopg_binary.pq.PGconn.exec_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_30exec_params(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), __pyx_v_command, __pyx_v_param_values, __pyx_v_param_types, __pyx_v_param_formats, __pyx_v_result_format);

  /* "psycopg_binary/pq/pgconn.pyx":313
 *                 f"sending query failed: {self.get_error_message()}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

  /* 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 struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_30exec_params(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_types, PyObject *__pyx_v_param_formats, int __pyx_v_result_format) {
  Py_ssize_t __pyx_v_cnparams;
  Oid *__pyx_v_ctypes;
  char *const *__pyx_v_cvalues;
  int *__pyx_v_clengths;
  int *__pyx_v_cformats;
  PGconn *__pyx_v_pgconn_ptr;
  PGresult *__pyx_v_pgresult;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Oid *__pyx_t_3;
  char *const *__pyx_t_4;
  int *__pyx_t_5;
  int *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PGconn *__pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_params", 0);

  /* "psycopg_binary/pq/pgconn.pyx":326
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, param_types, param_formats)
 * 
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__query_params_args(__pyx_v_param_values, __pyx_v_param_types, __pyx_v_param_formats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 326, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1.f0;

  __pyx_t_3 = __pyx_t_1.f1;

  __pyx_t_4 = __pyx_t_1.f2;

  __pyx_t_5 = __pyx_t_1.f3;

  __pyx_t_6 = __pyx_t_1.f4;

  __pyx_v_cnparams = __pyx_t_2;
  __pyx_v_ctypes = __pyx_t_3;
  __pyx_v_cvalues = __pyx_t_4;
  __pyx_v_clengths = __pyx_t_5;
  __pyx_v_cformats = __pyx_t_6;


  /* "psycopg_binary/pq/pgconn.pyx":331
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexecParams(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_7);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_binary/pq/pgconn.pyx":332
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 pgresult = libpq.PQexecParams(
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;

              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_9 = (__pyx_t_8 != NULL);


              if (__pyx_t_9) {


                /* "psycopg_binary/pq/pgconn.pyx":333
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexecParams(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
*/
                __pyx_v_pgresult = PQexecParams(__pyx_v_pgconn_ptr, __pyx_v_command, ((int)__pyx_v_cnparams), __pyx_v_ctypes, ((char const *const *)__pyx_v_cvalues), __pyx_v_clengths, __pyx_v_cformats, __pyx_v_result_format);

                /* "psycopg_binary/pq/pgconn.pyx":332
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 pgresult = libpq.PQexecParams(
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
*/
              }
            }

            /* "psycopg_binary/pq/pgconn.pyx":331
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexecParams(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":336
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  __pyx_f_14psycopg_binary_2pq__clear_query_params(__pyx_v_ctypes, __pyx_v_cvalues, __pyx_v_clengths, __pyx_v_cformats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 336, __pyx_L1_error)

  /* "psycopg_binary/pq/pgconn.pyx":337
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
*/
  __pyx_t_9 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_9)) {


    /* "psycopg_binary/pq/pgconn.pyx":338
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if pgresult is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 338, __pyx_L1_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_the_connection_is_closed};
      __pyx_t_7 = __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_7)) __PYX_ERR(1, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 338, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":337
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":339
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  __pyx_t_9 = (__pyx_v_pgresult == NULL);

  if (unlikely(__pyx_t_9)) {


    /* "psycopg_binary/pq/pgconn.pyx":340
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"executing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(pgresult)
*/
    __pyx_t_12 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":341
 *         if pgresult is NULL:
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(pgresult)
 * 
*/
    __pyx_t_14 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_14);
    __pyx_t_13 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
      __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
    }
    __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_executing_query_failed, __pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_13 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      assert(__pyx_t_12);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
      __pyx_t_13 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 340, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":339
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":342
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(pgresult)             # <<<<<<<<<<<<<<
 * 
 *     def send_query_params(
*/
  __pyx_t_7 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(__pyx_v_pgresult)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_7);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":313
 *                 f"sending query failed: {self.get_error_message()}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.exec_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;







  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":344
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_33send_query_params(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_6PGconn_33send_query_params = {"send_query_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_33send_query_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_33send_query_params(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_command;
  PyObject *__pyx_v_param_values = 0;
  PyObject *__pyx_v_param_types = 0;
  PyObject *__pyx_v_param_formats = 0;
  int __pyx_v_result_format;
  #if !CYTHON_VECTORCALL
  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("send_query_params (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_command,&__pyx_mstate_global->__pyx_n_u_param_values,&__pyx_mstate_global->__pyx_n_u_param_types,&__pyx_mstate_global->__pyx_n_u_param_formats,&__pyx_mstate_global->__pyx_n_u_result_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, 344, __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(1, 344, __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, 344, __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, 344, __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, 344, __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, 344, __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, "send_query_params", 0) < (0)) __PYX_ERR(1, 344, __pyx_L3_error)

      /* "psycopg_binary/pq/pgconn.pyx":348
 *         const char *command,
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "psycopg_binary/pq/pgconn.pyx":349
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("send_query_params", 0, 2, 5, i); __PYX_ERR(1, 344, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 344, __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, 344, __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, 344, __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, 344, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 344, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "psycopg_binary/pq/pgconn.pyx":348
 *         const char *command,
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "psycopg_binary/pq/pgconn.pyx":349
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_command = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
    __pyx_v_param_values = values[1];
    __pyx_v_param_types = values[2];
    __pyx_v_param_formats = values[3];
    if (values[4]) {
      __pyx_v_result_format = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 350, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_mstate_global->__pyx_k__8;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_query_params", 0, 2, 5, __pyx_nargs); __PYX_ERR(1, 344, __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("psycopg_binary.pq.PGconn.send_query_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_32send_query_params(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), __pyx_v_command, __pyx_v_param_values, __pyx_v_param_types, __pyx_v_param_formats, __pyx_v_result_format);

  /* "psycopg_binary/pq/pgconn.pyx":344
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

  /* 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_14psycopg_binary_2pq_6PGconn_32send_query_params(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_types, PyObject *__pyx_v_param_formats, int __pyx_v_result_format) {
  Py_ssize_t __pyx_v_cnparams;
  Oid *__pyx_v_ctypes;
  char *const *__pyx_v_cvalues;
  int *__pyx_v_clengths;
  int *__pyx_v_cformats;
  PGconn *__pyx_v_pgconn_ptr;
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Oid *__pyx_t_3;
  char *const *__pyx_t_4;
  int *__pyx_t_5;
  int *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PGconn *__pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query_params", 0);

  /* "psycopg_binary/pq/pgconn.pyx":357
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, param_types, param_formats)
 * 
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__query_params_args(__pyx_v_param_values, __pyx_v_param_types, __pyx_v_param_formats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 357, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1.f0;

  __pyx_t_3 = __pyx_t_1.f1;

  __pyx_t_4 = __pyx_t_1.f2;

  __pyx_t_5 = __pyx_t_1.f3;

  __pyx_t_6 = __pyx_t_1.f4;

  __pyx_v_cnparams = __pyx_t_2;
  __pyx_v_ctypes = __pyx_t_3;
  __pyx_v_cvalues = __pyx_t_4;
  __pyx_v_clengths = __pyx_t_5;
  __pyx_v_cformats = __pyx_t_6;


  /* "psycopg_binary/pq/pgconn.pyx":362
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryParams(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_7);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_binary/pq/pgconn.pyx":363
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQueryParams(
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;

              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_9 = (__pyx_t_8 != NULL);


              if (__pyx_t_9) {


                /* "psycopg_binary/pq/pgconn.pyx":364
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryParams(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
*/
                __pyx_v_rv = PQsendQueryParams(__pyx_v_pgconn_ptr, __pyx_v_command, ((int)__pyx_v_cnparams), __pyx_v_ctypes, ((char const *const *)__pyx_v_cvalues), __pyx_v_clengths, __pyx_v_cformats, __pyx_v_result_format);

                /* "psycopg_binary/pq/pgconn.pyx":363
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQueryParams(
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
*/
              }
            }

            /* "psycopg_binary/pq/pgconn.pyx":362
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryParams(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":367
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  __pyx_f_14psycopg_binary_2pq__clear_query_params(__pyx_v_ctypes, __pyx_v_cvalues, __pyx_v_clengths, __pyx_v_cformats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L1_error)

  /* "psycopg_binary/pq/pgconn.pyx":368
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_9 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_9)) {


    /* "psycopg_binary/pq/pgconn.pyx":369
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 369, __pyx_L1_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_the_connection_is_closed};
      __pyx_t_7 = __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_7)) __PYX_ERR(1, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 369, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":368
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":370
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"
*/
  __pyx_t_9 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_9)) {


    /* "psycopg_binary/pq/pgconn.pyx":371
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query and params failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_12 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":372
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_14 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_14);
    __pyx_t_13 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
      __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
    }
    __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_query_and_params_failed, __pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_13 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      assert(__pyx_t_12);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
      __pyx_t_13 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 371, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":370
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":344
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_query_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;







  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":375
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_35send_prepare(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_6PGconn_35send_prepare = {"send_prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_35send_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_35send_prepare(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_name;
  char const *__pyx_v_command;
  PyObject *__pyx_v_param_types = 0;
  #if !CYTHON_VECTORCALL
  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("send_prepare (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_name,&__pyx_mstate_global->__pyx_n_u_command,&__pyx_mstate_global->__pyx_n_u_param_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, 375, __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, 375, __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, 375, __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, 375, __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, "send_prepare", 0) < (0)) __PYX_ERR(1, 375, __pyx_L3_error)

      /* "psycopg_binary/pq/pgconn.pyx":379
 *         const char *name,
 *         const char *command,
 *         param_types: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         cdef int i
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("send_prepare", 0, 2, 3, i); __PYX_ERR(1, 375, __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(1, 375, __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, 375, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 375, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 377, __pyx_L3_error)
    __pyx_v_command = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 378, __pyx_L3_error)
    __pyx_v_param_types = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_prepare", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 375, __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("psycopg_binary.pq.PGconn.send_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_34send_prepare(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), __pyx_v_name, __pyx_v_command, __pyx_v_param_types);

  /* "psycopg_binary/pq/pgconn.pyx":375
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* 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_14psycopg_binary_2pq_6PGconn_34send_prepare(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, char const *__pyx_v_command, PyObject *__pyx_v_param_types) {
  int __pyx_v_i;
  PyObject *__pyx_v_types_fast = 0;
  Py_ssize_t __pyx_v_nparams;
  Oid *__pyx_v_atypes;
  PGconn *__pyx_v_pgconn_ptr;
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6;
  Oid __pyx_t_7;
  PGconn *__pyx_t_8;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_prepare", 0);

  /* "psycopg_binary/pq/pgconn.pyx":383
 *         cdef int i
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0             # <<<<<<<<<<<<<<
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
*/
  __pyx_v_nparams = 0;

  /* "psycopg_binary/pq/pgconn.pyx":384
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:             # <<<<<<<<<<<<<<
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
*/
  __pyx_t_1 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":385
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")             # <<<<<<<<<<<<<<
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
 * 
*/
    __pyx_t_2 = PySequence_Fast(__pyx_v_param_types, ((char *)"\047param_types\047 is not a sequence")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_types_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":386
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.Oid *atypes = NULL
*/
    __pyx_v_nparams = PySequence_Fast_GET_SIZE(__pyx_v_types_fast);

    /* "psycopg_binary/pq/pgconn.pyx":384
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:             # <<<<<<<<<<<<<<
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":388
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
 * 
 *         cdef libpq.Oid *atypes = NULL             # <<<<<<<<<<<<<<
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
*/
  __pyx_v_atypes = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":389
 * 
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
*/
  __pyx_t_1 = (__pyx_v_nparams != 0);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":390
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))             # <<<<<<<<<<<<<<
 *             for i in range(nparams):
 *                 atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)
*/
    __pyx_v_atypes = ((Oid *)PyMem_Malloc((__pyx_v_nparams * (sizeof(Oid)))));

    /* "psycopg_binary/pq/pgconn.pyx":391
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):             # <<<<<<<<<<<<<<
 *                 atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)
 * 
*/

    __pyx_t_3 = __pyx_v_nparams;
    __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;

      /* "psycopg_binary/pq/pgconn.pyx":392
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
 *                 atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.PGconn *pgconn_ptr
*/
      if (unlikely(!__pyx_v_types_fast)) { __Pyx_RaiseUnboundLocalError("types_fast"); __PYX_ERR(1, 392, __pyx_L1_error) }
      __pyx_t_6 = PySequence_Fast_GET_ITEM(__pyx_v_types_fast, __pyx_v_i);

      __pyx_t_7 = __Pyx_PyLong_As_Oid(((PyObject *)__pyx_t_6)); if (unlikely((__pyx_t_7 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(1, 392, __pyx_L1_error)

      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_7;

    }


    /* "psycopg_binary/pq/pgconn.pyx":389
 * 
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":396
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendPrepare(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_binary/pq/pgconn.pyx":397
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendPrepare(
 *                     pgconn_ptr, name, command, <int>nparams, atypes
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;

              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_1 = (__pyx_t_8 != NULL);


              if (__pyx_t_1) {


                /* "psycopg_binary/pq/pgconn.pyx":398
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendPrepare(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, name, command, <int>nparams, atypes
 *                 )
*/
                __pyx_v_rv = PQsendPrepare(__pyx_v_pgconn_ptr, __pyx_v_name, __pyx_v_command, ((int)__pyx_v_nparams), __pyx_v_atypes);

                /* "psycopg_binary/pq/pgconn.pyx":397
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendPrepare(
 *                     pgconn_ptr, name, command, <int>nparams, atypes
*/
              }
            }

            /* "psycopg_binary/pq/pgconn.pyx":396
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendPrepare(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L12;
              }
              __pyx_L12:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":401
 *                     pgconn_ptr, name, command, <int>nparams, atypes
 *                 )
 *         PyMem_Free(atypes)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  PyMem_Free(__pyx_v_atypes);

  /* "psycopg_binary/pq/pgconn.pyx":402
 *                 )
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_1 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgconn.pyx":403
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 403, __pyx_L1_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_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_12 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __pyx_t_2 = __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_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 403, __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, 403, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":402
 *                 )
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":404
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"
*/
  __pyx_t_1 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgconn.pyx":405
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query and params failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_11 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":406
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_13 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_13);
    __pyx_t_12 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
      __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_query_and_params_failed, __pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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_9};
      __pyx_t_2 = __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_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 405, __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, 405, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":404
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":375
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XDECREF(__pyx_v_types_fast);




  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":409
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_37send_query_prepared(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_6PGconn_37send_query_prepared = {"send_query_prepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_37send_query_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_37send_query_prepared(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_name;
  PyObject *__pyx_v_param_values = 0;
  PyObject *__pyx_v_param_formats = 0;
  int __pyx_v_result_format;
  #if !CYTHON_VECTORCALL
  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("send_query_prepared (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_name,&__pyx_mstate_global->__pyx_n_u_param_values,&__pyx_mstate_global->__pyx_n_u_param_formats,&__pyx_mstate_global->__pyx_n_u_result_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, 409, __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(1, 409, __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, 409, __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, 409, __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, 409, __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, "send_query_prepared", 0) < (0)) __PYX_ERR(1, 409, __pyx_L3_error)

      /* "psycopg_binary/pq/pgconn.pyx":413
 *         const char *name,
 *         param_values: Sequence[bytes | None] | None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("send_query_prepared", 0, 2, 4, i); __PYX_ERR(1, 409, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 409, __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, 409, __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, 409, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 409, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 411, __pyx_L3_error)
    __pyx_v_param_values = values[1];
    __pyx_v_param_formats = values[2];
    if (values[3]) {
      __pyx_v_result_format = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 414, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_mstate_global->__pyx_k__9;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_query_prepared", 0, 2, 4, __pyx_nargs); __PYX_ERR(1, 409, __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("psycopg_binary.pq.PGconn.send_query_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_36send_query_prepared(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), __pyx_v_name, __pyx_v_param_values, __pyx_v_param_formats, __pyx_v_result_format);

  /* "psycopg_binary/pq/pgconn.pyx":409
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* 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_14psycopg_binary_2pq_6PGconn_36send_query_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_formats, int __pyx_v_result_format) {
  Py_ssize_t __pyx_v_cnparams;
  Oid *__pyx_v_ctypes;
  char *const *__pyx_v_cvalues;
  int *__pyx_v_clengths;
  int *__pyx_v_cformats;
  PGconn *__pyx_v_pgconn_ptr;
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Oid *__pyx_t_3;
  char *const *__pyx_t_4;
  int *__pyx_t_5;
  int *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PGconn *__pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query_prepared", 0);

  /* "psycopg_binary/pq/pgconn.pyx":421
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, None, param_formats)
 * 
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__query_params_args(__pyx_v_param_values, Py_None, __pyx_v_param_formats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 421, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1.f0;

  __pyx_t_3 = __pyx_t_1.f1;

  __pyx_t_4 = __pyx_t_1.f2;

  __pyx_t_5 = __pyx_t_1.f3;

  __pyx_t_6 = __pyx_t_1.f4;

  __pyx_v_cnparams = __pyx_t_2;
  __pyx_v_ctypes = __pyx_t_3;
  __pyx_v_cvalues = __pyx_t_4;
  __pyx_v_clengths = __pyx_t_5;
  __pyx_v_cformats = __pyx_t_6;


  /* "psycopg_binary/pq/pgconn.pyx":426
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryPrepared(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_7);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_binary/pq/pgconn.pyx":427
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQueryPrepared(
 *                     pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;

              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_9 = (__pyx_t_8 != NULL);


              if (__pyx_t_9) {


                /* "psycopg_binary/pq/pgconn.pyx":428
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryPrepared(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
 *                     clengths, cformats, result_format)
*/
                __pyx_v_rv = PQsendQueryPrepared(__pyx_v_pgconn_ptr, __pyx_v_name, ((int)__pyx_v_cnparams), ((char const *const *)__pyx_v_cvalues), __pyx_v_clengths, __pyx_v_cformats, __pyx_v_result_format);

                /* "psycopg_binary/pq/pgconn.pyx":427
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQueryPrepared(
 *                     pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
*/
              }
            }

            /* "psycopg_binary/pq/pgconn.pyx":426
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryPrepared(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":431
 *                     pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  __pyx_f_14psycopg_binary_2pq__clear_query_params(__pyx_v_ctypes, __pyx_v_cvalues, __pyx_v_clengths, __pyx_v_cformats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 431, __pyx_L1_error)

  /* "psycopg_binary/pq/pgconn.pyx":432
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_9 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_9)) {


    /* "psycopg_binary/pq/pgconn.pyx":433
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 433, __pyx_L1_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_the_connection_is_closed};
      __pyx_t_7 = __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_7)) __PYX_ERR(1, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 433, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":432
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":434
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending prepared query failed: {self.get_error_message()}"
*/
  __pyx_t_9 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_9)) {


    /* "psycopg_binary/pq/pgconn.pyx":435
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending prepared query failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_12 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":436
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending prepared query failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_14 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_14);
    __pyx_t_13 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
      __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 436, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
    }
    __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_prepared_query_failed, __pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_13 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      assert(__pyx_t_12);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
      __pyx_t_13 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 435, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":434
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending prepared query failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":409
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_query_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;







  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":439
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_39prepare(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_6PGconn_39prepare = {"prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_39prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_39prepare(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_name;
  char const *__pyx_v_command;
  PyObject *__pyx_v_param_types = 0;
  #if !CYTHON_VECTORCALL
  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;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prepare (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_name,&__pyx_mstate_global->__pyx_n_u_command,&__pyx_mstate_global->__pyx_n_u_param_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, 439, __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, 439, __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, 439, __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, 439, __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(1, 439, __pyx_L3_error)

      /* "psycopg_binary/pq/pgconn.pyx":443
 *         const char *name,
 *         const char *command,
 *         param_types: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         cdef int i
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("prepare", 0, 2, 3, i); __PYX_ERR(1, 439, __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(1, 439, __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, 439, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 439, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 441, __pyx_L3_error)
    __pyx_v_command = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L3_error)
    __pyx_v_param_types = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prepare", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 439, __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("psycopg_binary.pq.PGconn.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_38prepare(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), __pyx_v_name, __pyx_v_command, __pyx_v_param_types);

  /* "psycopg_binary/pq/pgconn.pyx":439
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* 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 struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_38prepare(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, char const *__pyx_v_command, PyObject *__pyx_v_param_types) {
  int __pyx_v_i;
  PyObject *__pyx_v_types_fast = 0;
  Py_ssize_t __pyx_v_nparams;
  Oid *__pyx_v_atypes;
  PGconn *__pyx_v_pgconn_ptr;
  PGresult *__pyx_v_rv;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6;
  Oid __pyx_t_7;
  PGconn *__pyx_t_8;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prepare", 0);

  /* "psycopg_binary/pq/pgconn.pyx":447
 *         cdef int i
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0             # <<<<<<<<<<<<<<
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
*/
  __pyx_v_nparams = 0;

  /* "psycopg_binary/pq/pgconn.pyx":448
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:             # <<<<<<<<<<<<<<
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
*/
  __pyx_t_1 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":449
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")             # <<<<<<<<<<<<<<
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
 * 
*/
    __pyx_t_2 = PySequence_Fast(__pyx_v_param_types, ((char *)"\047param_types\047 is not a sequence")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_types_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":450
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.Oid *atypes = NULL
*/
    __pyx_v_nparams = PySequence_Fast_GET_SIZE(__pyx_v_types_fast);

    /* "psycopg_binary/pq/pgconn.pyx":448
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:             # <<<<<<<<<<<<<<
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":452
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
 * 
 *         cdef libpq.Oid *atypes = NULL             # <<<<<<<<<<<<<<
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
*/
  __pyx_v_atypes = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":453
 * 
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
*/
  __pyx_t_1 = (__pyx_v_nparams != 0);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":454
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))             # <<<<<<<<<<<<<<
 *             for i in range(nparams):
 *                 atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)
*/
    __pyx_v_atypes = ((Oid *)PyMem_Malloc((__pyx_v_nparams * (sizeof(Oid)))));

    /* "psycopg_binary/pq/pgconn.pyx":455
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):             # <<<<<<<<<<<<<<
 *                 atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)
 * 
*/

    __pyx_t_3 = __pyx_v_nparams;
    __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;

      /* "psycopg_binary/pq/pgconn.pyx":456
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
 *                 atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.PGconn *pgconn_ptr
*/
      if (unlikely(!__pyx_v_types_fast)) { __Pyx_RaiseUnboundLocalError("types_fast"); __PYX_ERR(1, 456, __pyx_L1_error) }
      __pyx_t_6 = PySequence_Fast_GET_ITEM(__pyx_v_types_fast, __pyx_v_i);

      __pyx_t_7 = __Pyx_PyLong_As_Oid(((PyObject *)__pyx_t_6)); if (unlikely((__pyx_t_7 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(1, 456, __pyx_L1_error)

      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_7;

    }


    /* "psycopg_binary/pq/pgconn.pyx":453
 * 
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":460
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQprepare(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_binary/pq/pgconn.pyx":461
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQprepare(
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;

              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_1 = (__pyx_t_8 != NULL);


              if (__pyx_t_1) {


                /* "psycopg_binary/pq/pgconn.pyx":462
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQprepare(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
*/
                __pyx_v_rv = PQprepare(__pyx_v_pgconn_ptr, __pyx_v_name, __pyx_v_command, ((int)__pyx_v_nparams), __pyx_v_atypes);

                /* "psycopg_binary/pq/pgconn.pyx":461
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQprepare(
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
*/
              }
            }

            /* "psycopg_binary/pq/pgconn.pyx":460
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQprepare(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L12;
              }
              __pyx_L12:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":464
 *                 rv = libpq.PQprepare(
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  PyMem_Free(__pyx_v_atypes);

  /* "psycopg_binary/pq/pgconn.pyx":465
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  __pyx_t_1 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgconn.pyx":466
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 466, __pyx_L1_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_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_12 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __pyx_t_2 = __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_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 466, __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, 466, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":465
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":467
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"preparing query failed: {self.get_error_message()}")
*/
  __pyx_t_1 = (__pyx_v_rv == NULL);

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgconn.pyx":468
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"preparing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_11 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":469
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"preparing query failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(rv)
 * 
*/
    __pyx_t_13 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_13);
    __pyx_t_12 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
      __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_preparing_query_failed, __pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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_9};
      __pyx_t_2 = __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_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 468, __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, 468, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":467
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"preparing query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":470
 *             raise e.OperationalError(
 *                 f"preparing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def exec_prepared(
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_2);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":439
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* 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_13);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XDECREF(__pyx_v_types_fast);




  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":472
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_41exec_prepared(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_6PGconn_41exec_prepared = {"exec_prepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_41exec_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_41exec_prepared(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_name;
  PyObject *__pyx_v_param_values = 0;
  PyObject *__pyx_v_param_formats = 0;
  int __pyx_v_result_format;
  #if !CYTHON_VECTORCALL
  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;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exec_prepared (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_name,&__pyx_mstate_global->__pyx_n_u_param_values,&__pyx_mstate_global->__pyx_n_u_param_formats,&__pyx_mstate_global->__pyx_n_u_result_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, 472, __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(1, 472, __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, 472, __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, 472, __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, 472, __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, "exec_prepared", 0) < (0)) __PYX_ERR(1, 472, __pyx_L3_error)

      /* "psycopg_binary/pq/pgconn.pyx":476
 *         const char *name,
 *         param_values: Sequence[bytes] | None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("exec_prepared", 0, 2, 4, i); __PYX_ERR(1, 472, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 472, __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, 472, __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, 472, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 472, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 474, __pyx_L3_error)
    __pyx_v_param_values = values[1];
    __pyx_v_param_formats = values[2];
    if (values[3]) {
      __pyx_v_result_format = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 477, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_mstate_global->__pyx_k__10;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("exec_prepared", 0, 2, 4, __pyx_nargs); __PYX_ERR(1, 472, __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("psycopg_binary.pq.PGconn.exec_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_40exec_prepared(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), __pyx_v_name, __pyx_v_param_values, __pyx_v_param_formats, __pyx_v_result_format);

  /* "psycopg_binary/pq/pgconn.pyx":472
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* 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 struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_40exec_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_formats, int __pyx_v_result_format) {
  Py_ssize_t __pyx_v_cnparams;
  Oid *__pyx_v_ctypes;
  char *const *__pyx_v_cvalues;
  int *__pyx_v_clengths;
  int *__pyx_v_cformats;
  PGconn *__pyx_v_pgconn_ptr;
  PGresult *__pyx_v_rv;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Oid *__pyx_t_3;
  char *const *__pyx_t_4;
  int *__pyx_t_5;
  int *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PGconn *__pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_prepared", 0);

  /* "psycopg_binary/pq/pgconn.pyx":484
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, None, param_formats)
 * 
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__query_params_args(__pyx_v_param_values, Py_None, __pyx_v_param_formats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 484, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1.f0;

  __pyx_t_3 = __pyx_t_1.f1;

  __pyx_t_4 = __pyx_t_1.f2;

  __pyx_t_5 = __pyx_t_1.f3;

  __pyx_t_6 = __pyx_t_1.f4;

  __pyx_v_cnparams = __pyx_t_2;
  __pyx_v_ctypes = __pyx_t_3;
  __pyx_v_cvalues = __pyx_t_4;
  __pyx_v_clengths = __pyx_t_5;
  __pyx_v_cformats = __pyx_t_6;


  /* "psycopg_binary/pq/pgconn.pyx":489
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQexecPrepared(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_7);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_binary/pq/pgconn.pyx":490
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQexecPrepared(
 *                     pgconn_ptr, name, <int>cnparams,
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;

              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_9 = (__pyx_t_8 != NULL);


              if (__pyx_t_9) {


                /* "psycopg_binary/pq/pgconn.pyx":491
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQexecPrepared(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, name, <int>cnparams,
 *                     <const char *const *>cvalues,
*/
                __pyx_v_rv = PQexecPrepared(__pyx_v_pgconn_ptr, __pyx_v_name, ((int)__pyx_v_cnparams), ((char const *const *)__pyx_v_cvalues), __pyx_v_clengths, __pyx_v_cformats, __pyx_v_result_format);

                /* "psycopg_binary/pq/pgconn.pyx":490
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQexecPrepared(
 *                     pgconn_ptr, name, <int>cnparams,
*/
              }
            }

            /* "psycopg_binary/pq/pgconn.pyx":489
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQexecPrepared(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":495
 *                     <const char *const *>cvalues,
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  __pyx_f_14psycopg_binary_2pq__clear_query_params(__pyx_v_ctypes, __pyx_v_cvalues, __pyx_v_clengths, __pyx_v_cformats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 495, __pyx_L1_error)

  /* "psycopg_binary/pq/pgconn.pyx":496
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  __pyx_t_9 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_9)) {


    /* "psycopg_binary/pq/pgconn.pyx":497
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 497, __pyx_L1_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_the_connection_is_closed};
      __pyx_t_7 = __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_7)) __PYX_ERR(1, 497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 497, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":496
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":498
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing prepared query failed: {self.get_error_message()}"
*/
  __pyx_t_9 = (__pyx_v_rv == NULL);

  if (unlikely(__pyx_t_9)) {


    /* "psycopg_binary/pq/pgconn.pyx":499
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"executing prepared query failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_12 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":500
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"executing prepared query failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_14 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_14);
    __pyx_t_13 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
      __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
    }
    __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_executing_prepared_query_failed, __pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_13 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      assert(__pyx_t_12);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
      __pyx_t_13 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 499, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":498
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing prepared query failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":502
 *                 f"executing prepared query failed: {self.get_error_message()}"
 *             )
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:
*/
  __pyx_t_7 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_7);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":472
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.exec_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;







  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":504
 *         return PGresult._from_ptr(rv)
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, name)
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_43describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_43describe_prepared = {"describe_prepared", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_43describe_prepared, METH_O, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_43describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("describe_prepared (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 504, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.describe_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_42describe_prepared(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_42describe_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  PGresult *__pyx_v_rv;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  void *__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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("describe_prepared", 0);

  /* "psycopg_binary/pq/pgconn.pyx":505
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(             # <<<<<<<<<<<<<<
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, name)
 *         if rv is NULL:
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_with_param(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_f_with_param)PQdescribePrepared), __pyx_v_name); if (unlikely(__pyx_t_1 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 505, __pyx_L1_error)
  __pyx_v_rv = ((PGresult *)__pyx_t_1);


  /* "psycopg_binary/pq/pgconn.pyx":507
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (__pyx_v_rv == NULL);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":508
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, name)
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"describe prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":509
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_describe_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 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_8 = 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_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;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 508, __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, 508, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":507
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":511
 *                 f"describe prepared failed: {self.get_error_message()}"
 *             )
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def send_describe_prepared(self, const char *name) -> None:
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_3);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":504
 *         return PGresult._from_ptr(rv)
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, name)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.describe_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":513
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, name)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_45send_describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_45send_describe_prepared = {"send_describe_prepared", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_45send_describe_prepared, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_45send_describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_describe_prepared (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 513, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_describe_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_44send_describe_prepared(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_44send_describe_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_describe_prepared", 0);

  /* "psycopg_binary/pq/pgconn.pyx":514
 * 
 *     def send_describe_prepared(self, const char *name) -> None:
 *         cdef int rv = _call_libpq_int_with_param(             # <<<<<<<<<<<<<<
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, name)
 *         if not rv:
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_int_with_param(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_int_f_with_param)PQsendDescribePrepared), __pyx_v_name); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 514, __pyx_L1_error)
  __pyx_v_rv = __pyx_t_1;

  /* "psycopg_binary/pq/pgconn.pyx":516
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":517
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, name)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending describe prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":518
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 518, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_describe_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 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_8 = 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_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;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 517, __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, 517, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":516
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":513
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, 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_7);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_describe_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":521
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePortal, name)
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_47describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_47describe_portal = {"describe_portal", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_47describe_portal, METH_O, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_47describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("describe_portal (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 521, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.describe_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_46describe_portal(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_46describe_portal(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  PGresult *__pyx_v_rv;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  void *__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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("describe_portal", 0);

  /* "psycopg_binary/pq/pgconn.pyx":522
 * 
 *     def describe_portal(self, const char *name) -> PGresult:
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(             # <<<<<<<<<<<<<<
 *             self, <conn_f_with_param>libpq.PQdescribePortal, name)
 *         if rv is NULL:
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_with_param(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_f_with_param)PQdescribePortal), __pyx_v_name); if (unlikely(__pyx_t_1 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 522, __pyx_L1_error)
  __pyx_v_rv = ((PGresult *)__pyx_t_1);


  /* "psycopg_binary/pq/pgconn.pyx":524
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePortal, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (__pyx_v_rv == NULL);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":525
 *             self, <conn_f_with_param>libpq.PQdescribePortal, name)
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"describe prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":526
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_describe_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 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_8 = 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_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;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 525, __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, 525, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":524
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePortal, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":528
 *                 f"describe prepared failed: {self.get_error_message()}"
 *             )
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def send_describe_portal(self, const char *name) -> None:
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_3);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":521
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePortal, name)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.describe_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":530
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, name)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_49send_describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_49send_describe_portal = {"send_describe_portal", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_49send_describe_portal, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_49send_describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_describe_portal (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 530, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_describe_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_48send_describe_portal(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_48send_describe_portal(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_describe_portal", 0);

  /* "psycopg_binary/pq/pgconn.pyx":531
 * 
 *     def send_describe_portal(self, const char *name) -> None:
 *         cdef int rv = _call_libpq_int_with_param(             # <<<<<<<<<<<<<<
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, name)
 *         if not rv:
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__call_libpq_int_with_param(__pyx_v_self, ((__pyx_t_14psycopg_binary_2pq_conn_int_f_with_param)PQsendDescribePortal), __pyx_v_name); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 531, __pyx_L1_error)
  __pyx_v_rv = __pyx_t_1;

  /* "psycopg_binary/pq/pgconn.pyx":533
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":534
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, name)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending describe prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":535
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_describe_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 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_8 = 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_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;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 534, __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, 534, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":533
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":530
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, 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_7);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_describe_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":538
 *             )
 * 
 *     def close_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePrepared", 170000)
 *         cdef libpq.PGresult *rv
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_51close_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_51close_prepared = {"close_prepared", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_51close_prepared, METH_O, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_51close_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close_prepared (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 538, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.close_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_50close_prepared(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_50close_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  PGresult *__pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close_prepared", 0);

  /* "psycopg_binary/pq/pgconn.pyx":539
 * 
 *     def close_prepared(self, const char *name) -> PGresult:
 *         _check_supported("PQclosePrepared", 170000)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQclosePrepared, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":542
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":543
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":544
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQclosePrepared(__pyx_v_pgconn_ptr, __pyx_v_name);

          /* "psycopg_binary/pq/pgconn.pyx":543
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":542
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":545
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":546
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 546, __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_the_connection_is_closed};
      __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(1, 546, __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, 546, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":545
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":547
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"
*/
  __pyx_t_3 = (__pyx_v_rv == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":548
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":549
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_close_prepared_failed, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __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(1, 548, __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, 548, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":547
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":551
 *                 f"close prepared failed: {self.get_error_message()}"
 *             )
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def send_close_prepared(self, const char *name) -> None:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_1);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":538
 *             )
 * 
 *     def close_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePrepared", 170000)
 *         cdef libpq.PGresult *rv
*/

  /* 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_8);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.close_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;



  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":553
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePrepared", 170000)
 *         cdef int rv
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_53send_close_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_53send_close_prepared = {"send_close_prepared", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_53send_close_prepared, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_53send_close_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_close_prepared (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 553, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_close_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_52send_close_prepared(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_52send_close_prepared(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  int __pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_close_prepared", 0);

  /* "psycopg_binary/pq/pgconn.pyx":554
 * 
 *     def send_close_prepared(self, const char *name) -> None:
 *         _check_supported("PQsendClosePrepared", 170000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQsendClosePrepared, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":557
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":558
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":559
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQsendClosePrepared(__pyx_v_pgconn_ptr, __pyx_v_name);

          /* "psycopg_binary/pq/pgconn.pyx":558
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":557
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":560
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":561
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 561, __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_the_connection_is_closed};
      __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(1, 561, __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, 561, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":560
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":562
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"
*/
  __pyx_t_3 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":563
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":564
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_close_prepared_failed, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __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(1, 563, __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, 563, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":562
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":553
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePrepared", 170000)
 *         cdef int rv
*/

  /* 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_8);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_close_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;



  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":567
 *             )
 * 
 *     def close_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePortal", 170000)
 *         cdef libpq.PGresult *rv
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_55close_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_55close_portal = {"close_portal", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_55close_portal, METH_O, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_55close_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close_portal (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 567, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_54close_portal(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_54close_portal(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  PGresult *__pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close_portal", 0);

  /* "psycopg_binary/pq/pgconn.pyx":568
 * 
 *     def close_portal(self, const char *name) -> PGresult:
 *         _check_supported("PQclosePortal", 170000)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQclosePortal, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":571
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":572
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":573
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQclosePortal(__pyx_v_pgconn_ptr, __pyx_v_name);

          /* "psycopg_binary/pq/pgconn.pyx":572
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":571
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":574
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":575
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 575, __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_the_connection_is_closed};
      __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(1, 575, __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, 575, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":574
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":576
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"
*/
  __pyx_t_3 = (__pyx_v_rv == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":577
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":578
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_close_prepared_failed, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __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(1, 577, __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, 577, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":576
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":580
 *                 f"close prepared failed: {self.get_error_message()}"
 *             )
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def send_close_portal(self, const char *name) -> None:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_1);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":567
 *             )
 * 
 *     def close_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePortal", 170000)
 *         cdef libpq.PGresult *rv
*/

  /* 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_8);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;



  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":582
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePortal", 170000)
 *         cdef int rv
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_57send_close_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_57send_close_portal = {"send_close_portal", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_57send_close_portal, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_57send_close_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_close_portal (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 582, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_56send_close_portal(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_56send_close_portal(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  int __pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_close_portal", 0);

  /* "psycopg_binary/pq/pgconn.pyx":583
 * 
 *     def send_close_portal(self, const char *name) -> None:
 *         _check_supported("PQsendClosePortal", 170000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQsendClosePortal, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":586
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":587
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":588
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQsendClosePortal(__pyx_v_pgconn_ptr, __pyx_v_name);

          /* "psycopg_binary/pq/pgconn.pyx":587
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":586
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":589
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":590
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 590, __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_the_connection_is_closed};
      __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(1, 590, __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, 590, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":589
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":591
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"
*/
  __pyx_t_3 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":592
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":593
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_close_prepared_failed, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __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(1, 592, __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, 592, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":591
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":582
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePortal", 170000)
 *         cdef int rv
*/

  /* 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_8);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;



  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":596
 *             )
 * 
 *     def get_result(self) -> "PGresult" | None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_59get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_59get_result = {"get_result", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_59get_result, METH_NOARGS, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_59get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_result (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_58get_result(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_58get_result(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PGresult *__pyx_v_pgresult;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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("get_result", 0);

  /* "psycopg_binary/pq/pgconn.pyx":598
 *     def get_result(self) -> "PGresult" | None:
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":599
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):
 *             pgresult = libpq.PQgetResult(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgresult is NULL:
 *             return None
*/
        __pyx_v_pgresult = PQgetResult(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":598
 *     def get_result(self) -> "PGresult" | None:
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":600
 *         with cython.critical_section(self):
 *             pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return PGresult._from_ptr(pgresult)
*/
  __pyx_t_2 = (__pyx_v_pgresult == NULL);

  if (__pyx_t_2) {


    /* "psycopg_binary/pq/pgconn.pyx":601
 *             pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(pgresult)
 * 
*/
    {
      struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)Py_None); __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF((PyObject *)__pyx_temp);
    }
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgconn.pyx":600
 *         with cython.critical_section(self):
 *             pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return PGresult._from_ptr(pgresult)
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":602
 *         if pgresult is NULL:
 *             return None
 *         return PGresult._from_ptr(pgresult)             # <<<<<<<<<<<<<<
 * 
 *     def consume_input(self) -> None:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(__pyx_v_pgresult)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_1);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":596
 *             )
 * 
 *     def get_result(self) -> "PGresult" | None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":604
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_61consume_input(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_61consume_input = {"consume_input", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_61consume_input, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_61consume_input(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("consume_input (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_60consume_input(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_60consume_input(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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("consume_input", 0);

  /* "psycopg_binary/pq/pgconn.pyx":606
 *     def consume_input(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)
 *         if 1 != rv:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":607
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if 1 != rv:
 *             raise e.OperationalError(
*/
        __pyx_v_rv = PQconsumeInput(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":606
 *     def consume_input(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)
 *         if 1 != rv:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":608
 *         with cython.critical_section(self):
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)
 *         if 1 != rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"consuming input failed: {self.get_error_message()}")
*/
  __pyx_t_2 = (1 != __pyx_v_rv);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":609
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)
 *         if 1 != rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":610
 *         if 1 != rv:
 *             raise e.OperationalError(
 *                 f"consuming input failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 * 
 *     def is_busy(self) -> int:
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__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(1, 610, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_consuming_input_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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_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_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_1)) __PYX_ERR(1, 609, __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, 609, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":608
 *         with cython.critical_section(self):
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)
 *         if 1 != rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"consuming input failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":604
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/

  /* 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("psycopg_binary.pq.PGconn.consume_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":612
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_63is_busy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_63is_busy = {"is_busy", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_63is_busy, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_63is_busy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_busy (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_62is_busy(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_62is_busy(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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_busy", 0);

  /* "psycopg_binary/pq/pgconn.pyx":614
 *     def is_busy(self) -> int:
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_binary/pq/pgconn.pyx":615
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             rv = libpq.PQisBusy(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
              __pyx_v_rv = PQisBusy(__pyx_v_self->_pgconn_ptr);
            }

            /* "psycopg_binary/pq/pgconn.pyx":614
 *     def is_busy(self) -> int:
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":616
 *         with cython.critical_section(self), nogil:
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(1, 616, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":612
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.is_busy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":618
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nonblocking(self) -> int:
 *         cdef int rv
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_11nonblocking_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_11nonblocking_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_14psycopg_binary_2pq_6PGconn_11nonblocking___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_11nonblocking___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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);

  /* "psycopg_binary/pq/pgconn.pyx":621
 *     def nonblocking(self) -> int:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisnonblocking(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":622
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQisnonblocking(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
        __pyx_v_rv = PQisnonblocking(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":621
 *     def nonblocking(self) -> int:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisnonblocking(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":623
 *         with cython.critical_section(self):
 *             rv = libpq.PQisnonblocking(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @nonblocking.setter
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":618
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nonblocking(self) -> int:
 *         cdef int rv
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.nonblocking.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":625
 *         return rv
 * 
 *     @nonblocking.setter             # <<<<<<<<<<<<<<
 *     def nonblocking(self, int arg) -> None:
 *         cdef int rv
*/

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_11nonblocking_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_arg); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_11nonblocking_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_arg) {
  int __pyx_v_arg;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_arg); {
    __pyx_v_arg = __Pyx_PyLong_As_int(__pyx_arg_arg); if (unlikely((__pyx_v_arg == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 626, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.nonblocking.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_11nonblocking_2__set__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((int)__pyx_v_arg));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_6PGconn_11nonblocking_2__set__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, int __pyx_v_arg) {
  int __pyx_v_rv;
  int __pyx_r;
  __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("__set__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":628
 *     def nonblocking(self, int arg) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)
 *         if 0 > rv:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":629
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)             # <<<<<<<<<<<<<<
 *         if 0 > rv:
 *             raise e.OperationalError(
*/
        __pyx_v_rv = PQsetnonblocking(__pyx_v_self->_pgconn_ptr, __pyx_v_arg);
      }

      /* "psycopg_binary/pq/pgconn.pyx":628
 *     def nonblocking(self, int arg) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)
 *         if 0 > rv:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":630
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)
 *         if 0 > rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"setting nonblocking failed: {self.get_error_message()}")
*/
  __pyx_t_2 = (0 > __pyx_v_rv);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":631
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)
 *         if 0 > rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":632
 *         if 0 > rv:
 *             raise e.OperationalError(
 *                 f"setting nonblocking failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 * 
 *     cpdef int flush(self) except -1:
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__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(1, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_setting_nonblocking_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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_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_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_1)) __PYX_ERR(1, 631, __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, 631, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":630
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)
 *         if 0 > rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"setting nonblocking failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":625
 *         return rv
 * 
 *     @nonblocking.setter             # <<<<<<<<<<<<<<
 *     def nonblocking(self, int arg) -> None:
 *         cdef int rv
*/

  /* function exit code */
  __pyx_r = 0;
  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("psycopg_binary.pq.PGconn.nonblocking.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;



  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":634
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
 *     cpdef int flush(self) except -1:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/

static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_65flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int __pyx_f_14psycopg_binary_2pq_6PGconn_flush(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  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_t_6;
  PGconn *__pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flush", 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_14psycopg_binary_2pq_PGconn &&
  __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_flush); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_14psycopg_binary_2pq_6PGconn_65flush)) {
        __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(1, 634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 634, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        {
          __pyx_r = __pyx_t_6;
        }
        __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
  }

  /* "psycopg_binary/pq/pgconn.pyx":637
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQflush(self._pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":638
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQflush(self._pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_7 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_7;
        __pyx_t_8 = (__pyx_t_7 != NULL);


        if (__pyx_t_8) {


          /* "psycopg_binary/pq/pgconn.pyx":639
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQflush(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")
*/
          __pyx_v_rv = PQflush(__pyx_v_self->_pgconn_ptr);

          /* "psycopg_binary/pq/pgconn.pyx":638
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQflush(self._pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":637
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQflush(self._pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":640
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQflush(self._pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         if rv < 0:
*/
  __pyx_t_8 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_8)) {


    /* "psycopg_binary/pq/pgconn.pyx":641
 *                 rv = libpq.PQflush(self._pgconn_ptr)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")             # <<<<<<<<<<<<<<
 *         if rv < 0:
 *             raise e.OperationalError(f"flushing failed: {self.get_error_message()}")
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 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_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_flushing_failed_the_connection_i};
      __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_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 641, __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, 641, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":640
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQflush(self._pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         if rv < 0:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":642
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"flushing failed: {self.get_error_message()}")
 *         return rv
*/
  __pyx_t_8 = (__pyx_v_rv < 0);

  if (unlikely(__pyx_t_8)) {


    /* "psycopg_binary/pq/pgconn.pyx":643
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         if rv < 0:
 *             raise e.OperationalError(f"flushing failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_flushing_failed, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __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(1, 643, __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, 643, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":642
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"flushing failed: {self.get_error_message()}")
 *         return rv
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":644
 *         if rv < 0:
 *             raise e.OperationalError(f"flushing failed: {self.get_error_message()}")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def set_single_row_mode(self) -> None:
*/
  {

    __pyx_r = __pyx_v_rv;
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":634
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
 *     cpdef int flush(self) except -1:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/

  /* 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_9);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;



  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_65flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_65flush = {"flush", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_65flush, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_65flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_64flush(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_64flush(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flush", 0);
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq_6PGconn_flush(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 634, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":646
 *         return rv
 * 
 *     def set_single_row_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_67set_single_row_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_67set_single_row_mode = {"set_single_row_mode", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_67set_single_row_mode, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_67set_single_row_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_single_row_mode (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_66set_single_row_mode(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_66set_single_row_mode(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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("set_single_row_mode", 0);

  /* "psycopg_binary/pq/pgconn.pyx":648
 *     def set_single_row_mode(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)
 *         if not rv:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":649
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError("setting single row mode failed")
*/
        __pyx_v_rv = PQsetSingleRowMode(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":648
 *     def set_single_row_mode(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)
 *         if not rv:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":650
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting single row mode failed")
 * 
*/
  __pyx_t_2 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":651
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)
 *         if not rv:
 *             raise e.OperationalError("setting single row mode failed")             # <<<<<<<<<<<<<<
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 651, __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_setting_single_row_mode_failed};
      __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(1, 651, __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, 651, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":650
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting single row mode failed")
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":646
 *         return rv
 * 
 *     def set_single_row_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/

  /* 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("psycopg_binary.pq.PGconn.set_single_row_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":653
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef int s = size
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_69set_chunked_rows_mode(PyObject *__pyx_v_self, PyObject *__pyx_v_size); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_69set_chunked_rows_mode = {"set_chunked_rows_mode", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_69set_chunked_rows_mode, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_69set_chunked_rows_mode(PyObject *__pyx_v_self, PyObject *__pyx_v_size) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_chunked_rows_mode (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_size), (&PyLong_Type), 0, "size", 2))) __PYX_ERR(1, 653, __pyx_L1_error)
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_68set_chunked_rows_mode(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((PyObject*)__pyx_v_size));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_68set_chunked_rows_mode(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_size) {
  int __pyx_v_rv;
  int __pyx_v_s;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_chunked_rows_mode", 0);

  /* "psycopg_binary/pq/pgconn.pyx":655
 *     def set_chunked_rows_mode(self, size: int) -> None:
 *         cdef int rv
 *         cdef int s = size             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 655, __pyx_L1_error)
  __pyx_v_s = __pyx_t_1;

  /* "psycopg_binary/pq/pgconn.pyx":656
 *         cdef int rv
 *         cdef int s = size
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
 *         if not rv:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":657
 *         cdef int s = size
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError("setting chunked rows mode failed")
*/
        __pyx_v_rv = PQsetChunkedRowsMode(__pyx_v_self->_pgconn_ptr, __pyx_v_s);
      }

      /* "psycopg_binary/pq/pgconn.pyx":656
 *         cdef int rv
 *         cdef int s = size
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
 *         if not rv:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":658
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
*/
  __pyx_t_3 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":659
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
 *         if not rv:
 *             raise e.OperationalError("setting chunked rows mode failed")             # <<<<<<<<<<<<<<
 * 
 *     def cancel_conn(self) -> PGcancelConn:
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 659, __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_setting_chunked_rows_mode_failed};
      __pyx_t_2 = __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_2)) __PYX_ERR(1, 659, __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, 659, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":658
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":653
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef int s = size
*/

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.set_chunked_rows_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":661
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
 *     def cancel_conn(self) -> PGcancelConn:             # <<<<<<<<<<<<<<
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_pw_14psycopg_binary_2pq_6PGconn_71cancel_conn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_71cancel_conn = {"cancel_conn", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_71cancel_conn, METH_NOARGS, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_pw_14psycopg_binary_2pq_6PGconn_71cancel_conn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel_conn (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_70cancel_conn(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_pf_14psycopg_binary_2pq_6PGconn_70cancel_conn(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PGcancelConn *__pyx_v_ptr;
  struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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("cancel_conn", 0);

  /* "psycopg_binary/pq/pgconn.pyx":662
 * 
 *     def cancel_conn(self) -> PGcancelConn:
 *         _check_supported("PQcancelCreate", 170000)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancelConn *ptr
 *         with cython.critical_section(self):
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQcancelCreate, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":664
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":665
 *         cdef libpq.PGcancelConn *ptr
 *         with cython.critical_section(self):
 *             ptr = libpq.PQcancelCreate(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancelConn object")
*/
        __pyx_v_ptr = PQcancelCreate(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":664
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":666
 *         with cython.critical_section(self):
 *             ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't create cancelConn object")
 *         return PGcancelConn._from_ptr(ptr)
*/
  __pyx_t_2 = (!(__pyx_v_ptr != 0));

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":667
 *             ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancelConn object")             # <<<<<<<<<<<<<<
 *         return PGcancelConn._from_ptr(ptr)
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 667, __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_couldn_t_create_cancelConn_objec};
      __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(1, 667, __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, 667, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":666
 *         with cython.critical_section(self):
 *             ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't create cancelConn object")
 *         return PGcancelConn._from_ptr(ptr)
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":668
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancelConn object")
 *         return PGcancelConn._from_ptr(ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_cancel(self) -> PGcancel:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_12PGcancelConn__from_ptr(__pyx_v_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_t_1);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":661
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
 *     def cancel_conn(self) -> PGcancelConn:             # <<<<<<<<<<<<<<
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.cancel_conn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":670
 *         return PGcancelConn._from_ptr(ptr)
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_pw_14psycopg_binary_2pq_6PGconn_73get_cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_73get_cancel = {"get_cancel", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_73get_cancel, METH_NOARGS, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_pw_14psycopg_binary_2pq_6PGconn_73get_cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_cancel (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_72get_cancel(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_pf_14psycopg_binary_2pq_6PGconn_72get_cancel(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PGcancel *__pyx_v_ptr;
  struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__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("get_cancel", 0);

  /* "psycopg_binary/pq/pgconn.pyx":672
 *     def get_cancel(self) -> PGcancel:
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":673
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):
 *             ptr = libpq.PQgetCancel(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancel object")
*/
        __pyx_v_ptr = PQgetCancel(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":672
 *     def get_cancel(self) -> PGcancel:
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":674
 *         with cython.critical_section(self):
 *             ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't create cancel object")
 *         return PGcancel._from_ptr(ptr)
*/
  __pyx_t_2 = (!(__pyx_v_ptr != 0));

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":675
 *             ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancel object")             # <<<<<<<<<<<<<<
 *         return PGcancel._from_ptr(ptr)
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 675, __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_couldn_t_create_cancel_object};
      __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(1, 675, __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, 675, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":674
 *         with cython.critical_section(self):
 *             ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't create cancel object")
 *         return PGcancel._from_ptr(ptr)
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":676
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancel object")
 *         return PGcancel._from_ptr(ptr)             # <<<<<<<<<<<<<<
 * 
 *     cpdef object notifies(self):
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGcancel__from_ptr(__pyx_v_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGcancel *)__pyx_t_1);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":670
 *         return PGcancelConn._from_ptr(ptr)
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.get_cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":678
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), nogil:
*/

static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_75notifies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_6PGconn_notifies(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, int __pyx_skip_dispatch) {
  PGnotify *__pyx_v_ptr;
  PyObject *__pyx_v_ret = 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;
  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("notifies", 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_14psycopg_binary_2pq_PGconn &&
  __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_notifies); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 678, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_14psycopg_binary_2pq_6PGconn_75notifies)) {
        __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(1, 678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        {
          PyObject *__pyx_temp;
          {
            __pyx_temp = __pyx_r;
            __pyx_r = __pyx_t_2;
          }
          __Pyx_XDECREF(__pyx_temp);
        }
        __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
  }

  /* "psycopg_binary/pq/pgconn.pyx":680
 *     cpdef object notifies(self):
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_binary/pq/pgconn.pyx":681
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), nogil:
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if ptr:
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)
*/
              __pyx_v_ptr = PQnotifies(__pyx_v_self->_pgconn_ptr);
            }

            /* "psycopg_binary/pq/pgconn.pyx":680
 *     cpdef object notifies(self):
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":682
 *         with cython.critical_section(self), nogil:
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:             # <<<<<<<<<<<<<<
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)
 *             libpq.PQfreemem(ptr)
*/
  __pyx_t_6 = (__pyx_v_ptr != 0);

  if (__pyx_t_6) {


    /* "psycopg_binary/pq/pgconn.pyx":683
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)             # <<<<<<<<<<<<<<
 *             libpq.PQfreemem(ptr)
 *             return ret
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PGnotify); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_ptr->relname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_ptr->be_pid); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_ptr->extra); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __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[4] = {__pyx_t_2, __pyx_t_3, __pyx_t_7, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (4-__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_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 683, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_ret = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":684
 *         if ptr:
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)
 *             libpq.PQfreemem(ptr)             # <<<<<<<<<<<<<<
 *             return ret
 *         else:
*/
    PQfreemem(__pyx_v_ptr);

    /* "psycopg_binary/pq/pgconn.pyx":685
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)
 *             libpq.PQfreemem(ptr)
 *             return ret             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __Pyx_INCREF(__pyx_v_ret);
        __pyx_r = __pyx_v_ret;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgconn.pyx":682
 *         with cython.critical_section(self), nogil:
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:             # <<<<<<<<<<<<<<
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)
 *             libpq.PQfreemem(ptr)
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":687
 *             return ret
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def put_copy_data(self, buffer) -> int:
*/
  /*else*/ {
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":678
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), nogil:
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.notifies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;

  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_75notifies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_75notifies = {"notifies", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_75notifies, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_75notifies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("notifies (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_74notifies(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_74notifies(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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("notifies", 0);
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq_6PGconn_notifies(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.notifies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":689
 *             return None
 * 
 *     def put_copy_data(self, buffer) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef char *cbuffer
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_77put_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_v_buffer); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_77put_copy_data = {"put_copy_data", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_77put_copy_data, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_77put_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_v_buffer) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put_copy_data (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_76put_copy_data(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((PyObject *)__pyx_v_buffer));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_76put_copy_data(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_buffer) {
  int __pyx_v_rv;
  char *__pyx_v_cbuffer;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put_copy_data", 0);

  /* "psycopg_binary/pq/pgconn.pyx":694
 *         cdef Py_ssize_t length
 * 
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__buffer_as_string_and_size(__pyx_v_buffer, (&__pyx_v_cbuffer), (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)


  /* "psycopg_binary/pq/pgconn.pyx":695
 * 
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":696
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)
 *         with cython.critical_section(self):
 *             rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)             # <<<<<<<<<<<<<<
 *         if rv < 0:
 *             raise e.OperationalError(
*/
        __pyx_v_rv = PQputCopyData(__pyx_v_self->_pgconn_ptr, __pyx_v_cbuffer, ((int)__pyx_v_length));
      }

      /* "psycopg_binary/pq/pgconn.pyx":695
 * 
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":697
 *         with cython.critical_section(self):
 *             rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending copy data failed: {self.get_error_message()}")
*/
  __pyx_t_3 = (__pyx_v_rv < 0);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":698
 *             rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending copy data failed: {self.get_error_message()}")
 *         return rv
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":699
 *         if rv < 0:
 *             raise e.OperationalError(
 *                 f"sending copy data failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_copy_data_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 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_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __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;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 698, __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, 698, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":697
 *         with cython.critical_section(self):
 *             rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending copy data failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":700
 *             raise e.OperationalError(
 *                 f"sending copy data failed: {self.get_error_message()}")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def put_copy_end(self, error: bytes | None = None) -> int:
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_2, NULL, 0) < (0)) __PYX_ERR(1, 700, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":689
 *             return None
 * 
 *     def put_copy_data(self, buffer) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef char *cbuffer
*/

  /* function exit code */
  __pyx_L1_error:;
  __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_AddTraceback("psycopg_binary.pq.PGconn.put_copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;



  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":702
 *         return rv
 * 
 *     def put_copy_end(self, error: bytes | None = None) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef const char *cerr = NULL
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_79put_copy_end(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_6PGconn_79put_copy_end = {"put_copy_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_79put_copy_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_79put_copy_end(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_error = 0;
  #if !CYTHON_VECTORCALL
  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("put_copy_end (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_error,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, 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(1, 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, "put_copy_end", 0) < (0)) __PYX_ERR(1, 702, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 702, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_error = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put_copy_end", 0, 0, 1, __pyx_nargs); __PYX_ERR(1, 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("psycopg_binary.pq.PGconn.put_copy_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_error), (&PyBytes_Type), 1, "error", 2))) __PYX_ERR(1, 702, __pyx_L1_error)
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_78put_copy_end(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), __pyx_v_error);

  /* 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_14psycopg_binary_2pq_6PGconn_78put_copy_end(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_error) {
  int __pyx_v_rv;
  char const *__pyx_v_cerr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  char *__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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put_copy_end", 0);

  /* "psycopg_binary/pq/pgconn.pyx":704
 *     def put_copy_end(self, error: bytes | None = None) -> int:
 *         cdef int rv
 *         cdef const char *cerr = NULL             # <<<<<<<<<<<<<<
 *         if error is not None:
 *             cerr = PyBytes_AsString(error)
*/
  __pyx_v_cerr = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":705
 *         cdef int rv
 *         cdef const char *cerr = NULL
 *         if error is not None:             # <<<<<<<<<<<<<<
 *             cerr = PyBytes_AsString(error)
 * 
*/
  __pyx_t_1 = (__pyx_v_error != ((PyObject*)Py_None));
  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":706
 *         cdef const char *cerr = NULL
 *         if error is not None:
 *             cerr = PyBytes_AsString(error)             # <<<<<<<<<<<<<<
 * 
 *         with cython.critical_section(self):
*/
    __pyx_t_2 = PyBytes_AsString(__pyx_v_error); if (unlikely(__pyx_t_2 == ((void *)NULL))) __PYX_ERR(1, 706, __pyx_L1_error)
    __pyx_v_cerr = __pyx_t_2;

    /* "psycopg_binary/pq/pgconn.pyx":705
 *         cdef int rv
 *         cdef const char *cerr = NULL
 *         if error is not None:             # <<<<<<<<<<<<<<
 *             cerr = PyBytes_AsString(error)
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":708
 *             cerr = PyBytes_AsString(error)
 * 
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_3);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":709
 * 
 *         with cython.critical_section(self):
 *             rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)             # <<<<<<<<<<<<<<
 *         if rv < 0:
 *             raise e.OperationalError(
*/
        __pyx_v_rv = PQputCopyEnd(__pyx_v_self->_pgconn_ptr, __pyx_v_cerr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":708
 *             cerr = PyBytes_AsString(error)
 * 
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":710
 *         with cython.critical_section(self):
 *             rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending copy end failed: {self.get_error_message()}")
*/
  __pyx_t_1 = (__pyx_v_rv < 0);

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgconn.pyx":711
 *             rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending copy end failed: {self.get_error_message()}")
 *         return rv
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":712
 *         if rv < 0:
 *             raise e.OperationalError(
 *                 f"sending copy end failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 712, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_copy_end_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 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_8 = 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_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;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 711, __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, 711, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":710
 *         with cython.critical_section(self):
 *             rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending copy end failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":713
 *             raise e.OperationalError(
 *                 f"sending copy end failed: {self.get_error_message()}")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def get_copy_data(self, int async_) -> tuple[int, memoryview]:
*/
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_3, NULL, 0) < (0)) __PYX_ERR(1, 713, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":702
 *         return rv
 * 
 *     def put_copy_end(self, error: bytes | None = None) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef const char *cerr = NULL
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.put_copy_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":715
 *         return rv
 * 
 *     def get_copy_data(self, int async_) -> tuple[int, memoryview]:             # <<<<<<<<<<<<<<
 *         cdef char *buffer_ptr = NULL
 *         cdef int nbytes
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_81get_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_arg_async_); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_81get_copy_data = {"get_copy_data", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_81get_copy_data, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_81get_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_arg_async_) {
  int __pyx_v_async_;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_copy_data (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_async_); {
    __pyx_v_async_ = __Pyx_PyLong_As_int(__pyx_arg_async_); if (unlikely((__pyx_v_async_ == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 715, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.get_copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_80get_copy_data(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((int)__pyx_v_async_));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_80get_copy_data(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, int __pyx_v_async_) {
  char *__pyx_v_buffer_ptr;
  int __pyx_v_nbytes;
  PyObject *__pyx_v_data = 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;
  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_copy_data", 0);

  /* "psycopg_binary/pq/pgconn.pyx":716
 * 
 *     def get_copy_data(self, int async_) -> tuple[int, memoryview]:
 *         cdef char *buffer_ptr = NULL             # <<<<<<<<<<<<<<
 *         cdef int nbytes
 * 
*/
  __pyx_v_buffer_ptr = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":719
 *         cdef int nbytes
 * 
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":720
 * 
 *         with cython.critical_section(self):
 *             nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)             # <<<<<<<<<<<<<<
 *         if nbytes == -2:
 *             raise e.OperationalError(
*/
        __pyx_v_nbytes = PQgetCopyData(__pyx_v_self->_pgconn_ptr, (&__pyx_v_buffer_ptr), __pyx_v_async_);
      }

      /* "psycopg_binary/pq/pgconn.pyx":719
 *         cdef int nbytes
 * 
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":721
 *         with cython.critical_section(self):
 *             nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"receiving copy data failed: {self.get_error_message()}")
*/
  __pyx_t_2 = (__pyx_v_nbytes == -2L);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":722
 *             nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"receiving copy data failed: {self.get_error_message()}")
 *         if buffer_ptr is not NULL:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":723
 *         if nbytes == -2:
 *             raise e.OperationalError(
 *                 f"receiving copy data failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         if buffer_ptr is not NULL:
 *             data = PyMemoryView_FromObject(
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__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(1, 723, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_receiving_copy_data_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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_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_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_1)) __PYX_ERR(1, 722, __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, 722, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":721
 *         with cython.critical_section(self):
 *             nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"receiving copy data failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":724
 *             raise e.OperationalError(
 *                 f"receiving copy data failed: {self.get_error_message()}")
 *         if buffer_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             data = PyMemoryView_FromObject(
 *                 PQBuffer._from_buffer(<unsigned char *>buffer_ptr, nbytes))
*/
  __pyx_t_2 = (__pyx_v_buffer_ptr != NULL);

  if (__pyx_t_2) {


    /* "psycopg_binary/pq/pgconn.pyx":726
 *         if buffer_ptr is not NULL:
 *             data = PyMemoryView_FromObject(
 *                 PQBuffer._from_buffer(<unsigned char *>buffer_ptr, nbytes))             # <<<<<<<<<<<<<<
 *             return nbytes, data
 *         else:
*/
    __pyx_t_1 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PQBuffer__from_buffer(((unsigned char *)__pyx_v_buffer_ptr), __pyx_v_nbytes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "psycopg_binary/pq/pgconn.pyx":725
 *                 f"receiving copy data failed: {self.get_error_message()}")
 *         if buffer_ptr is not NULL:
 *             data = PyMemoryView_FromObject(             # <<<<<<<<<<<<<<
 *                 PQBuffer._from_buffer(<unsigned char *>buffer_ptr, nbytes))
 *             return nbytes, data
*/
    __pyx_t_5 = PyMemoryView_FromObject(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_data = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":727
 *             data = PyMemoryView_FromObject(
 *                 PQBuffer._from_buffer(<unsigned char *>buffer_ptr, nbytes))
 *             return nbytes, data             # <<<<<<<<<<<<<<
 *         else:
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
*/
    __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 727, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_data) != (0)) __PYX_ERR(1, 727, __pyx_L1_error);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((PyObject*)__pyx_t_1);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgconn.pyx":724
 *             raise e.OperationalError(
 *                 f"receiving copy data failed: {self.get_error_message()}")
 *         if buffer_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             data = PyMemoryView_FromObject(
 *                 PQBuffer._from_buffer(<unsigned char *>buffer_ptr, nbytes))
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":729
 *             return nbytes, data
 *         else:
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview             # <<<<<<<<<<<<<<
 * 
 *     def trace(self, fileno: int) -> None:
*/
  /*else*/ {
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1) != (0)) __PYX_ERR(1, 729, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b__6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_b__6) != (0)) __PYX_ERR(1, 729, __pyx_L1_error);
    __pyx_t_1 = 0;
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((PyObject*)__pyx_t_5);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":715
 *         return rv
 * 
 *     def get_copy_data(self, int async_) -> tuple[int, memoryview]:             # <<<<<<<<<<<<<<
 *         cdef char *buffer_ptr = NULL
 *         cdef int nbytes
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.get_copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;



  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":731
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def trace(self, fileno: int) -> None:             # <<<<<<<<<<<<<<
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_83trace(PyObject *__pyx_v_self, PyObject *__pyx_v_fileno); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_83trace = {"trace", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_83trace, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_83trace(PyObject *__pyx_v_self, PyObject *__pyx_v_fileno) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("trace (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fileno), (&PyLong_Type), 0, "fileno", 2))) __PYX_ERR(1, 731, __pyx_L1_error)
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_82trace(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((PyObject*)__pyx_v_fileno));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_82trace(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_fileno) {
  FILE *__pyx_v_stream;
  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_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trace", 0);

  /* "psycopg_binary/pq/pgconn.pyx":732
 * 
 *     def trace(self, fileno: int) -> None:
 *         if sys.platform != "linux":             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_CompareBoolNe_object_str(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux, Py_NE); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":733
 *     def trace(self, fileno: int) -> None:
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")             # <<<<<<<<<<<<<<
 *         stream = fdopen(fileno, b"w")
 *         with cython.critical_section(self):
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NotSupportedError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 733, __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_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_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_currently_only_supported_on_Linu};
      __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_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 733, __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, 733, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":732
 * 
 *     def trace(self, fileno: int) -> None:
 *         if sys.platform != "linux":             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":734
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             libpq.PQtrace(self._pgconn_ptr, stream)
*/
  __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_fileno); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 734, __pyx_L1_error)
  __pyx_v_stream = fdopen(__pyx_t_7, __pyx_k_w);


  /* "psycopg_binary/pq/pgconn.pyx":735
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQtrace(self._pgconn_ptr, stream)
 * 
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":736
 *         stream = fdopen(fileno, b"w")
 *         with cython.critical_section(self):
 *             libpq.PQtrace(self._pgconn_ptr, stream)             # <<<<<<<<<<<<<<
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:
*/
        PQtrace(__pyx_v_self->_pgconn_ptr, __pyx_v_stream);
      }

      /* "psycopg_binary/pq/pgconn.pyx":735
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQtrace(self._pgconn_ptr, stream)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":731
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def trace(self, fileno: int) -> None:             # <<<<<<<<<<<<<<
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")
*/

  /* 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("psycopg_binary.pq.PGconn.trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":738
 *             libpq.PQtrace(self._pgconn_ptr, stream)
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = flags
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_85set_trace_flags(PyObject *__pyx_v_self, PyObject *__pyx_v_flags); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_85set_trace_flags = {"set_trace_flags", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_85set_trace_flags, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_85set_trace_flags(PyObject *__pyx_v_self, PyObject *__pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_trace_flags (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_84set_trace_flags(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((PyObject *)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_84set_trace_flags(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_flags) {
  int __pyx_v_f;
  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("set_trace_flags", 0);

  /* "psycopg_binary/pq/pgconn.pyx":739
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:
 *         _check_supported("PQsetTraceFlags", 140000)             # <<<<<<<<<<<<<<
 *         cdef int f = flags
 *         with cython.critical_section(self):
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQsetTraceFlags, 0x222E0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":740
 *     def set_trace_flags(self, flags: Trace) -> None:
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = flags             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
*/
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_flags); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 740, __pyx_L1_error)
  __pyx_v_f = __pyx_t_2;

  /* "psycopg_binary/pq/pgconn.pyx":741
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = flags
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
 * 
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":742
 *         cdef int f = flags
 *         with cython.critical_section(self):
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)             # <<<<<<<<<<<<<<
 * 
 *     def untrace(self) -> None:
*/
        PQsetTraceFlags(__pyx_v_self->_pgconn_ptr, __pyx_v_f);
      }

      /* "psycopg_binary/pq/pgconn.pyx":741
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = flags
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":738
 *             libpq.PQtrace(self._pgconn_ptr, stream)
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = flags
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.set_trace_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":744
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
 * 
 *     def untrace(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             libpq.PQuntrace(self._pgconn_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_87untrace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_87untrace = {"untrace", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_87untrace, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_87untrace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("untrace (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_86untrace(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_86untrace(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("untrace", 0);

  /* "psycopg_binary/pq/pgconn.pyx":745
 * 
 *     def untrace(self) -> None:
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQuntrace(self._pgconn_ptr)
 * 
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":746
 *     def untrace(self) -> None:
 *         with cython.critical_section(self):
 *             libpq.PQuntrace(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def encrypt_password(
*/
        PQuntrace(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":745
 * 
 *     def untrace(self) -> None:
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQuntrace(self._pgconn_ptr)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":744
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
 * 
 *     def untrace(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             libpq.PQuntrace(self._pgconn_ptr)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":748
 *             libpq.PQuntrace(self._pgconn_ptr)
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_89encrypt_password(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_6PGconn_89encrypt_password = {"encrypt_password", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_89encrypt_password, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_89encrypt_password(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_passwd;
  char const *__pyx_v_user;
  PyObject *__pyx_v_algorithm = 0;
  #if !CYTHON_VECTORCALL
  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("encrypt_password (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_passwd,&__pyx_mstate_global->__pyx_n_u_user,&__pyx_mstate_global->__pyx_n_u_algorithm,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, 748, __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, 748, __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, 748, __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, 748, __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, "encrypt_password", 0) < (0)) __PYX_ERR(1, 748, __pyx_L3_error)

      /* "psycopg_binary/pq/pgconn.pyx":749
 * 
 *     def encrypt_password(
 *         self, const char *passwd, const char *user, algorithm = None             # <<<<<<<<<<<<<<
 *     ) -> bytes:
 *         _check_supported("PQencryptPasswordConn", 100000)
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("encrypt_password", 0, 2, 3, i); __PYX_ERR(1, 748, __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(1, 748, __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, 748, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 748, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_passwd = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_passwd) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L3_error)
    __pyx_v_user = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_user) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L3_error)
    __pyx_v_algorithm = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("encrypt_password", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 748, __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("psycopg_binary.pq.PGconn.encrypt_password", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_88encrypt_password(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), __pyx_v_passwd, __pyx_v_user, __pyx_v_algorithm);

  /* "psycopg_binary/pq/pgconn.pyx":748
 *             libpq.PQuntrace(self._pgconn_ptr)
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
*/

  /* 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_14psycopg_binary_2pq_6PGconn_88encrypt_password(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_passwd, char const *__pyx_v_user, PyObject *__pyx_v_algorithm) {
  char *__pyx_v_out;
  char const *__pyx_v_calgo;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  char const *__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encrypt_password", 0);

  /* "psycopg_binary/pq/pgconn.pyx":751
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
 *         _check_supported("PQencryptPasswordConn", 100000)             # <<<<<<<<<<<<<<
 * 
 *         cdef char *out
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQencryptPasswordConn, 0x186A0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":754
 * 
 *         cdef char *out
 *         cdef const char *calgo = NULL             # <<<<<<<<<<<<<<
 *         if algorithm:
 *             calgo = algorithm
*/
  __pyx_v_calgo = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":755
 *         cdef char *out
 *         cdef const char *calgo = NULL
 *         if algorithm:             # <<<<<<<<<<<<<<
 *             calgo = algorithm
 *         with cython.critical_section(self):
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_algorithm); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 755, __pyx_L1_error)
  if (__pyx_t_2) {


    /* "psycopg_binary/pq/pgconn.pyx":756
 *         cdef const char *calgo = NULL
 *         if algorithm:
 *             calgo = algorithm             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
*/
    __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_algorithm); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
    __pyx_v_calgo = __pyx_t_3;

    /* "psycopg_binary/pq/pgconn.pyx":755
 *         cdef char *out
 *         cdef const char *calgo = NULL
 *         if algorithm:             # <<<<<<<<<<<<<<
 *             calgo = algorithm
 *         with cython.critical_section(self):
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":757
 *         if algorithm:
 *             calgo = algorithm
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":758
 *             calgo = algorithm
 *         with cython.critical_section(self):
 *             out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)             # <<<<<<<<<<<<<<
 *         if not out:
 *             raise e.OperationalError(
*/
        __pyx_v_out = PQencryptPasswordConn(__pyx_v_self->_pgconn_ptr, __pyx_v_passwd, __pyx_v_user, __pyx_v_calgo);
      }

      /* "psycopg_binary/pq/pgconn.pyx":757
 *         if algorithm:
 *             calgo = algorithm
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":759
 *         with cython.critical_section(self):
 *             out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (!(__pyx_v_out != 0));

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":760
 *             out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"password encryption failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":761
 *         if not out:
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_password_encryption_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 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_8 = 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_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;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 760, __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, 760, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":759
 *         with cython.critical_section(self):
 *             out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":764
 *             )
 * 
 *         rv = bytes(out)             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
*/
  __pyx_t_6 = NULL;
  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_out); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__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(1, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":765
 * 
 *         rv = bytes(out)
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQfreemem(__pyx_v_out);

  /* "psycopg_binary/pq/pgconn.pyx":766
 *         rv = bytes(out)
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def change_password(
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":748
 *             libpq.PQuntrace(self._pgconn_ptr)
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
*/

  /* 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_AddTraceback("psycopg_binary.pq.PGconn.encrypt_password", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":768
 *         return rv
 * 
 *     def change_password(             # <<<<<<<<<<<<<<
 *         self, const char *user, const char *passwd
 *     ) -> None:
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_91change_password(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_6PGconn_91change_password = {"change_password", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_91change_password, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_91change_password(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_user;
  char const *__pyx_v_passwd;
  #if !CYTHON_VECTORCALL
  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("change_password (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_user,&__pyx_mstate_global->__pyx_n_u_passwd,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, 768, __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(1, 768, __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, 768, __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, "change_password", 0) < (0)) __PYX_ERR(1, 768, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("change_password", 1, 2, 2, i); __PYX_ERR(1, 768, __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(1, 768, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 768, __pyx_L3_error)
    }
    __pyx_v_user = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_user) && PyErr_Occurred())) __PYX_ERR(1, 769, __pyx_L3_error)
    __pyx_v_passwd = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_passwd) && PyErr_Occurred())) __PYX_ERR(1, 769, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("change_password", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 768, __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("psycopg_binary.pq.PGconn.change_password", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_90change_password(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), __pyx_v_user, __pyx_v_passwd);

  /* 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_14psycopg_binary_2pq_6PGconn_90change_password(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, char const *__pyx_v_user, char const *__pyx_v_passwd) {
  PGresult *__pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_password", 0);

  /* "psycopg_binary/pq/pgconn.pyx":771
 *         self, const char *user, const char *passwd
 *     ) -> None:
 *         _check_supported("PQchangePassword", 170000)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.PGresult *res
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQchangePassword, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":774
 * 
 *         cdef libpq.PGresult *res
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":775
 *         cdef libpq.PGresult *res
 *         with cython.critical_section(self):
 *             res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)             # <<<<<<<<<<<<<<
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:
 *             raise e.OperationalError(
*/
        __pyx_v_res = PQchangePassword(__pyx_v_self->_pgconn_ptr, __pyx_v_user, __pyx_v_passwd);
      }

      /* "psycopg_binary/pq/pgconn.pyx":774
 * 
 *         cdef libpq.PGresult *res
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":776
 *         with cython.critical_section(self):
 *             res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"
*/
  __pyx_t_1 = __Pyx_PyLong_From_ExecStatusType(PQresultStatus(__pyx_v_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExecStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_COMMAND_OK); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_CompareBoolNe_object_object(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 776, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_4)) {


    /* "psycopg_binary/pq/pgconn.pyx":777
 *             res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"password encryption failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":778
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 778, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_password_encryption_failed, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 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_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
      __pyx_t_3 = __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_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(1, 777, __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, 777, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":776
 *         with cython.critical_section(self):
 *             res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":768
 *         return rv
 * 
 *     def change_password(             # <<<<<<<<<<<<<<
 *         self, const char *user, const char *passwd
 *     ) -> None:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.change_password", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":781
 *             )
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):
*/

/* Python wrapper */
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_93make_empty_result(PyObject *__pyx_v_self, PyObject *__pyx_arg_exec_status); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_93make_empty_result = {"make_empty_result", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_93make_empty_result, METH_O, 0};
static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pw_14psycopg_binary_2pq_6PGconn_93make_empty_result(PyObject *__pyx_v_self, PyObject *__pyx_arg_exec_status) {
  int __pyx_v_exec_status;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_empty_result (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_exec_status); {
    __pyx_v_exec_status = __Pyx_PyLong_As_int(__pyx_arg_exec_status); if (unlikely((__pyx_v_exec_status == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 781, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.make_empty_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_92make_empty_result(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((int)__pyx_v_exec_status));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_pf_14psycopg_binary_2pq_6PGconn_92make_empty_result(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, int __pyx_v_exec_status) {
  PGresult *__pyx_v_rv;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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("make_empty_result", 0);

  /* "psycopg_binary/pq/pgconn.pyx":783
 *     def make_empty_result(self, int exec_status) -> PGresult:
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQmakeEmptyPGresult(
 *                 self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":784
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQmakeEmptyPGresult(             # <<<<<<<<<<<<<<
 *                 self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 *         if not rv:
*/
        __pyx_v_rv = PQmakeEmptyPGresult(__pyx_v_self->_pgconn_ptr, ((ExecStatusType)__pyx_v_exec_status));
      }

      /* "psycopg_binary/pq/pgconn.pyx":783
 *     def make_empty_result(self, int exec_status) -> PGresult:
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQmakeEmptyPGresult(
 *                 self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":786
 *             rv = libpq.PQmakeEmptyPGresult(
 *                 self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate empty PGresult")
 *         return PGresult._from_ptr(rv)
*/
  __pyx_t_2 = (!(__pyx_v_rv != 0));

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":787
 *                 self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 *         if not rv:
 *             raise MemoryError("couldn't allocate empty PGresult")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(rv)
 * 
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_empty_PGresult};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __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;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 787, __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, 787, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":786
 *             rv = libpq.PQmakeEmptyPGresult(
 *                 self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate empty PGresult")
 *         return PGresult._from_ptr(rv)
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":788
 *         if not rv:
 *             raise MemoryError("couldn't allocate empty PGresult")
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_1);
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":781
 *             )
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.make_empty_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":790
 *         return PGresult._from_ptr(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pipeline_status(self) -> int:
 *         """The current pipeline mode status.
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_15pipeline_status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_15pipeline_status_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_14psycopg_binary_2pq_6PGconn_15pipeline_status___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_15pipeline_status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PGpipelineStatus __pyx_v_rv;
  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__", 0);

  /* "psycopg_binary/pq/pgconn.pyx":796
 *         For libpq < 14.0, always return 0 (PQ_PIPELINE_OFF).
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef libpq.PGpipelineStatus rv
*/
  __pyx_t_1 = (PG_VERSION_NUM < 0x222E0);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":797
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:
 *             return libpq.PQ_PIPELINE_OFF             # <<<<<<<<<<<<<<
 *         cdef libpq.PGpipelineStatus rv
 *         with cython.critical_section(self):
*/
    __pyx_t_2 = __Pyx_PyLong_From_PGpipelineStatus(PQ_PIPELINE_OFF); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgconn.pyx":796
 *         For libpq < 14.0, always return 0 (PQ_PIPELINE_OFF).
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef libpq.PGpipelineStatus rv
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":799
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef libpq.PGpipelineStatus rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQpipelineStatus(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":800
 *         cdef libpq.PGpipelineStatus rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQpipelineStatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
        __pyx_v_rv = PQpipelineStatus(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":799
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef libpq.PGpipelineStatus rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQpipelineStatus(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":801
 *         with cython.critical_section(self):
 *             rv = libpq.PQpipelineStatus(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def enter_pipeline_mode(self) -> None:
*/
  __pyx_t_2 = __Pyx_PyLong_From_PGpipelineStatus(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":790
 *         return PGresult._from_ptr(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pipeline_status(self) -> int:
 *         """The current pipeline mode status.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.pipeline_status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":803
 *         return rv
 * 
 *     def enter_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enter pipeline mode.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_95enter_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_14psycopg_binary_2pq_6PGconn_94enter_pipeline_mode, "Enter pipeline mode.\n\n        :raises ~e.OperationalError: in case of failure to enter the pipeline\n            mode.\n        ");
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_95enter_pipeline_mode = {"enter_pipeline_mode", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_95enter_pipeline_mode, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_6PGconn_94enter_pipeline_mode};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_95enter_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enter_pipeline_mode (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_94enter_pipeline_mode(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_94enter_pipeline_mode(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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_pipeline_mode", 0);

  /* "psycopg_binary/pq/pgconn.pyx":809
 *             mode.
 *         """
 *         _check_supported("PQenterPipelineMode", 140000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQenterPipelineMode, 0x222E0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":811
 *         _check_supported("PQenterPipelineMode", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)
 *         if rv != 1:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":812
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv != 1:
 *             raise e.OperationalError("failed to enter pipeline mode")
*/
        __pyx_v_rv = PQenterPipelineMode(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":811
 *         _check_supported("PQenterPipelineMode", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)
 *         if rv != 1:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":813
 *         with cython.critical_section(self):
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
*/
  __pyx_t_2 = (__pyx_v_rv != 1);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":814
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)
 *         if rv != 1:
 *             raise e.OperationalError("failed to enter pipeline mode")             # <<<<<<<<<<<<<<
 * 
 *     def exit_pipeline_mode(self) -> None:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 814, __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_failed_to_enter_pipeline_mode};
      __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(1, 814, __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, 814, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":813
 *         with cython.critical_section(self):
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":803
 *         return rv
 * 
 *     def enter_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enter pipeline mode.
 * 
*/

  /* 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("psycopg_binary.pq.PGconn.enter_pipeline_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":816
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
 *     def exit_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Exit pipeline mode.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_97exit_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_14psycopg_binary_2pq_6PGconn_96exit_pipeline_mode, "Exit pipeline mode.\n\n        :raises ~e.OperationalError: in case of failure to exit the pipeline\n            mode.\n        ");
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_97exit_pipeline_mode = {"exit_pipeline_mode", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_97exit_pipeline_mode, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_6PGconn_96exit_pipeline_mode};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_97exit_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exit_pipeline_mode (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_96exit_pipeline_mode(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_96exit_pipeline_mode(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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_pipeline_mode", 0);

  /* "psycopg_binary/pq/pgconn.pyx":822
 *             mode.
 *         """
 *         _check_supported("PQexitPipelineMode", 140000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQexitPipelineMode, 0x222E0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":824
 *         _check_supported("PQexitPipelineMode", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)
 *         if rv != 1:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":825
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv != 1:
 *             raise e.OperationalError(self.get_error_message())
*/
        __pyx_v_rv = PQexitPipelineMode(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":824
 *         _check_supported("PQexitPipelineMode", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)
 *         if rv != 1:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":826
 *         with cython.critical_section(self):
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(self.get_error_message())
 * 
*/
  __pyx_t_2 = (__pyx_v_rv != 1);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":827
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)
 *         if rv != 1:
 *             raise e.OperationalError(self.get_error_message())             # <<<<<<<<<<<<<<
 * 
 *     def pipeline_sync(self) -> None:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__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(1, 827, __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_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_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_1)) __PYX_ERR(1, 827, __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, 827, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":826
 *         with cython.critical_section(self):
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(self.get_error_message())
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":816
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
 *     def exit_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Exit pipeline mode.
 * 
*/

  /* 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("psycopg_binary.pq.PGconn.exit_pipeline_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":829
 *             raise e.OperationalError(self.get_error_message())
 * 
 *     def pipeline_sync(self) -> None:             # <<<<<<<<<<<<<<
 *         """Mark a synchronization point in a pipeline.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_99pipeline_sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_14psycopg_binary_2pq_6PGconn_98pipeline_sync, "Mark a synchronization point in a pipeline.\n\n        :raises ~e.OperationalError: if the connection is not in pipeline mode\n            or if sync failed.\n        ");
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_99pipeline_sync = {"pipeline_sync", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_99pipeline_sync, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_6PGconn_98pipeline_sync};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_99pipeline_sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pipeline_sync (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_98pipeline_sync(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_98pipeline_sync(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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("pipeline_sync", 0);

  /* "psycopg_binary/pq/pgconn.pyx":835
 *             or if sync failed.
 *         """
 *         _check_supported("PQpipelineSync", 140000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQpipelineSync, 0x222E0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":837
 *         _check_supported("PQpipelineSync", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":838
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQpipelineSync(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv == 0:
 *             raise e.OperationalError("connection not in pipeline mode")
*/
        __pyx_v_rv = PQpipelineSync(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":837
 *         _check_supported("PQpipelineSync", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":839
 *         with cython.critical_section(self):
 *             rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:
*/
  __pyx_t_2 = (__pyx_v_rv == 0);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":840
 *             rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:
 *             raise e.OperationalError("connection not in pipeline mode")             # <<<<<<<<<<<<<<
 *         if rv != 1:
 *             raise e.OperationalError("failed to sync pipeline")
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 840, __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_connection_not_in_pipeline_mode};
      __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(1, 840, __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, 840, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":839
 *         with cython.critical_section(self):
 *             rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":841
 *         if rv == 0:
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to sync pipeline")
 * 
*/
  __pyx_t_2 = (__pyx_v_rv != 1);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":842
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:
 *             raise e.OperationalError("failed to sync pipeline")             # <<<<<<<<<<<<<<
 * 
 *     def send_flush_request(self) -> None:
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __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_failed_to_sync_pipeline};
      __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(1, 842, __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, 842, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":841
 *         if rv == 0:
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to sync pipeline")
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":829
 *             raise e.OperationalError(self.get_error_message())
 * 
 *     def pipeline_sync(self) -> None:             # <<<<<<<<<<<<<<
 *         """Mark a synchronization point in a pipeline.
 * 
*/

  /* 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("psycopg_binary.pq.PGconn.pipeline_sync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":844
 *             raise e.OperationalError("failed to sync pipeline")
 * 
 *     def send_flush_request(self) -> None:             # <<<<<<<<<<<<<<
 *         """Sends a request for the server to flush its output buffer.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_101send_flush_request(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_14psycopg_binary_2pq_6PGconn_100send_flush_request, "Sends a request for the server to flush its output buffer.\n\n        :raises ~e.OperationalError: if the flush request failed.\n        ");
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_101send_flush_request = {"send_flush_request", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_101send_flush_request, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_6PGconn_100send_flush_request};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_101send_flush_request(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_flush_request (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_100send_flush_request(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_100send_flush_request(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  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("send_flush_request", 0);

  /* "psycopg_binary/pq/pgconn.pyx":849
 *         :raises ~e.OperationalError: if the flush request failed.
 *         """
 *         _check_supported("PQsendFlushRequest ", 140000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq__check_supported(__pyx_mstate_global->__pyx_kp_u_PQsendFlushRequest, 0x222E0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":851
 *         _check_supported("PQsendFlushRequest ", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":852
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQsendFlushRequest(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv == 0:
 *             raise e.OperationalError(
*/
        __pyx_v_rv = PQsendFlushRequest(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_binary/pq/pgconn.pyx":851
 *         _check_supported("PQsendFlushRequest ", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":853
 *         with cython.critical_section(self):
 *             rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"flush request failed: {self.get_error_message()}")
*/
  __pyx_t_2 = (__pyx_v_rv == 0);

  if (unlikely(__pyx_t_2)) {


    /* "psycopg_binary/pq/pgconn.pyx":854
 *             rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"flush request failed: {self.get_error_message()}")
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":855
 *         if rv == 0:
 *             raise e.OperationalError(
 *                 f"flush request failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__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(1, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_flush_request_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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_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_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_1)) __PYX_ERR(1, 854, __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, 854, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":853
 *         with cython.critical_section(self):
 *             rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"flush request failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":844
 *             raise e.OperationalError("failed to sync pipeline")
 * 
 *     def send_flush_request(self) -> None:             # <<<<<<<<<<<<<<
 *         """Sends a request for the server to flush its output 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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_binary.pq.PGconn.send_flush_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq.pxd":27
 *     cdef libpq.PGconn* _pgconn_ptr
 *     cdef object __weakref__
 *     cdef public object notice_handler             # <<<<<<<<<<<<<<
 *     cdef public object notify_handler
 *     cdef pid_t _procpid
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_14notice_handler_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_14notice_handler_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_14psycopg_binary_2pq_6PGconn_14notice_handler___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_14notice_handler___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        {
          PyObject *__pyx_temp;
          {
            __pyx_temp = __pyx_r;
            __Pyx_INCREF(__pyx_v_self->notice_handler);
            __pyx_r = __pyx_v_self->notice_handler;
          }
          __Pyx_XDECREF(__pyx_temp);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L3_return;
      }
      /*finally:*/ {
        __pyx_L3_return: {
          __pyx_t_2 = __pyx_r;
          __pyx_r = 0;
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          __pyx_r = __pyx_t_2;
          __pyx_t_2 = 0;
          goto __pyx_L0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_14notice_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_14notice_handler_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_14psycopg_binary_2pq_6PGconn_14notice_handler_2__set__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_6PGconn_14notice_handler_2__set__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        __Pyx_GOTREF(__pyx_v_self->notice_handler);
        __Pyx_DECREF(__pyx_v_self->notice_handler);
        __pyx_v_self->notice_handler = __pyx_v_value;
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* function exit code */
  __pyx_r = 0;

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_14notice_handler_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_14notice_handler_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_14notice_handler_4__del__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_6PGconn_14notice_handler_4__del__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__del__", 0);
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_v_self->notice_handler);
        __Pyx_DECREF(__pyx_v_self->notice_handler);
        __pyx_v_self->notice_handler = Py_None;
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* function exit code */
  __pyx_r = 0;

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq.pxd":28
 *     cdef object __weakref__
 *     cdef public object notice_handler
 *     cdef public object notify_handler             # <<<<<<<<<<<<<<
 *     cdef pid_t _procpid
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_14notify_handler_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_14notify_handler_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_14psycopg_binary_2pq_6PGconn_14notify_handler___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_14notify_handler___get__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        {
          PyObject *__pyx_temp;
          {
            __pyx_temp = __pyx_r;
            __Pyx_INCREF(__pyx_v_self->notify_handler);
            __pyx_r = __pyx_v_self->notify_handler;
          }
          __Pyx_XDECREF(__pyx_temp);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L3_return;
      }
      /*finally:*/ {
        __pyx_L3_return: {
          __pyx_t_2 = __pyx_r;
          __pyx_r = 0;
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          __pyx_r = __pyx_t_2;
          __pyx_t_2 = 0;
          goto __pyx_L0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_14notify_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_14notify_handler_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_14psycopg_binary_2pq_6PGconn_14notify_handler_2__set__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_6PGconn_14notify_handler_2__set__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        __Pyx_GOTREF(__pyx_v_self->notify_handler);
        __Pyx_DECREF(__pyx_v_self->notify_handler);
        __pyx_v_self->notify_handler = __pyx_v_value;
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* function exit code */
  __pyx_r = 0;

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_14notify_handler_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_6PGconn_14notify_handler_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_14notify_handler_4__del__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_6PGconn_14notify_handler_4__del__(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__del__", 0);
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_v_self->notify_handler);
        __Pyx_DECREF(__pyx_v_self->notify_handler);
        __pyx_v_self->notify_handler = Py_None;
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* function exit code */
  __pyx_r = 0;

  __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_14psycopg_binary_2pq_6PGconn_103__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_103__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_103__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_103__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_102__reduce_cython__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_102__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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(2, 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("psycopg_binary.pq.PGconn.__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_14psycopg_binary_2pq_6PGconn_105__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_6PGconn_105__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_105__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_6PGconn_105__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_6PGconn_104__setstate_cython__(((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_6PGconn_104__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGconn *__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(2, 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("psycopg_binary.pq.PGconn.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":858
 * 
 * 
 * cdef void *_call_libpq_with_param(             # <<<<<<<<<<<<<<
 *     PGconn self,
 *     conn_f_with_param func,
*/

static void *__pyx_f_14psycopg_binary_2pq__call_libpq_with_param(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, __pyx_t_14psycopg_binary_2pq_conn_f_with_param __pyx_v_func, char const *__pyx_v_param) {
  void *__pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  void *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_libpq_with_param", 0);

  /* "psycopg_binary/pq/pgconn.pyx":863
 *     const char *param
 * ):
 *     cdef void *rv = NULL             # <<<<<<<<<<<<<<
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
*/
  __pyx_v_rv = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":865
 *     cdef void *rv = NULL
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":866
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":867
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)             # <<<<<<<<<<<<<<
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = __pyx_v_func(__pyx_v_pgconn_ptr, __pyx_v_param);

          /* "psycopg_binary/pq/pgconn.pyx":866
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":865
 *     cdef void *rv = NULL
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":868
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":869
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *     return rv
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 869, __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_the_connection_is_closed};
      __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(1, 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(1, 869, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":868
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":870
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
 *     return rv             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {

    __pyx_r = __pyx_v_rv;
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":858
 * 
 * 
 * cdef void *_call_libpq_with_param(             # <<<<<<<<<<<<<<
 *     PGconn self,
 *     conn_f_with_param func,
*/

  /* 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_AddTraceback("psycopg_binary.pq._call_libpq_with_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;



  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":873
 * 
 * 
 * cdef int _call_libpq_int(PGconn self, conn_int_f func):             # <<<<<<<<<<<<<<
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
*/

static int __pyx_f_14psycopg_binary_2pq__call_libpq_int(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, __pyx_t_14psycopg_binary_2pq_conn_int_f __pyx_v_func) {
  int __pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_libpq_int", 0);

  /* "psycopg_binary/pq/pgconn.pyx":876
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":877
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":878
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)             # <<<<<<<<<<<<<<
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = __pyx_v_func(__pyx_v_pgconn_ptr);

          /* "psycopg_binary/pq/pgconn.pyx":877
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":876
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":879
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":880
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *     return rv
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 880, __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_the_connection_is_closed};
      __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(1, 880, __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, 880, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":879
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":881
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
 *     return rv             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {

    __pyx_r = __pyx_v_rv;
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":873
 * 
 * 
 * cdef int _call_libpq_int(PGconn self, conn_int_f func):             # <<<<<<<<<<<<<<
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
*/

  /* 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_AddTraceback("psycopg_binary.pq._call_libpq_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;



  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":884
 * 
 * 
 * cdef int _call_libpq_int_with_param(             # <<<<<<<<<<<<<<
 *     PGconn self,
 *     conn_int_f_with_param func,
*/

static int __pyx_f_14psycopg_binary_2pq__call_libpq_int_with_param(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, __pyx_t_14psycopg_binary_2pq_conn_int_f_with_param __pyx_v_func, char const *__pyx_v_param) {
  int __pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_libpq_int_with_param", 0);

  /* "psycopg_binary/pq/pgconn.pyx":891
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":892
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":893
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)             # <<<<<<<<<<<<<<
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = __pyx_v_func(__pyx_v_pgconn_ptr, __pyx_v_param);

          /* "psycopg_binary/pq/pgconn.pyx":892
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":891
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":894
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":895
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *     return rv
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 895, __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_the_connection_is_closed};
      __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(1, 895, __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, 895, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":894
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":896
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
 *     return rv             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {

    __pyx_r = __pyx_v_rv;
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":884
 * 
 * 
 * cdef int _call_libpq_int_with_param(             # <<<<<<<<<<<<<<
 *     PGconn self,
 *     conn_int_f_with_param func,
*/

  /* 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_AddTraceback("psycopg_binary.pq._call_libpq_int_with_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;



  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":899
 * 
 * 
 * cdef bytes _call_libpq_bytes(PGconn self, conn_bytes_f func):             # <<<<<<<<<<<<<<
 *     cdef char *rv
 *     cdef libpq.PGconn *pgconn_ptr
*/

static PyObject *__pyx_f_14psycopg_binary_2pq__call_libpq_bytes(struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_self, __pyx_t_14psycopg_binary_2pq_conn_bytes_f __pyx_v_func) {
  char *__pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_libpq_bytes", 0);

  /* "psycopg_binary/pq/pgconn.pyx":902
 *     cdef char *rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":903
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;

        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);


        if (__pyx_t_3) {


          /* "psycopg_binary/pq/pgconn.pyx":904
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)             # <<<<<<<<<<<<<<
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = __pyx_v_func(__pyx_v_pgconn_ptr);

          /* "psycopg_binary/pq/pgconn.pyx":903
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_binary/pq/pgconn.pyx":902
 *     cdef char *rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_binary/pq/pgconn.pyx":905
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     if rv is not NULL:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_3)) {


    /* "psycopg_binary/pq/pgconn.pyx":906
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *     if rv is not NULL:
 *         return rv
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 906, __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_the_connection_is_closed};
      __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(1, 906, __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, 906, __pyx_L1_error)

    /* "psycopg_binary/pq/pgconn.pyx":905
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     if rv is not NULL:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":907
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
 *     if rv is not NULL:             # <<<<<<<<<<<<<<
 *         return rv
 *     return b""
*/
  __pyx_t_3 = (__pyx_v_rv != NULL);

  if (__pyx_t_3) {


    /* "psycopg_binary/pq/pgconn.pyx":908
 *         raise e.OperationalError("the connection is closed")
 *     if rv is not NULL:
 *         return rv             # <<<<<<<<<<<<<<
 *     return b""
 * 
*/
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((PyObject*)__pyx_t_1);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgconn.pyx":907
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
 *     if rv is not NULL:             # <<<<<<<<<<<<<<
 *         return rv
 *     return b""
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":909
 *     if rv is not NULL:
 *         return rv
 *     return b""             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
      __pyx_r = __pyx_mstate_global->__pyx_kp_b__6;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":899
 * 
 * 
 * cdef bytes _call_libpq_bytes(PGconn self, conn_bytes_f func):             # <<<<<<<<<<<<<<
 *     cdef char *rv
 *     cdef libpq.PGconn *pgconn_ptr
*/

  /* 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_AddTraceback("psycopg_binary.pq._call_libpq_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":912
 * 
 * 
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:
*/

static void __pyx_f_14psycopg_binary_2pq_notice_receiver(void *__pyx_v_arg, PGresult const *__pyx_v_res_ptr) {
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_pgconn = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_res = 0;
  PyObject *__pyx_v_e = 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;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("notice_receiver", 0);



  /* "psycopg_binary/pq/pgconn.pyx":913
 * 
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) noexcept with gil:
 *     cdef PGconn pgconn = <object>arg             # <<<<<<<<<<<<<<
 *     if pgconn.notice_handler is None:
 *         return
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_arg);
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn))))) __PYX_ERR(1, 913, __pyx_L1_error)
  __pyx_v_pgconn = ((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":914
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) noexcept with gil:
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:             # <<<<<<<<<<<<<<
 *         return
 * 
*/
  __pyx_t_2 = (__pyx_v_pgconn->notice_handler == Py_None);
  if (__pyx_t_2) {


    /* "psycopg_binary/pq/pgconn.pyx":915
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
*/
    {
    }
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgconn.pyx":914
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) noexcept with gil:
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:             # <<<<<<<<<<<<<<
 *         return
 * 
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":917
 *         return
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)             # <<<<<<<<<<<<<<
 *     try:
 *         pgconn.notice_handler(res)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(((PGresult *)__pyx_v_res_ptr))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":918
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
 *     try:             # <<<<<<<<<<<<<<
 *         pgconn.notice_handler(res)
 *     except Exception as e:
*/
  /*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:*/ {

        /* "psycopg_binary/pq/pgconn.pyx":919
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
 *     try:
 *         pgconn.notice_handler(res)             # <<<<<<<<<<<<<<
 *     except Exception as e:
 *         logger.exception("error in notice receiver: %s", e)
*/
        __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_pgconn->notice_handler);
        __pyx_t_7 = __pyx_v_pgconn->notice_handler; 
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          assert(__pyx_t_6);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_res)};
          __pyx_t_1 = __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_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 919, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "psycopg_binary/pq/pgconn.pyx":918
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
 *     try:             # <<<<<<<<<<<<<<
 *         pgconn.notice_handler(res)
 *     except Exception as e:
*/
      }
      __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;
      goto __pyx_L12_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "psycopg_binary/pq/pgconn.pyx":920
 *     try:
 *         pgconn.notice_handler(res)
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *         logger.exception("error in notice receiver: %s", e)
 *     finally:
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("psycopg_binary.pq.notice_receiver", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 920, __pyx_L9_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_v_e = __pyx_t_7;
        /*try:*/ {

          /* "psycopg_binary/pq/pgconn.pyx":921
 *         pgconn.notice_handler(res)
 *     except Exception as e:
 *         logger.exception("error in notice receiver: %s", e)             # <<<<<<<<<<<<<<
 *     finally:
 *         res._pgresult_ptr = NULL  # avoid destroying the pgresult_ptr
*/
          __pyx_t_11 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 921, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_exception); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 921, __pyx_L18_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_13))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
            assert(__pyx_t_11);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
            __pyx_t_8 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_error_in_notice_receiver_s, __pyx_v_e};
            __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 921, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }

        /* "psycopg_binary/pq/pgconn.pyx":920
 *     try:
 *         pgconn.notice_handler(res)
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *         logger.exception("error in notice receiver: %s", e)
 *     finally:
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 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_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_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_9 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 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_9; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
            goto __pyx_L9_except_error;
          }
          __pyx_L19:;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L8_exception_handled;
      }
      goto __pyx_L9_except_error;

      /* "psycopg_binary/pq/pgconn.pyx":918
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
 *     try:             # <<<<<<<<<<<<<<
 *         pgconn.notice_handler(res)
 *     except Exception as e:
*/
      __pyx_L9_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_L5_error;
      __pyx_L8_exception_handled:;
      __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);
      __pyx_L12_try_end:;
    }
  }

  /* "psycopg_binary/pq/pgconn.pyx":923
 *         logger.exception("error in notice receiver: %s", e)
 *     finally:
 *         res._pgresult_ptr = NULL  # avoid destroying the pgresult_ptr             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_v_res->_pgresult_ptr = NULL;
      goto __pyx_L6;
    }
    __pyx_L5_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 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_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
      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_21);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __pyx_t_14 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
      {
        __pyx_v_res->_pgresult_ptr = NULL;
      }
      __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_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_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_15;
      goto __pyx_L1_error;
    }
    __pyx_L6:;
  }

  /* "psycopg_binary/pq/pgconn.pyx":912
 * 
 * 
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) noexcept with gil:             # <<<<<<<<<<<<<<
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:
*/

  /* function exit code */
  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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_WriteUnraisable("psycopg_binary.pq.notice_receiver", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pgconn);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_e);



  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
}

/* "psycopg_binary/pq/pgconn.pyx":926
 * 
 * 
 * cdef (Py_ssize_t, libpq.Oid *, char * const*, int *, int *) _query_params_args(             # <<<<<<<<<<<<<<
 *     param_values: Sequence[bytes | None] | None,
 *     param_types: Sequence[int] | None,
*/

static __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_f_14psycopg_binary_2pq__query_params_args(PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_types, PyObject *__pyx_v_param_formats) {
  int __pyx_v_i;
  PyObject *__pyx_v_values_fast = 0;
  PyObject *__pyx_v_types_fast = 0;
  PyObject *__pyx_v_formats_fast = 0;
  Py_ssize_t __pyx_v_nparams;
  char **__pyx_v_aparams;
  int *__pyx_v_alenghts;
  char *__pyx_v_ptr;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_obj;
  Oid *__pyx_v_atypes;
  int *__pyx_v_aformats;
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[5];
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13;
  Oid __pyx_t_14;
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_query_params_args", 0);

  /* "psycopg_binary/pq/pgconn.pyx":937
 *     cdef formats_fast
 * 
 *     cdef Py_ssize_t nparams = 0             # <<<<<<<<<<<<<<
 *     if param_values is not None:
 *         values_fast = PySequence_Fast(param_values, "'param_values' is not a sequence")
*/
  __pyx_v_nparams = 0;

  /* "psycopg_binary/pq/pgconn.pyx":938
 * 
 *     cdef Py_ssize_t nparams = 0
 *     if param_values is not None:             # <<<<<<<<<<<<<<
 *         values_fast = PySequence_Fast(param_values, "'param_values' is not a sequence")
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)
*/
  __pyx_t_1 = (__pyx_v_param_values != Py_None);
  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":939
 *     cdef Py_ssize_t nparams = 0
 *     if param_values is not None:
 *         values_fast = PySequence_Fast(param_values, "'param_values' is not a sequence")             # <<<<<<<<<<<<<<
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)
 * 
*/
    __pyx_t_2 = PySequence_Fast(__pyx_v_param_values, ((char *)"\047param_values\047 is not a sequence")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_values_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":940
 *     if param_values is not None:
 *         values_fast = PySequence_Fast(param_values, "'param_values' is not a sequence")
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)             # <<<<<<<<<<<<<<
 * 
 *     if param_types is not None:
*/
    __pyx_v_nparams = PySequence_Fast_GET_SIZE(__pyx_v_values_fast);

    /* "psycopg_binary/pq/pgconn.pyx":938
 * 
 *     cdef Py_ssize_t nparams = 0
 *     if param_values is not None:             # <<<<<<<<<<<<<<
 *         values_fast = PySequence_Fast(param_values, "'param_values' is not a sequence")
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":942
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)
 * 
 *     if param_types is not None:             # <<<<<<<<<<<<<<
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:
*/
  __pyx_t_1 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":943
 * 
 *     if param_types is not None:
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")             # <<<<<<<<<<<<<<
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:
 *             raise ValueError(
*/
    __pyx_t_2 = PySequence_Fast(__pyx_v_param_types, ((char *)"\047param_types\047 is not a sequence")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_types_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":944
 *     if param_types is not None:
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_types)} param_types"
*/
    __pyx_t_1 = (PySequence_Fast_GET_SIZE(__pyx_v_types_fast) != __pyx_v_nparams);

    if (unlikely(__pyx_t_1)) {


      /* "psycopg_binary/pq/pgconn.pyx":945
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 f"got {nparams} param_values but {len(param_types)} param_types"
 *             )
*/
      __pyx_t_3 = NULL;

      /* "psycopg_binary/pq/pgconn.pyx":946
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_types)} param_types"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
      __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nparams, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_Length(__pyx_v_param_types); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 946, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_got;
      __pyx_t_7[1] = __pyx_t_4;
      __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_param_values_but;
      __pyx_t_7[3] = __pyx_t_6;
      __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_param_types_2;
      __pyx_t_5 = 34;
      #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[3]);
      #endif
      __pyx_t_8 = 0;
      __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, __pyx_t_5, __pyx_t_8);
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 945, __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, 945, __pyx_L1_error)

      /* "psycopg_binary/pq/pgconn.pyx":944
 *     if param_types is not None:
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_types)} param_types"
*/
    }

    /* "psycopg_binary/pq/pgconn.pyx":942
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)
 * 
 *     if param_types is not None:             # <<<<<<<<<<<<<<
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":949
 *             )
 * 
 *     if param_formats is not None:             # <<<<<<<<<<<<<<
 *         formats_fast = PySequence_Fast(
 *             param_formats, "'param_formats' is not a sequence")
*/
  __pyx_t_1 = (__pyx_v_param_formats != Py_None);
  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":950
 * 
 *     if param_formats is not None:
 *         formats_fast = PySequence_Fast(             # <<<<<<<<<<<<<<
 *             param_formats, "'param_formats' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(formats_fast) != nparams:
*/
    __pyx_t_2 = PySequence_Fast(__pyx_v_param_formats, ((char *)"\047param_formats\047 is not a sequence")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_formats_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_binary/pq/pgconn.pyx":952
 *         formats_fast = PySequence_Fast(
 *             param_formats, "'param_formats' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(formats_fast) != nparams:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_formats)} param_formats"
*/
    __pyx_t_1 = (PySequence_Fast_GET_SIZE(__pyx_v_formats_fast) != __pyx_v_nparams);

    if (unlikely(__pyx_t_1)) {


      /* "psycopg_binary/pq/pgconn.pyx":953
 *             param_formats, "'param_formats' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(formats_fast) != nparams:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 f"got {nparams} param_values but {len(param_formats)} param_formats"
 *             )
*/
      __pyx_t_9 = NULL;

      /* "psycopg_binary/pq/pgconn.pyx":954
 *         if PySequence_Fast_GET_SIZE(formats_fast) != nparams:
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_formats)} param_formats"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
      __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nparams, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 954, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_Length(__pyx_v_param_formats); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 954, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 954, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_got;
      __pyx_t_7[1] = __pyx_t_3;
      __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_param_values_but;
      __pyx_t_7[3] = __pyx_t_6;
      __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_param_formats_2;
      __pyx_t_5 = 36;
      #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[3]);
      #endif
      __pyx_t_8 = 0;
      __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, __pyx_t_5, __pyx_t_8);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 954, __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_10 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __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_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 953, __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, 953, __pyx_L1_error)

      /* "psycopg_binary/pq/pgconn.pyx":952
 *         formats_fast = PySequence_Fast(
 *             param_formats, "'param_formats' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(formats_fast) != nparams:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_formats)} param_formats"
*/
    }

    /* "psycopg_binary/pq/pgconn.pyx":949
 *             )
 * 
 *     if param_formats is not None:             # <<<<<<<<<<<<<<
 *         formats_fast = PySequence_Fast(
 *             param_formats, "'param_formats' is not a sequence")
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":957
 *             )
 * 
 *     cdef char **aparams = NULL             # <<<<<<<<<<<<<<
 *     cdef int *alenghts = NULL
 *     cdef char *ptr
*/
  __pyx_v_aparams = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":958
 * 
 *     cdef char **aparams = NULL
 *     cdef int *alenghts = NULL             # <<<<<<<<<<<<<<
 *     cdef char *ptr
 *     cdef Py_ssize_t length
*/
  __pyx_v_alenghts = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":962
 *     cdef Py_ssize_t length
 * 
 *     if nparams:             # <<<<<<<<<<<<<<
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
*/
  __pyx_t_1 = (__pyx_v_nparams != 0);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":963
 * 
 *     if nparams:
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))             # <<<<<<<<<<<<<<
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
 *         for i in range(nparams):
*/
    __pyx_v_aparams = ((char **)PyMem_Malloc((__pyx_v_nparams * (sizeof(char *)))));

    /* "psycopg_binary/pq/pgconn.pyx":964
 *     if nparams:
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))             # <<<<<<<<<<<<<<
 *         for i in range(nparams):
 *             obj = PySequence_Fast_GET_ITEM(values_fast, i)
*/
    __pyx_v_alenghts = ((int *)PyMem_Malloc((__pyx_v_nparams * (sizeof(int)))));

    /* "psycopg_binary/pq/pgconn.pyx":965
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
 *         for i in range(nparams):             # <<<<<<<<<<<<<<
 *             obj = PySequence_Fast_GET_ITEM(values_fast, i)
 *             if obj != <PyObject *>None:
*/

    __pyx_t_5 = __pyx_v_nparams;
    __pyx_t_11 = __pyx_t_5;

    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_11; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "psycopg_binary/pq/pgconn.pyx":966
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
 *         for i in range(nparams):
 *             obj = PySequence_Fast_GET_ITEM(values_fast, i)             # <<<<<<<<<<<<<<
 *             if obj != <PyObject *>None:
 *                 # TODO: it is a leak if this fails (but it should only fail
*/
      if (unlikely(!__pyx_v_values_fast)) { __Pyx_RaiseUnboundLocalError("values_fast"); __PYX_ERR(1, 966, __pyx_L1_error) }
      __pyx_v_obj = PySequence_Fast_GET_ITEM(__pyx_v_values_fast, __pyx_v_i);

      /* "psycopg_binary/pq/pgconn.pyx":967
 *         for i in range(nparams):
 *             obj = PySequence_Fast_GET_ITEM(values_fast, i)
 *             if obj != <PyObject *>None:             # <<<<<<<<<<<<<<
 *                 # TODO: it is a leak if this fails (but it should only fail
 *                 # on internal error, e.g. if obj is not a buffer)
*/
      __pyx_t_1 = (__pyx_v_obj != ((PyObject *)Py_None));

      if (__pyx_t_1) {


        /* "psycopg_binary/pq/pgconn.pyx":970
 *                 # TODO: it is a leak if this fails (but it should only fail
 *                 # on internal error, e.g. if obj is not a buffer)
 *                 _buffer_as_string_and_size(<object>obj, &ptr, &length)             # <<<<<<<<<<<<<<
 *                 aparams[i] = ptr
 *                 alenghts[i] = <int>length
*/
        __pyx_t_12 = __pyx_f_14psycopg_binary_2pq__buffer_as_string_and_size(((PyObject *)__pyx_v_obj), (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 970, __pyx_L1_error)


        /* "psycopg_binary/pq/pgconn.pyx":971
 *                 # on internal error, e.g. if obj is not a buffer)
 *                 _buffer_as_string_and_size(<object>obj, &ptr, &length)
 *                 aparams[i] = ptr             # <<<<<<<<<<<<<<
 *                 alenghts[i] = <int>length
 *             else:
*/
        (__pyx_v_aparams[__pyx_v_i]) = __pyx_v_ptr;

        /* "psycopg_binary/pq/pgconn.pyx":972
 *                 _buffer_as_string_and_size(<object>obj, &ptr, &length)
 *                 aparams[i] = ptr
 *                 alenghts[i] = <int>length             # <<<<<<<<<<<<<<
 *             else:
 *                 aparams[i] = NULL
*/
        (__pyx_v_alenghts[__pyx_v_i]) = ((int)__pyx_v_length);

        /* "psycopg_binary/pq/pgconn.pyx":967
 *         for i in range(nparams):
 *             obj = PySequence_Fast_GET_ITEM(values_fast, i)
 *             if obj != <PyObject *>None:             # <<<<<<<<<<<<<<
 *                 # TODO: it is a leak if this fails (but it should only fail
 *                 # on internal error, e.g. if obj is not a buffer)
*/
        goto __pyx_L11;
      }

      /* "psycopg_binary/pq/pgconn.pyx":974
 *                 alenghts[i] = <int>length
 *             else:
 *                 aparams[i] = NULL             # <<<<<<<<<<<<<<
 *                 alenghts[i] = 0
 * 
*/
      /*else*/ {
        (__pyx_v_aparams[__pyx_v_i]) = NULL;

        /* "psycopg_binary/pq/pgconn.pyx":975
 *             else:
 *                 aparams[i] = NULL
 *                 alenghts[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef libpq.Oid *atypes = NULL
*/
        (__pyx_v_alenghts[__pyx_v_i]) = 0;
      }
      __pyx_L11:;
    }


    /* "psycopg_binary/pq/pgconn.pyx":962
 *     cdef Py_ssize_t length
 * 
 *     if nparams:             # <<<<<<<<<<<<<<
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":977
 *                 alenghts[i] = 0
 * 
 *     cdef libpq.Oid *atypes = NULL             # <<<<<<<<<<<<<<
 *     if param_types is not None:
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
*/
  __pyx_v_atypes = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":978
 * 
 *     cdef libpq.Oid *atypes = NULL
 *     if param_types is not None:             # <<<<<<<<<<<<<<
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):
*/
  __pyx_t_1 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":979
 *     cdef libpq.Oid *atypes = NULL
 *     if param_types is not None:
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))             # <<<<<<<<<<<<<<
 *         for i in range(nparams):
 *             atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)
*/
    __pyx_v_atypes = ((Oid *)PyMem_Malloc((__pyx_v_nparams * (sizeof(Oid)))));

    /* "psycopg_binary/pq/pgconn.pyx":980
 *     if param_types is not None:
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):             # <<<<<<<<<<<<<<
 *             atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)
 * 
*/

    __pyx_t_5 = __pyx_v_nparams;
    __pyx_t_11 = __pyx_t_5;

    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_11; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "psycopg_binary/pq/pgconn.pyx":981
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):
 *             atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)             # <<<<<<<<<<<<<<
 * 
 *     cdef int *aformats = NULL
*/
      if (unlikely(!__pyx_v_types_fast)) { __Pyx_RaiseUnboundLocalError("types_fast"); __PYX_ERR(1, 981, __pyx_L1_error) }
      __pyx_t_13 = PySequence_Fast_GET_ITEM(__pyx_v_types_fast, __pyx_v_i);

      __pyx_t_14 = __Pyx_PyLong_As_Oid(((PyObject *)__pyx_t_13)); if (unlikely((__pyx_t_14 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(1, 981, __pyx_L1_error)

      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_14;

    }


    /* "psycopg_binary/pq/pgconn.pyx":978
 * 
 *     cdef libpq.Oid *atypes = NULL
 *     if param_types is not None:             # <<<<<<<<<<<<<<
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":983
 *             atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)
 * 
 *     cdef int *aformats = NULL             # <<<<<<<<<<<<<<
 *     if param_formats is not None:
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
*/
  __pyx_v_aformats = NULL;

  /* "psycopg_binary/pq/pgconn.pyx":984
 * 
 *     cdef int *aformats = NULL
 *     if param_formats is not None:             # <<<<<<<<<<<<<<
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 *         for i in range(nparams):
*/
  __pyx_t_1 = (__pyx_v_param_formats != Py_None);
  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgconn.pyx":985
 *     cdef int *aformats = NULL
 *     if param_formats is not None:
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))             # <<<<<<<<<<<<<<
 *         for i in range(nparams):
 *             aformats[i] = <object>PySequence_Fast_GET_ITEM(formats_fast, i)
*/
    __pyx_v_aformats = ((int *)PyMem_Malloc((__pyx_v_nparams * (sizeof(int *)))));

    /* "psycopg_binary/pq/pgconn.pyx":986
 *     if param_formats is not None:
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 *         for i in range(nparams):             # <<<<<<<<<<<<<<
 *             aformats[i] = <object>PySequence_Fast_GET_ITEM(formats_fast, i)
 * 
*/

    __pyx_t_5 = __pyx_v_nparams;
    __pyx_t_11 = __pyx_t_5;

    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_11; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "psycopg_binary/pq/pgconn.pyx":987
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 *         for i in range(nparams):
 *             aformats[i] = <object>PySequence_Fast_GET_ITEM(formats_fast, i)             # <<<<<<<<<<<<<<
 * 
 *     return (nparams, atypes, aparams, alenghts, aformats)
*/
      if (unlikely(!__pyx_v_formats_fast)) { __Pyx_RaiseUnboundLocalError("formats_fast"); __PYX_ERR(1, 987, __pyx_L1_error) }
      __pyx_t_13 = PySequence_Fast_GET_ITEM(__pyx_v_formats_fast, __pyx_v_i);

      __pyx_t_12 = __Pyx_PyLong_As_int(((PyObject *)__pyx_t_13)); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 987, __pyx_L1_error)

      (__pyx_v_aformats[__pyx_v_i]) = __pyx_t_12;

    }


    /* "psycopg_binary/pq/pgconn.pyx":984
 * 
 *     cdef int *aformats = NULL
 *     if param_formats is not None:             # <<<<<<<<<<<<<<
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 *         for i in range(nparams):
*/
  }

  /* "psycopg_binary/pq/pgconn.pyx":989
 *             aformats[i] = <object>PySequence_Fast_GET_ITEM(formats_fast, i)
 * 
 *     return (nparams, atypes, aparams, alenghts, aformats)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_15.f0 = __pyx_v_nparams;
  __pyx_t_15.f1 = __pyx_v_atypes;
  __pyx_t_15.f2 = __pyx_v_aparams;
  __pyx_t_15.f3 = __pyx_v_alenghts;
  __pyx_t_15.f4 = __pyx_v_aformats;
  {
    __pyx_r = __pyx_t_15;
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgconn.pyx":926
 * 
 * 
 * cdef (Py_ssize_t, libpq.Oid *, char * const*, int *, int *) _query_params_args(             # <<<<<<<<<<<<<<
 *     param_values: Sequence[bytes | None] | None,
 *     param_types: Sequence[int] | 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_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("psycopg_binary.pq._query_params_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;

  __Pyx_XDECREF(__pyx_v_values_fast);
  __Pyx_XDECREF(__pyx_v_types_fast);
  __Pyx_XDECREF(__pyx_v_formats_fast);









  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgconn.pyx":992
 * 
 * 
 * cdef void _clear_query_params(             # <<<<<<<<<<<<<<
 *     libpq.Oid *ctypes, char *const *cvalues, int *clenghst, int *cformats
 * ):
*/

static void __pyx_f_14psycopg_binary_2pq__clear_query_params(Oid *__pyx_v_ctypes, char *const *__pyx_v_cvalues, int *__pyx_v_clenghst, int *__pyx_v_cformats) {

  /* "psycopg_binary/pq/pgconn.pyx":995
 *     libpq.Oid *ctypes, char *const *cvalues, int *clenghst, int *cformats
 * ):
 *     PyMem_Free(ctypes)             # <<<<<<<<<<<<<<
 *     PyMem_Free(<char **>cvalues)
 *     PyMem_Free(clenghst)
*/
  PyMem_Free(__pyx_v_ctypes);

  /* "psycopg_binary/pq/pgconn.pyx":996
 * ):
 *     PyMem_Free(ctypes)
 *     PyMem_Free(<char **>cvalues)             # <<<<<<<<<<<<<<
 *     PyMem_Free(clenghst)
 *     PyMem_Free(cformats)
*/
  PyMem_Free(((char **)__pyx_v_cvalues));

  /* "psycopg_binary/pq/pgconn.pyx":997
 *     PyMem_Free(ctypes)
 *     PyMem_Free(<char **>cvalues)
 *     PyMem_Free(clenghst)             # <<<<<<<<<<<<<<
 *     PyMem_Free(cformats)
*/
  PyMem_Free(__pyx_v_clenghst);

  /* "psycopg_binary/pq/pgconn.pyx":998
 *     PyMem_Free(<char **>cvalues)
 *     PyMem_Free(clenghst)
 *     PyMem_Free(cformats)             # <<<<<<<<<<<<<<
*/
  PyMem_Free(__pyx_v_cformats);

  /* "psycopg_binary/pq/pgconn.pyx":992
 * 
 * 
 * cdef void _clear_query_params(             # <<<<<<<<<<<<<<
 *     libpq.Oid *ctypes, char *const *cvalues, int *clenghst, int *cformats
 * ):
*/

  /* function exit code */

}

/* "psycopg_binary/pq/pgresult.pyx":16
 * @cython.freelist(8)
 * cdef class PGresult:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._pgresult_ptr = NULL
 * 
*/

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_8PGresult_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_8PGresult_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL_TPNEW
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #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
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__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_FASTCALL_TPNEW(__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_14psycopg_binary_2pq_8PGresult___cinit__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_8PGresult___cinit__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self) {
  int __pyx_r;

  /* "psycopg_binary/pq/pgresult.pyx":17
 * cdef class PGresult:
 *     def __cinit__(self):
 *         self._pgresult_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->_pgresult_ptr = NULL;

  /* "psycopg_binary/pq/pgresult.pyx":16
 * @cython.freelist(8)
 * cdef class PGresult:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._pgresult_ptr = NULL
 * 
*/

  /* function exit code */
  __pyx_r = 0;

  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":19
 *         self._pgresult_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGresult _from_ptr(libpq.PGresult *ptr):
 *         cdef PGresult rv = PGresult.__new__(PGresult)
*/

static struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr(PGresult *__pyx_v_ptr) {
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_rv = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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("_from_ptr", 0);

  /* "psycopg_binary/pq/pgresult.pyx":21
 *     @staticmethod
 *     cdef PGresult _from_ptr(libpq.PGresult *ptr):
 *         cdef PGresult rv = PGresult.__new__(PGresult)             # <<<<<<<<<<<<<<
 *         rv._pgresult_ptr = ptr
 *         return rv
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_14psycopg_binary_2pq_PGresult(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":22
 *     cdef PGresult _from_ptr(libpq.PGresult *ptr):
 *         cdef PGresult rv = PGresult.__new__(PGresult)
 *         rv._pgresult_ptr = ptr             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  __pyx_v_rv->_pgresult_ptr = __pyx_v_ptr;

  /* "psycopg_binary/pq/pgresult.pyx":23
 *         cdef PGresult rv = PGresult.__new__(PGresult)
 *         rv._pgresult_ptr = ptr
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self) -> None:
*/
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":19
 *         self._pgresult_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGresult _from_ptr(libpq.PGresult *ptr):
 *         cdef PGresult rv = PGresult.__new__(PGresult)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult._from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":25
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.clear()
 * 
*/

/* Python wrapper */
static void __pyx_pw_14psycopg_binary_2pq_8PGresult_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_14psycopg_binary_2pq_8PGresult_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_14psycopg_binary_2pq_8PGresult_2__dealloc__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_14psycopg_binary_2pq_8PGresult_2__dealloc__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self) {
  __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("__dealloc__", 0);

  /* "psycopg_binary/pq/pgresult.pyx":26
 * 
 *     def __dealloc__(self) -> None:
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self) -> str:
*/
  __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, __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(3, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":25
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.clear()
 * 
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("psycopg_binary.pq.PGresult.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;

  __Pyx_RefNannyFinishContext();
}

/* "psycopg_binary/pq/pgresult.pyx":28
 *         self.clear()
 * 
 *     def __repr__(self) -> str:             # <<<<<<<<<<<<<<
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         status = ExecStatus(self.status)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_5__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_14psycopg_binary_2pq_8PGresult_4__repr__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_4__repr__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_v_cls = NULL;
  PyObject *__pyx_v_status = 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[3];
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9[7];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_binary/pq/pgresult.pyx":29
 * 
 *     def __repr__(self) -> str:
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *         status = ExecStatus(self.status)
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __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_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_qualname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4[0] = __pyx_t_1;
  __pyx_t_4[1] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_4[2] = __pyx_t_2;
  __pyx_t_5 = 1;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[0]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[2]);
  #endif
  __pyx_t_6 = 0;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[0]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[2]);
  #endif
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_5, __pyx_t_6);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 29, __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_v_cls = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":30
 *     def __repr__(self) -> str:
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         status = ExecStatus(self.status)             # <<<<<<<<<<<<<<
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ExecStatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_status); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 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_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __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_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_status = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":31
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         status = ExecStatus(self.status)
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *     def clear(self) -> None:
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_status, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_9[1] = __pyx_v_cls;
  __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u__11;
  __pyx_t_9[3] = __pyx_t_1;
  __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u_at_0x_2;
  __pyx_t_9[5] = __pyx_t_7;
  __pyx_t_9[6] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_5 = 11;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[3]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[5]);
  #endif
  __pyx_t_6 = 0;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_9[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_9[3]) | __Pyx_PyUnicode_KIND_04(__pyx_t_9[5]);
  #endif
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_9, 7, __pyx_t_5, __pyx_t_6);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_3;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":28
 *         self.clear()
 * 
 *     def __repr__(self) -> str:             # <<<<<<<<<<<<<<
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         status = ExecStatus(self.status)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cls);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":33
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
 * 
 *     def clear(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_7clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_7clear = {"clear", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_7clear, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_7clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_6clear(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_6clear(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("clear", 0);

  /* "psycopg_binary/pq/pgresult.pyx":34
 * 
 *     def clear(self) -> None:
 *         if self._pgresult_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQclear(self._pgresult_ptr)
 *             self._pgresult_ptr = NULL
*/
  __pyx_t_1 = (__pyx_v_self->_pgresult_ptr != NULL);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgresult.pyx":35
 *     def clear(self) -> None:
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 *             self._pgresult_ptr = NULL
 * 
*/
    PQclear(__pyx_v_self->_pgresult_ptr);

    /* "psycopg_binary/pq/pgresult.pyx":36
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)
 *             self._pgresult_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
    __pyx_v_self->_pgresult_ptr = NULL;

    /* "psycopg_binary/pq/pgresult.pyx":34
 * 
 *     def clear(self) -> None:
 *         if self._pgresult_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQclear(self._pgresult_ptr)
 *             self._pgresult_ptr = NULL
*/
  }

  /* "psycopg_binary/pq/pgresult.pyx":33
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
 * 
 *     def clear(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":38
 *             self._pgresult_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgresult_ptr(self) -> int | None:
 *         if self._pgresult_ptr:
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_12pgresult_ptr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_12pgresult_ptr_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_14psycopg_binary_2pq_8PGresult_12pgresult_ptr___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_12pgresult_ptr___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_binary/pq/pgresult.pyx":40
 *     @property
 *     def pgresult_ptr(self) -> int | None:
 *         if self._pgresult_ptr:             # <<<<<<<<<<<<<<
 *             return <long long><void *>self._pgresult_ptr
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->_pgresult_ptr != 0);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgresult.pyx":41
 *     def pgresult_ptr(self) -> int | None:
 *         if self._pgresult_ptr:
 *             return <long long><void *>self._pgresult_ptr             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
    __pyx_t_2 = __Pyx_PyLong_From_PY_LONG_LONG(((PY_LONG_LONG)((void *)__pyx_v_self->_pgresult_ptr))); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgresult.pyx":40
 *     @property
 *     def pgresult_ptr(self) -> int | None:
 *         if self._pgresult_ptr:             # <<<<<<<<<<<<<<
 *             return <long long><void *>self._pgresult_ptr
 *         else:
*/
  }

  /* "psycopg_binary/pq/pgresult.pyx":43
 *             return <long long><void *>self._pgresult_ptr
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  /*else*/ {
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }

  /* "psycopg_binary/pq/pgresult.pyx":38
 *             self._pgresult_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgresult_ptr(self) -> int | None:
 *         if self._pgresult_ptr:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.pgresult_ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":45
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         return libpq.PQresultStatus(self._pgresult_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_6status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_6status_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_14psycopg_binary_2pq_8PGresult_6status___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_6status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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);

  /* "psycopg_binary/pq/pgresult.pyx":47
 *     @property
 *     def status(self) -> int:
 *         return libpq.PQresultStatus(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_From_ExecStatusType(PQresultStatus(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":45
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         return libpq.PQresultStatus(self._pgresult_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":49
 *         return libpq.PQresultStatus(self._pgresult_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_13error_message_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_13error_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_14psycopg_binary_2pq_8PGresult_13error_message___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_13error_message___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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);

  /* "psycopg_binary/pq/pgresult.pyx":51
 *     @property
 *     def error_message(self) -> bytes:
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:
*/
  __pyx_t_1 = __Pyx_PyBytes_FromString(PQresultErrorMessage(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":49
 *         return libpq.PQresultStatus(self._pgresult_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.error_message.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_9get_error_message(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_8PGresult_9get_error_message = {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_8PGresult_9get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_9get_error_message(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_encoding = 0;
  #if !CYTHON_VECTORCALL
  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_error_message (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(3, 53, __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(3, 53, __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_error_message", 0) < (0)) __PYX_ERR(3, 53, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u_utf_8));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u_utf_8));
    }
    __pyx_v_encoding = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_error_message", 0, 0, 1, __pyx_nargs); __PYX_ERR(3, 53, __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("psycopg_binary.pq.PGresult.get_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 2))) __PYX_ERR(3, 53, __pyx_L1_error)
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_8get_error_message(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), __pyx_v_encoding);

  /* 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_14psycopg_binary_2pq_8PGresult_8get_error_message(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, PyObject *__pyx_v_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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_error_message", 0);

  /* "psycopg_binary/pq/pgresult.pyx":54
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:
 *         return _clean_error_message(self.error_message, encoding)             # <<<<<<<<<<<<<<
 * 
 *     def error_field(self, int fieldcode) -> bytes | None:
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_clean_error_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 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_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_encoding};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__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;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 54, __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, 54, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/

  /* 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("psycopg_binary.pq.PGresult.get_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":56
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def error_field(self, int fieldcode) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_11error_field(PyObject *__pyx_v_self, PyObject *__pyx_arg_fieldcode); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_11error_field = {"error_field", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_11error_field, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_11error_field(PyObject *__pyx_v_self, PyObject *__pyx_arg_fieldcode) {
  int __pyx_v_fieldcode;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("error_field (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_fieldcode); {
    __pyx_v_fieldcode = __Pyx_PyLong_As_int(__pyx_arg_fieldcode); if (unlikely((__pyx_v_fieldcode == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 56, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.error_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_10error_field(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_fieldcode));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_10error_field(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_fieldcode) {
  char *__pyx_v_rv;
  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("error_field", 0);

  /* "psycopg_binary/pq/pgresult.pyx":57
 * 
 *     def error_field(self, int fieldcode) -> bytes | None:
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)             # <<<<<<<<<<<<<<
 *         if rv is not NULL:
 *             return rv
*/
  __pyx_v_rv = PQresultErrorField(__pyx_v_self->_pgresult_ptr, __pyx_v_fieldcode);

  /* "psycopg_binary/pq/pgresult.pyx":58
 *     def error_field(self, int fieldcode) -> bytes | None:
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  __pyx_t_1 = (__pyx_v_rv != NULL);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgresult.pyx":59
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
 *             return rv             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((PyObject*)__pyx_t_2);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgresult.pyx":58
 *     def error_field(self, int fieldcode) -> bytes | None:
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  }

  /* "psycopg_binary/pq/pgresult.pyx":61
 *             return rv
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  /*else*/ {
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }

  /* "psycopg_binary/pq/pgresult.pyx":56
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def error_field(self, int fieldcode) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.error_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":63
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ntuples(self) -> int:
 *         return libpq.PQntuples(self._pgresult_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_7ntuples_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_7ntuples_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_14psycopg_binary_2pq_8PGresult_7ntuples___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_7ntuples___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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);

  /* "psycopg_binary/pq/pgresult.pyx":65
 *     @property
 *     def ntuples(self) -> int:
 *         return libpq.PQntuples(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(PQntuples(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":63
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ntuples(self) -> int:
 *         return libpq.PQntuples(self._pgresult_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.ntuples.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":67
 *         return libpq.PQntuples(self._pgresult_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nfields(self) -> int:
 *         return libpq.PQnfields(self._pgresult_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_7nfields_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_7nfields_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_14psycopg_binary_2pq_8PGresult_7nfields___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_7nfields___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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);

  /* "psycopg_binary/pq/pgresult.pyx":69
 *     @property
 *     def nfields(self) -> int:
 *         return libpq.PQnfields(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def fname(self, int column_number) -> bytes | None:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(PQnfields(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":67
 *         return libpq.PQntuples(self._pgresult_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nfields(self) -> int:
 *         return libpq.PQnfields(self._pgresult_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.nfields.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":71
 *         return libpq.PQnfields(self._pgresult_ptr)
 * 
 *     def fname(self, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_13fname(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_13fname = {"fname", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_13fname, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_13fname(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fname (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 71, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.fname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_12fname(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_12fname(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  char *__pyx_v_rv;
  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("fname", 0);

  /* "psycopg_binary/pq/pgresult.pyx":72
 * 
 *     def fname(self, int column_number) -> bytes | None:
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 *         if rv is not NULL:
 *             return rv
*/
  __pyx_v_rv = PQfname(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number);

  /* "psycopg_binary/pq/pgresult.pyx":73
 *     def fname(self, int column_number) -> bytes | None:
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  __pyx_t_1 = (__pyx_v_rv != NULL);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgresult.pyx":74
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:
 *             return rv             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((PyObject*)__pyx_t_2);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgresult.pyx":73
 *     def fname(self, int column_number) -> bytes | None:
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  }

  /* "psycopg_binary/pq/pgresult.pyx":76
 *             return rv
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def ftable(self, int column_number) -> int:
*/
  /*else*/ {
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }

  /* "psycopg_binary/pq/pgresult.pyx":71
 *         return libpq.PQnfields(self._pgresult_ptr)
 * 
 *     def fname(self, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.fname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":78
 *             return None
 * 
 *     def ftable(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_15ftable(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_15ftable = {"ftable", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_15ftable, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_15ftable(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ftable (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 78, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.ftable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_14ftable(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_14ftable(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  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("ftable", 0);

  /* "psycopg_binary/pq/pgresult.pyx":79
 * 
 *     def ftable(self, int column_number) -> int:
 *         return libpq.PQftable(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     def ftablecol(self, int column_number) -> int:
*/
  __pyx_t_1 = __Pyx_PyLong_From_Oid(PQftable(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(3, 79, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":78
 *             return None
 * 
 *     def ftable(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.ftable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":81
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 *     def ftablecol(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_17ftablecol(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_17ftablecol = {"ftablecol", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_17ftablecol, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_17ftablecol(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ftablecol (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 81, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.ftablecol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_16ftablecol(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_16ftablecol(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  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("ftablecol", 0);

  /* "psycopg_binary/pq/pgresult.pyx":82
 * 
 *     def ftablecol(self, int column_number) -> int:
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     def fformat(self, int column_number) -> int:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(PQftablecol(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(3, 82, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":81
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 *     def ftablecol(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.ftablecol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":84
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 *     def fformat(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_19fformat(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_19fformat = {"fformat", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_19fformat, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_19fformat(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fformat (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 84, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.fformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_18fformat(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_18fformat(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  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("fformat", 0);

  /* "psycopg_binary/pq/pgresult.pyx":85
 * 
 *     def fformat(self, int column_number) -> int:
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     def ftype(self, int column_number) -> int:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(PQfformat(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(3, 85, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":84
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 *     def fformat(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.fformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":87
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 *     def ftype(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_21ftype(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_21ftype = {"ftype", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_21ftype, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_21ftype(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ftype (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 87, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.ftype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_20ftype(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_20ftype(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  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("ftype", 0);

  /* "psycopg_binary/pq/pgresult.pyx":88
 * 
 *     def ftype(self, int column_number) -> int:
 *         return libpq.PQftype(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     def fmod(self, int column_number) -> int:
*/
  __pyx_t_1 = __Pyx_PyLong_From_Oid(PQftype(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(3, 88, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":87
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 *     def ftype(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.ftype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":90
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 *     def fmod(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_23fmod(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_23fmod = {"fmod", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_23fmod, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_23fmod(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fmod (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 90, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.fmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_22fmod(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_22fmod(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  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("fmod", 0);

  /* "psycopg_binary/pq/pgresult.pyx":91
 * 
 *     def fmod(self, int column_number) -> int:
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     def fsize(self, int column_number) -> int:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(PQfmod(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(3, 91, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":90
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 *     def fmod(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.fmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":93
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 *     def fsize(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_25fsize(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_25fsize = {"fsize", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_25fsize, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_25fsize(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fsize (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 93, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.fsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_24fsize(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_24fsize(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  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("fsize", 0);

  /* "psycopg_binary/pq/pgresult.pyx":94
 * 
 *     def fsize(self, int column_number) -> int:
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(PQfsize(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(3, 94, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":93
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 *     def fsize(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.fsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":96
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def binary_tuples(self) -> int:
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_13binary_tuples_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_13binary_tuples_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_14psycopg_binary_2pq_8PGresult_13binary_tuples___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_13binary_tuples___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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);

  /* "psycopg_binary/pq/pgresult.pyx":98
 *     @property
 *     def binary_tuples(self) -> int:
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_value(self, int row_number, int column_number) -> bytes | None:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(PQbinaryTuples(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":96
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def binary_tuples(self) -> int:
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.binary_tuples.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":100
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 * 
 *     def get_value(self, int row_number, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_27get_value(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_8PGresult_27get_value = {"get_value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_8PGresult_27get_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_27get_value(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_row_number;
  int __pyx_v_column_number;
  #if !CYTHON_VECTORCALL
  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("get_value (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_row_number,&__pyx_mstate_global->__pyx_n_u_column_number,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(3, 100, __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(3, 100, __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(3, 100, __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_value", 0) < (0)) __PYX_ERR(3, 100, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, i); __PYX_ERR(3, 100, __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(3, 100, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 100, __pyx_L3_error)
    }
    __pyx_v_row_number = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_row_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 100, __pyx_L3_error)
    __pyx_v_column_number = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 100, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 100, __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("psycopg_binary.pq.PGresult.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_26get_value(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), __pyx_v_row_number, __pyx_v_column_number);

  /* 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_14psycopg_binary_2pq_8PGresult_26get_value(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_row_number, int __pyx_v_column_number) {
  int __pyx_v_crow;
  int __pyx_v_ccol;
  int __pyx_v_length;
  char *__pyx_v_v;
  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", 0);

  /* "psycopg_binary/pq/pgresult.pyx":101
 * 
 *     def get_value(self, int row_number, int column_number) -> bytes | None:
 *         cdef int crow = row_number             # <<<<<<<<<<<<<<
 *         cdef int ccol = column_number
 *         cdef int length = libpq.PQgetlength(self._pgresult_ptr, crow, ccol)
*/
  __pyx_v_crow = __pyx_v_row_number;

  /* "psycopg_binary/pq/pgresult.pyx":102
 *     def get_value(self, int row_number, int column_number) -> bytes | None:
 *         cdef int crow = row_number
 *         cdef int ccol = column_number             # <<<<<<<<<<<<<<
 *         cdef int length = libpq.PQgetlength(self._pgresult_ptr, crow, ccol)
 *         cdef char *v
*/
  __pyx_v_ccol = __pyx_v_column_number;

  /* "psycopg_binary/pq/pgresult.pyx":103
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
 *         cdef int length = libpq.PQgetlength(self._pgresult_ptr, crow, ccol)             # <<<<<<<<<<<<<<
 *         cdef char *v
 *         if length:
*/
  __pyx_v_length = PQgetlength(__pyx_v_self->_pgresult_ptr, __pyx_v_crow, __pyx_v_ccol);

  /* "psycopg_binary/pq/pgresult.pyx":105
 *         cdef int length = libpq.PQgetlength(self._pgresult_ptr, crow, ccol)
 *         cdef char *v
 *         if length:             # <<<<<<<<<<<<<<
 *             v = libpq.PQgetvalue(self._pgresult_ptr, crow, ccol)
 *             # TODO: avoid copy
*/
  __pyx_t_1 = (__pyx_v_length != 0);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgresult.pyx":106
 *         cdef char *v
 *         if length:
 *             v = libpq.PQgetvalue(self._pgresult_ptr, crow, ccol)             # <<<<<<<<<<<<<<
 *             # TODO: avoid copy
 *             return v[:length]
*/
    __pyx_v_v = PQgetvalue(__pyx_v_self->_pgresult_ptr, __pyx_v_crow, __pyx_v_ccol);

    /* "psycopg_binary/pq/pgresult.pyx":108
 *             v = libpq.PQgetvalue(self._pgresult_ptr, crow, ccol)
 *             # TODO: avoid copy
 *             return v[:length]             # <<<<<<<<<<<<<<
 *         else:
 *             if libpq.PQgetisnull(self._pgresult_ptr, crow, ccol):
*/
    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_v + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = ((PyObject*)__pyx_t_2);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgresult.pyx":105
 *         cdef int length = libpq.PQgetlength(self._pgresult_ptr, crow, ccol)
 *         cdef char *v
 *         if length:             # <<<<<<<<<<<<<<
 *             v = libpq.PQgetvalue(self._pgresult_ptr, crow, ccol)
 *             # TODO: avoid copy
*/
  }

  /* "psycopg_binary/pq/pgresult.pyx":110
 *             return v[:length]
 *         else:
 *             if libpq.PQgetisnull(self._pgresult_ptr, crow, ccol):             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
*/
  /*else*/ {
    __pyx_t_1 = (PQgetisnull(__pyx_v_self->_pgresult_ptr, __pyx_v_crow, __pyx_v_ccol) != 0);

    if (__pyx_t_1) {


      /* "psycopg_binary/pq/pgresult.pyx":111
 *         else:
 *             if libpq.PQgetisnull(self._pgresult_ptr, crow, ccol):
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return b""
*/
      {
        PyObject *__pyx_temp;
        {
          __pyx_temp = __pyx_r;
          __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
        }
        __Pyx_XDECREF(__pyx_temp);
      }
      goto __pyx_L0;

      /* "psycopg_binary/pq/pgresult.pyx":110
 *             return v[:length]
 *         else:
 *             if libpq.PQgetisnull(self._pgresult_ptr, crow, ccol):             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
*/
    }

    /* "psycopg_binary/pq/pgresult.pyx":113
 *                 return None
 *             else:
 *                 return b""             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
    /*else*/ {
      {
        PyObject *__pyx_temp;
        {
          __pyx_temp = __pyx_r;
          __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
          __pyx_r = __pyx_mstate_global->__pyx_kp_b__6;
        }
        __Pyx_XDECREF(__pyx_temp);
      }
      goto __pyx_L0;
    }
  }

  /* "psycopg_binary/pq/pgresult.pyx":100
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 * 
 *     def get_value(self, int row_number, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;




  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":115
 *                 return b""
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nparams(self) -> int:
 *         return libpq.PQnparams(self._pgresult_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_7nparams_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_7nparams_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_14psycopg_binary_2pq_8PGresult_7nparams___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_7nparams___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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);

  /* "psycopg_binary/pq/pgresult.pyx":117
 *     @property
 *     def nparams(self) -> int:
 *         return libpq.PQnparams(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def param_type(self, int param_number) -> int:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(PQnparams(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":115
 *                 return b""
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nparams(self) -> int:
 *         return libpq.PQnparams(self._pgresult_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.nparams.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":119
 *         return libpq.PQnparams(self._pgresult_ptr)
 * 
 *     def param_type(self, int param_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_29param_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_param_number); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_29param_type = {"param_type", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_29param_type, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_29param_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_param_number) {
  int __pyx_v_param_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("param_type (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_param_number); {
    __pyx_v_param_number = __Pyx_PyLong_As_int(__pyx_arg_param_number); if (unlikely((__pyx_v_param_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 119, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.param_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_28param_type(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_param_number));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_28param_type(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, int __pyx_v_param_number) {
  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("param_type", 0);

  /* "psycopg_binary/pq/pgresult.pyx":120
 * 
 *     def param_type(self, int param_number) -> int:
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_From_Oid(PQparamtype(__pyx_v_self->_pgresult_ptr, __pyx_v_param_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(3, 120, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":119
 *         return libpq.PQnparams(self._pgresult_ptr)
 * 
 *     def param_type(self, int param_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.param_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":122
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_status(self) -> bytes | None:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_14command_status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_14command_status_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_14psycopg_binary_2pq_8PGresult_14command_status___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_14command_status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self) {
  char *__pyx_v_rv;
  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__", 0);

  /* "psycopg_binary/pq/pgresult.pyx":124
 *     @property
 *     def command_status(self) -> bytes | None:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 *         if rv is not NULL:
 *             return rv
*/
  __pyx_v_rv = PQcmdStatus(__pyx_v_self->_pgresult_ptr);

  /* "psycopg_binary/pq/pgresult.pyx":125
 *     def command_status(self) -> bytes | None:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  __pyx_t_1 = (__pyx_v_rv != NULL);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgresult.pyx":126
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
 *         if rv is not NULL:
 *             return rv             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgresult.pyx":125
 *     def command_status(self) -> bytes | None:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  }

  /* "psycopg_binary/pq/pgresult.pyx":128
 *             return rv
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  /*else*/ {
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;
  }

  /* "psycopg_binary/pq/pgresult.pyx":122
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_status(self) -> bytes | None:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.command_status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":130
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_tuples(self) -> int | None:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_14command_tuples_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_14command_tuples_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_14psycopg_binary_2pq_8PGresult_14command_tuples___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_14command_tuples___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self) {
  char *__pyx_v_rv;
  PyObject *__pyx_v_brv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_binary/pq/pgresult.pyx":132
 *     @property
 *     def command_tuples(self) -> int | None:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             return None
*/
  __pyx_v_rv = PQcmdTuples(__pyx_v_self->_pgresult_ptr);

  /* "psycopg_binary/pq/pgresult.pyx":133
 *     def command_tuples(self) -> int | None:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         cdef bytes brv = rv
*/
  __pyx_t_1 = (__pyx_v_rv == NULL);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgresult.pyx":134
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
 *         if rv is NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         cdef bytes brv = rv
 *         return int(brv) if brv else None
*/
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    goto __pyx_L0;

    /* "psycopg_binary/pq/pgresult.pyx":133
 *     def command_tuples(self) -> int | None:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         cdef bytes brv = rv
*/
  }

  /* "psycopg_binary/pq/pgresult.pyx":135
 *         if rv is NULL:
 *             return None
 *         cdef bytes brv = rv             # <<<<<<<<<<<<<<
 *         return int(brv) if brv else None
 * 
*/
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_brv = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":136
 *             return None
 *         cdef bytes brv = rv
 *         return int(brv) if brv else None             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  {
    Py_ssize_t __pyx_temp = __Pyx_PyBytes_GET_SIZE(__pyx_v_brv);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(3, 136, __pyx_L1_error)
    __pyx_t_1 = (__pyx_temp != 0);
  }

  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_brv); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_2 = Py_None;
  }

  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":130
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_tuples(self) -> int | None:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.command_tuples.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XDECREF(__pyx_v_brv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":138
 *         return int(brv) if brv else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def oid_value(self) -> int:
 *         return libpq.PQoidValue(self._pgresult_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_9oid_value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_9oid_value_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_14psycopg_binary_2pq_8PGresult_9oid_value___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_9oid_value___get__(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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);

  /* "psycopg_binary/pq/pgresult.pyx":140
 *     @property
 *     def oid_value(self) -> int:
 *         return libpq.PQoidValue(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def set_attributes(self, descriptions: list[PGresAttDesc]):
*/
  __pyx_t_1 = __Pyx_PyLong_From_Oid(PQoidValue(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgresult.pyx":138
 *         return int(brv) if brv else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def oid_value(self) -> int:
 *         return libpq.PQoidValue(self._pgresult_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.oid_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgresult.pyx":142
 *         return libpq.PQoidValue(self._pgresult_ptr)
 * 
 *     def set_attributes(self, descriptions: list[PGresAttDesc]):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t num = len(descriptions)
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_31set_attributes(PyObject *__pyx_v_self, PyObject *__pyx_v_descriptions); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_31set_attributes = {"set_attributes", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_31set_attributes, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_31set_attributes(PyObject *__pyx_v_self, PyObject *__pyx_v_descriptions) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_attributes (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_descriptions), (&PyList_Type), 0, "descriptions", 2))) __PYX_ERR(3, 142, __pyx_L1_error)
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_30set_attributes(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((PyObject*)__pyx_v_descriptions));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_30set_attributes(struct __pyx_obj_14psycopg_binary_2pq_PGresult *__pyx_v_self, PyObject *__pyx_v_descriptions) {
  Py_ssize_t __pyx_v_num;
  PGresAttDesc *__pyx_v_attrs;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_descr = NULL;
  int __pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  Oid __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;
  size_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_attributes", 0);

  /* "psycopg_binary/pq/pgresult.pyx":143
 * 
 *     def set_attributes(self, descriptions: list[PGresAttDesc]):
 *         cdef Py_ssize_t num = len(descriptions)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(
 *             num * sizeof(libpq.PGresAttDesc))
*/
  __pyx_t_1 = __Pyx_PyList_GET_SIZE(__pyx_v_descriptions); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 143, __pyx_L1_error)
  __pyx_v_num = __pyx_t_1;

  /* "psycopg_binary/pq/pgresult.pyx":144
 *     def set_attributes(self, descriptions: list[PGresAttDesc]):
 *         cdef Py_ssize_t num = len(descriptions)
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(             # <<<<<<<<<<<<<<
 *             num * sizeof(libpq.PGresAttDesc))
 * 
*/
  __pyx_v_attrs = ((PGresAttDesc *)PyMem_Malloc((__pyx_v_num * (sizeof(PGresAttDesc)))));

  /* "psycopg_binary/pq/pgresult.pyx":147
 *             num * sizeof(libpq.PGresAttDesc))
 * 
 *         for i in range(num):             # <<<<<<<<<<<<<<
 *             descr = descriptions[i]
 *             attrs[i].name = descr.name
*/

  __pyx_t_1 = __pyx_v_num;
  __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;

    /* "psycopg_binary/pq/pgresult.pyx":148
 * 
 *         for i in range(num):
 *             descr = descriptions[i]             # <<<<<<<<<<<<<<
 *             attrs[i].name = descr.name
 *             attrs[i].tableid = descr.tableid
*/
    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_descriptions, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_descr, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgresult.pyx":149
 *         for i in range(num):
 *             descr = descriptions[i]
 *             attrs[i].name = descr.name             # <<<<<<<<<<<<<<
 *             attrs[i].tableid = descr.tableid
 *             attrs[i].columnid = descr.columnid
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_t_4); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 149, __pyx_L1_error)
    (__pyx_v_attrs[__pyx_v_i]).name = __pyx_t_5;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgresult.pyx":150
 *             descr = descriptions[i]
 *             attrs[i].name = descr.name
 *             attrs[i].tableid = descr.tableid             # <<<<<<<<<<<<<<
 *             attrs[i].columnid = descr.columnid
 *             attrs[i].format = descr.format
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_mstate_global->__pyx_n_u_tableid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyLong_As_Oid(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(3, 150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).tableid = __pyx_t_6;

    /* "psycopg_binary/pq/pgresult.pyx":151
 *             attrs[i].name = descr.name
 *             attrs[i].tableid = descr.tableid
 *             attrs[i].columnid = descr.columnid             # <<<<<<<<<<<<<<
 *             attrs[i].format = descr.format
 *             attrs[i].typid = descr.typid
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_mstate_global->__pyx_n_u_columnid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 151, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).columnid = __pyx_t_7;

    /* "psycopg_binary/pq/pgresult.pyx":152
 *             attrs[i].tableid = descr.tableid
 *             attrs[i].columnid = descr.columnid
 *             attrs[i].format = descr.format             # <<<<<<<<<<<<<<
 *             attrs[i].typid = descr.typid
 *             attrs[i].typlen = descr.typlen
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 152, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).format = __pyx_t_7;

    /* "psycopg_binary/pq/pgresult.pyx":153
 *             attrs[i].columnid = descr.columnid
 *             attrs[i].format = descr.format
 *             attrs[i].typid = descr.typid             # <<<<<<<<<<<<<<
 *             attrs[i].typlen = descr.typlen
 *             attrs[i].atttypmod = descr.atttypmod
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_mstate_global->__pyx_n_u_typid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyLong_As_Oid(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(3, 153, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).typid = __pyx_t_6;

    /* "psycopg_binary/pq/pgresult.pyx":154
 *             attrs[i].format = descr.format
 *             attrs[i].typid = descr.typid
 *             attrs[i].typlen = descr.typlen             # <<<<<<<<<<<<<<
 *             attrs[i].atttypmod = descr.atttypmod
 * 
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_mstate_global->__pyx_n_u_typlen); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 154, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).typlen = __pyx_t_7;

    /* "psycopg_binary/pq/pgresult.pyx":155
 *             attrs[i].typid = descr.typid
 *             attrs[i].typlen = descr.typlen
 *             attrs[i].atttypmod = descr.atttypmod             # <<<<<<<<<<<<<<
 * 
 *         cdef int res = libpq.PQsetResultAttrs(self._pgresult_ptr, <int>num, attrs)
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_mstate_global->__pyx_n_u_atttypmod); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 155, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).atttypmod = __pyx_t_7;
  }


  /* "psycopg_binary/pq/pgresult.pyx":157
 *             attrs[i].atttypmod = descr.atttypmod
 * 
 *         cdef int res = libpq.PQsetResultAttrs(self._pgresult_ptr, <int>num, attrs)             # <<<<<<<<<<<<<<
 *         PyMem_Free(attrs)
 *         if (res == 0):
*/
  __pyx_v_res = PQsetResultAttrs(__pyx_v_self->_pgresult_ptr, ((int)__pyx_v_num), __pyx_v_attrs);

  /* "psycopg_binary/pq/pgresult.pyx":158
 * 
 *         cdef int res = libpq.PQsetResultAttrs(self._pgresult_ptr, <int>num, attrs)
 *         PyMem_Free(attrs)             # <<<<<<<<<<<<<<
 *         if (res == 0):
 *             raise e.OperationalError("PQsetResultAttrs failed")
*/
  PyMem_Free(__pyx_v_attrs);

  /* "psycopg_binary/pq/pgresult.pyx":159
 *         cdef int res = libpq.PQsetResultAttrs(self._pgresult_ptr, <int>num, attrs)
 *         PyMem_Free(attrs)
 *         if (res == 0):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("PQsetResultAttrs failed")
*/
  __pyx_t_8 = (__pyx_v_res == 0);

  if (unlikely(__pyx_t_8)) {


    /* "psycopg_binary/pq/pgresult.pyx":160
 *         PyMem_Free(attrs)
 *         if (res == 0):
 *             raise e.OperationalError("PQsetResultAttrs failed")             # <<<<<<<<<<<<<<
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 160, __pyx_L1_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_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_12 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_PQsetResultAttrs_failed};
      __pyx_t_4 = __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_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 160, __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(3, 160, __pyx_L1_error)

    /* "psycopg_binary/pq/pgresult.pyx":159
 *         cdef int res = libpq.PQsetResultAttrs(self._pgresult_ptr, <int>num, attrs)
 *         PyMem_Free(attrs)
 *         if (res == 0):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("PQsetResultAttrs failed")
*/
  }

  /* "psycopg_binary/pq/pgresult.pyx":142
 *         return libpq.PQoidValue(self._pgresult_ptr)
 * 
 *     def set_attributes(self, descriptions: list[PGresAttDesc]):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t num = len(descriptions)
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(
*/

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("psycopg_binary.pq.PGresult.set_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;



  __Pyx_XDECREF(__pyx_v_descr);

  __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_14psycopg_binary_2pq_8PGresult_33__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_33__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_33__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_32__reduce_cython__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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(2, 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("psycopg_binary.pq.PGresult.__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_14psycopg_binary_2pq_8PGresult_35__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGresult_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_35__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGresult_35__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGresult_34__setstate_cython__(((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGresult_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGresult *__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(2, 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("psycopg_binary.pq.PGresult.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":9
 * 
 * cdef class PGcancelConn:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.pgcancelconn_ptr = NULL
 * 
*/

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_12PGcancelConn_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_12PGcancelConn_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL_TPNEW
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #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
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__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_FASTCALL_TPNEW(__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_14psycopg_binary_2pq_12PGcancelConn___cinit__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_12PGcancelConn___cinit__(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self) {
  int __pyx_r;

  /* "psycopg_binary/pq/pgcancel.pyx":10
 * cdef class PGcancelConn:
 *     def __cinit__(self):
 *         self.pgcancelconn_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->pgcancelconn_ptr = NULL;

  /* "psycopg_binary/pq/pgcancel.pyx":9
 * 
 * cdef class PGcancelConn:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.pgcancelconn_ptr = NULL
 * 
*/

  /* function exit code */
  __pyx_r = 0;

  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":12
 *         self.pgcancelconn_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGcancelConn _from_ptr(libpq.PGcancelConn *ptr):
 *         cdef PGcancelConn rv = PGcancelConn.__new__(PGcancelConn)
*/

static struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_f_14psycopg_binary_2pq_12PGcancelConn__from_ptr(PGcancelConn *__pyx_v_ptr) {
  struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_rv = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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("_from_ptr", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":14
 *     @staticmethod
 *     cdef PGcancelConn _from_ptr(libpq.PGcancelConn *ptr):
 *         cdef PGcancelConn rv = PGcancelConn.__new__(PGcancelConn)             # <<<<<<<<<<<<<<
 *         rv.pgcancelconn_ptr = ptr
 *         return rv
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_14psycopg_binary_2pq_PGcancelConn(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":15
 *     cdef PGcancelConn _from_ptr(libpq.PGcancelConn *ptr):
 *         cdef PGcancelConn rv = PGcancelConn.__new__(PGcancelConn)
 *         rv.pgcancelconn_ptr = ptr             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  __pyx_v_rv->pgcancelconn_ptr = __pyx_v_ptr;

  /* "psycopg_binary/pq/pgcancel.pyx":16
 *         cdef PGcancelConn rv = PGcancelConn.__new__(PGcancelConn)
 *         rv.pgcancelconn_ptr = ptr
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self) -> None:
*/
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgcancel.pyx":12
 *         self.pgcancelconn_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGcancelConn _from_ptr(libpq.PGcancelConn *ptr):
 *         cdef PGcancelConn rv = PGcancelConn.__new__(PGcancelConn)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGcancelConn._from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":18
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.finish()
 * 
*/

/* Python wrapper */
static void __pyx_pw_14psycopg_binary_2pq_12PGcancelConn_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_14psycopg_binary_2pq_12PGcancelConn_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_2__dealloc__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_2__dealloc__(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self) {
  __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("__dealloc__", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":19
 * 
 *     def __dealloc__(self) -> None:
 *         self.finish()             # <<<<<<<<<<<<<<
 * 
 *     def start(self) -> None:
*/
  __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_finish, __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(4, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":18
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.finish()
 * 
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("psycopg_binary.pq.PGcancelConn.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;

  __Pyx_RefNannyFinishContext();
}

/* "psycopg_binary/pq/pgcancel.pyx":21
 *         self.finish()
 * 
 *     def start(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a non-blocking manner.
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_5start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_14psycopg_binary_2pq_12PGcancelConn_4start, "Requests that the server abandons processing of the current command\n        in a non-blocking manner.\n\n        See :pq:`PQcancelStart` for details.\n        ");
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_5start = {"start", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_5start, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_12PGcancelConn_4start};
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_5start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_4start(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_4start(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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;
  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("start", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":27
 *         See :pq:`PQcancelStart` for details.
 *         """
 *         if not libpq.PQcancelStart(self.pgcancelconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"
*/
  __pyx_t_1 = (!(PQcancelStart(__pyx_v_self->pgcancelconn_ptr) != 0));

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgcancel.pyx":28
 *         """
 *         if not libpq.PQcancelStart(self.pgcancelconn_ptr):
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"couldn't send cancellation: {self.get_error_message()}"
 *             )
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgcancel.pyx":29
 *         if not libpq.PQcancelStart(self.pgcancelconn_ptr):
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__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(4, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_couldn_t_send_cancellation, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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(4, 28, __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(4, 28, __pyx_L1_error)

    /* "psycopg_binary/pq/pgcancel.pyx":27
 *         See :pq:`PQcancelStart` for details.
 *         """
 *         if not libpq.PQcancelStart(self.pgcancelconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgcancel.pyx":21
 *         self.finish()
 * 
 *     def start(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a non-blocking manner.
*/

  /* 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("psycopg_binary.pq.PGcancelConn.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":32
 *             )
 * 
 *     def blocking(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a blocking manner.
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_7blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_14psycopg_binary_2pq_12PGcancelConn_6blocking, "Requests that the server abandons processing of the current command\n        in a blocking manner.\n\n        See :pq:`PQcancelBlocking` for details.\n        ");
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_7blocking = {"blocking", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_7blocking, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_12PGcancelConn_6blocking};
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_7blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("blocking (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_6blocking(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_6blocking(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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;
  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("blocking", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":38
 *         See :pq:`PQcancelBlocking` for details.
 *         """
 *         if not libpq.PQcancelBlocking(self.pgcancelconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"
*/
  __pyx_t_1 = (!(PQcancelBlocking(__pyx_v_self->pgcancelconn_ptr) != 0));

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgcancel.pyx":39
 *         """
 *         if not libpq.PQcancelBlocking(self.pgcancelconn_ptr):
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"couldn't send cancellation: {self.get_error_message()}"
 *             )
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgcancel.pyx":40
 *         if not libpq.PQcancelBlocking(self.pgcancelconn_ptr):
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__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(4, 40, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_couldn_t_send_cancellation, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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(4, 39, __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(4, 39, __pyx_L1_error)

    /* "psycopg_binary/pq/pgcancel.pyx":38
 *         See :pq:`PQcancelBlocking` for details.
 *         """
 *         if not libpq.PQcancelBlocking(self.pgcancelconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/pgcancel.pyx":32
 *             )
 * 
 *     def blocking(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a blocking manner.
*/

  /* 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("psycopg_binary.pq.PGcancelConn.blocking", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":43
 *             )
 * 
 *     def poll(self) -> int:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_9poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_9poll = {"poll", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_9poll, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_9poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("poll (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_8poll(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_8poll(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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("poll", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":44
 * 
 *     def poll(self) -> int:
 *         self._ensure_pgcancelconn()             # <<<<<<<<<<<<<<
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
 * 
*/
  __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_ensure_pgcancelconn, __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(4, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":45
 *     def poll(self) -> int:
 *         self._ensure_pgcancelconn()
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_From_PostgresPollingStatusType(PQcancelPoll(__pyx_v_self->pgcancelconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(4, 45, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgcancel.pyx":43
 *             )
 * 
 *     def poll(self) -> int:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_binary.pq.PGcancelConn.poll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":47
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         return libpq.PQcancelStatus(self.pgcancelconn_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_6status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_6status_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_14psycopg_binary_2pq_12PGcancelConn_6status___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_6status___get__(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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);

  /* "psycopg_binary/pq/pgcancel.pyx":49
 *     @property
 *     def status(self) -> int:
 *         return libpq.PQcancelStatus(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_From_ConnStatusType(PQcancelStatus(__pyx_v_self->pgcancelconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgcancel.pyx":47
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         return libpq.PQcancelStatus(self.pgcancelconn_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGcancelConn.status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":51
 *         return libpq.PQcancelStatus(self.pgcancelconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def socket(self) -> int:
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_6socket_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_6socket_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_14psycopg_binary_2pq_12PGcancelConn_6socket___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_6socket___get__(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self) {
  int __pyx_v_rv;
  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("__get__", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":53
 *     @property
 *     def socket(self) -> int:
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv == -1:
 *             raise e.OperationalError("cancel connection not opened")
*/
  __pyx_v_rv = PQcancelSocket(__pyx_v_self->pgcancelconn_ptr);

  /* "psycopg_binary/pq/pgcancel.pyx":54
 *     def socket(self) -> int:
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)
 *         if rv == -1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("cancel connection not opened")
 *         return rv
*/
  __pyx_t_1 = (__pyx_v_rv == -1L);

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgcancel.pyx":55
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)
 *         if rv == -1:
 *             raise e.OperationalError("cancel connection not opened")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 55, __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_cancel_connection_not_opened};
      __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(4, 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(4, 55, __pyx_L1_error)

    /* "psycopg_binary/pq/pgcancel.pyx":54
 *     def socket(self) -> int:
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)
 *         if rv == -1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("cancel connection not opened")
 *         return rv
*/
  }

  /* "psycopg_binary/pq/pgcancel.pyx":56
 *         if rv == -1:
 *             raise e.OperationalError("cancel connection not opened")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_2;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgcancel.pyx":51
 *         return libpq.PQcancelStatus(self.pgcancelconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def socket(self) -> int:
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)
*/

  /* 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("psycopg_binary.pq.PGcancelConn.socket.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":58
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_13error_message_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_13error_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_14psycopg_binary_2pq_12PGcancelConn_13error_message___get__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_13error_message___get__(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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);

  /* "psycopg_binary/pq/pgcancel.pyx":60
 *     @property
 *     def error_message(self) -> bytes:
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:
*/
  __pyx_t_1 = __Pyx_PyBytes_FromString(PQcancelErrorMessage(__pyx_v_self->pgcancelconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgcancel.pyx":58
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGcancelConn.error_message.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":62
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_11get_error_message(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_12PGcancelConn_11get_error_message = {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_11get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_11get_error_message(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_encoding = 0;
  #if !CYTHON_VECTORCALL
  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_error_message (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(4, 62, __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(4, 62, __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_error_message", 0) < (0)) __PYX_ERR(4, 62, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u_utf_8));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 62, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u_utf_8));
    }
    __pyx_v_encoding = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_error_message", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 62, __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("psycopg_binary.pq.PGcancelConn.get_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 2))) __PYX_ERR(4, 62, __pyx_L1_error)
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_10get_error_message(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self), __pyx_v_encoding);

  /* 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_14psycopg_binary_2pq_12PGcancelConn_10get_error_message(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self, PyObject *__pyx_v_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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_error_message", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":63
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:
 *         return _clean_error_message(self.error_message, encoding)             # <<<<<<<<<<<<<<
 * 
 *     def reset(self) -> None:
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_clean_error_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 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_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_encoding};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__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;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 63, __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(4, 63, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgcancel.pyx":62
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/

  /* 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("psycopg_binary.pq.PGcancelConn.get_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":65
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_13reset = {"reset", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_13reset, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_12reset(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_12reset(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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("reset", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":66
 * 
 *     def reset(self) -> None:
 *         self._ensure_pgcancelconn()             # <<<<<<<<<<<<<<
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
 * 
*/
  __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_ensure_pgcancelconn, __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(4, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":67
 *     def reset(self) -> None:
 *         self._ensure_pgcancelconn()
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def finish(self) -> None:
*/
  PQcancelReset(__pyx_v_self->pgcancelconn_ptr);

  /* "psycopg_binary/pq/pgcancel.pyx":65
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
*/

  /* 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("psycopg_binary.pq.PGcancelConn.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":69
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is not NULL:
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_15finish(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_15finish = {"finish", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_15finish, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_15finish(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finish (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_14finish(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_14finish(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("finish", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":70
 * 
 *     def finish(self) -> None:
 *         if self.pgcancelconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
 *             self.pgcancelconn_ptr = NULL
*/
  __pyx_t_1 = (__pyx_v_self->pgcancelconn_ptr != NULL);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgcancel.pyx":71
 *     def finish(self) -> None:
 *         if self.pgcancelconn_ptr is not NULL:
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 *             self.pgcancelconn_ptr = NULL
 * 
*/
    PQcancelFinish(__pyx_v_self->pgcancelconn_ptr);

    /* "psycopg_binary/pq/pgcancel.pyx":72
 *         if self.pgcancelconn_ptr is not NULL:
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
 *             self.pgcancelconn_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     def _ensure_pgcancelconn(self) -> None:
*/
    __pyx_v_self->pgcancelconn_ptr = NULL;

    /* "psycopg_binary/pq/pgcancel.pyx":70
 * 
 *     def finish(self) -> None:
 *         if self.pgcancelconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
 *             self.pgcancelconn_ptr = NULL
*/
  }

  /* "psycopg_binary/pq/pgcancel.pyx":69
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is not NULL:
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":74
 *             self.pgcancelconn_ptr = NULL
 * 
 *     def _ensure_pgcancelconn(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is NULL:
 *             raise e.OperationalError("the cancel connection is closed")
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_17_ensure_pgcancelconn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_17_ensure_pgcancelconn = {"_ensure_pgcancelconn", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_17_ensure_pgcancelconn, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_17_ensure_pgcancelconn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ensure_pgcancelconn (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_16_ensure_pgcancelconn(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_16_ensure_pgcancelconn(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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_pgcancelconn", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":75
 * 
 *     def _ensure_pgcancelconn(self) -> None:
 *         if self.pgcancelconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the cancel connection is closed")
 * 
*/
  __pyx_t_1 = (__pyx_v_self->pgcancelconn_ptr == NULL);

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgcancel.pyx":76
 *     def _ensure_pgcancelconn(self) -> None:
 *         if self.pgcancelconn_ptr is NULL:
 *             raise e.OperationalError("the cancel connection is closed")             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 76, __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_the_cancel_connection_is_closed};
      __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(4, 76, __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(4, 76, __pyx_L1_error)

    /* "psycopg_binary/pq/pgcancel.pyx":75
 * 
 *     def _ensure_pgcancelconn(self) -> None:
 *         if self.pgcancelconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the cancel connection is closed")
 * 
*/
  }

  /* "psycopg_binary/pq/pgcancel.pyx":74
 *             self.pgcancelconn_ptr = NULL
 * 
 *     def _ensure_pgcancelconn(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is NULL:
 *             raise e.OperationalError("the cancel connection is closed")
*/

  /* 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("psycopg_binary.pq.PGcancelConn._ensure_pgcancelconn", __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_14psycopg_binary_2pq_12PGcancelConn_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_19__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_19__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_18__reduce_cython__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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(2, 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("psycopg_binary.pq.PGcancelConn.__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_14psycopg_binary_2pq_12PGcancelConn_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_21__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_12PGcancelConn_20__setstate_cython__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_12PGcancelConn_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *__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(2, 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("psycopg_binary.pq.PGcancelConn.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":80
 * 
 * cdef class PGcancel:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.pgcancel_ptr = NULL
 * 
*/

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_8PGcancel_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_8PGcancel_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL_TPNEW
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #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
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__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_FASTCALL_TPNEW(__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_14psycopg_binary_2pq_8PGcancel___cinit__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancel *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_8PGcancel___cinit__(struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_self) {
  int __pyx_r;

  /* "psycopg_binary/pq/pgcancel.pyx":81
 * cdef class PGcancel:
 *     def __cinit__(self):
 *         self.pgcancel_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->pgcancel_ptr = NULL;

  /* "psycopg_binary/pq/pgcancel.pyx":80
 * 
 * cdef class PGcancel:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.pgcancel_ptr = NULL
 * 
*/

  /* function exit code */
  __pyx_r = 0;

  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":83
 *         self.pgcancel_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGcancel _from_ptr(libpq.PGcancel *ptr):
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)
*/

static struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_f_14psycopg_binary_2pq_8PGcancel__from_ptr(PGcancel *__pyx_v_ptr) {
  struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_rv = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__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("_from_ptr", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":85
 *     @staticmethod
 *     cdef PGcancel _from_ptr(libpq.PGcancel *ptr):
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)             # <<<<<<<<<<<<<<
 *         rv.pgcancel_ptr = ptr
 *         return rv
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_14psycopg_binary_2pq_PGcancel(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancel), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_14psycopg_binary_2pq_PGcancel *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":86
 *     cdef PGcancel _from_ptr(libpq.PGcancel *ptr):
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)
 *         rv.pgcancel_ptr = ptr             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  __pyx_v_rv->pgcancel_ptr = __pyx_v_ptr;

  /* "psycopg_binary/pq/pgcancel.pyx":87
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)
 *         rv.pgcancel_ptr = ptr
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self) -> None:
*/
  {
    struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pgcancel.pyx":83
 *         self.pgcancel_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGcancel _from_ptr(libpq.PGcancel *ptr):
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PGcancel._from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":89
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.free()
 * 
*/

/* Python wrapper */
static void __pyx_pw_14psycopg_binary_2pq_8PGcancel_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_14psycopg_binary_2pq_8PGcancel_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_14psycopg_binary_2pq_8PGcancel_2__dealloc__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancel *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_14psycopg_binary_2pq_8PGcancel_2__dealloc__(struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_self) {
  __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("__dealloc__", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":90
 * 
 *     def __dealloc__(self) -> None:
 *         self.free()             # <<<<<<<<<<<<<<
 * 
 *     def free(self) -> None:
*/
  __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_free, __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(4, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":89
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.free()
 * 
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("psycopg_binary.pq.PGcancel.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;

  __Pyx_RefNannyFinishContext();
}

/* "psycopg_binary/pq/pgcancel.pyx":92
 *         self.free()
 * 
 *     def free(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGcancel_5free(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGcancel_5free = {"free", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGcancel_5free, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGcancel_5free(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGcancel_4free(((struct __pyx_obj_14psycopg_binary_2pq_PGcancel *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGcancel_4free(struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("free", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":93
 * 
 *     def free(self) -> None:
 *         if self.pgcancel_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
 *             self.pgcancel_ptr = NULL
*/
  __pyx_t_1 = (__pyx_v_self->pgcancel_ptr != NULL);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pgcancel.pyx":94
 *     def free(self) -> None:
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)             # <<<<<<<<<<<<<<
 *             self.pgcancel_ptr = NULL
 * 
*/
    PQfreeCancel(__pyx_v_self->pgcancel_ptr);

    /* "psycopg_binary/pq/pgcancel.pyx":95
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
 *             self.pgcancel_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     def cancel(self) -> None:
*/
    __pyx_v_self->pgcancel_ptr = NULL;

    /* "psycopg_binary/pq/pgcancel.pyx":93
 * 
 *     def free(self) -> None:
 *         if self.pgcancel_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
 *             self.pgcancel_ptr = NULL
*/
  }

  /* "psycopg_binary/pq/pgcancel.pyx":92
 *         self.free()
 * 
 *     def free(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pgcancel.pyx":97
 *             self.pgcancel_ptr = NULL
 * 
 *     def cancel(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGcancel_7cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGcancel_7cancel = {"cancel", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGcancel_7cancel, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGcancel_7cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGcancel_6cancel(((struct __pyx_obj_14psycopg_binary_2pq_PGcancel *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGcancel_6cancel(struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__pyx_v_self) {
  char __pyx_v_buf[256];
  int __pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancel", 0);

  /* "psycopg_binary/pq/pgcancel.pyx":99
 *     def cancel(self) -> None:
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))             # <<<<<<<<<<<<<<
 *         if not res:
 *             raise e.OperationalError(
*/
  __pyx_v_res = PQcancel(__pyx_v_self->pgcancel_ptr, __pyx_v_buf, (sizeof(__pyx_v_buf)));

  /* "psycopg_binary/pq/pgcancel.pyx":100
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
 *         if not res:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"cancel failed: {buf.decode('utf8', 'ignore')}"
*/
  __pyx_t_1 = (!(__pyx_v_res != 0));

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pgcancel.pyx":101
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
 *         if not res:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"cancel failed: {buf.decode('utf8', 'ignore')}"
 *             )
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_binary/pq/pgcancel.pyx":102
 *         if not res:
 *             raise e.OperationalError(
 *                 f"cancel failed: {buf.decode('utf8', 'ignore')}"             # <<<<<<<<<<<<<<
 *             )
*/
    __pyx_t_6 = __Pyx_ssize_strlen(__pyx_v_buf); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(4, 102, __pyx_L1_error)
    __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_buf, 0, __pyx_t_6, NULL, __pyx_k_ignore, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_cancel_failed, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __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_7};
      __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_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 101, __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(4, 101, __pyx_L1_error)

    /* "psycopg_binary/pq/pgcancel.pyx":100
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
 *         if not res:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"cancel failed: {buf.decode('utf8', 'ignore')}"
*/
  }

  /* "psycopg_binary/pq/pgcancel.pyx":97
 *             self.pgcancel_ptr = NULL
 * 
 *     def cancel(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_binary.pq.PGcancel.cancel", __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_14psycopg_binary_2pq_8PGcancel_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGcancel_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGcancel_9__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGcancel_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGcancel_8__reduce_cython__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancel *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGcancel_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__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(2, 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("psycopg_binary.pq.PGcancel.__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_14psycopg_binary_2pq_8PGcancel_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PGcancel_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGcancel_11__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PGcancel_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PGcancel_10__setstate_cython__(((struct __pyx_obj_14psycopg_binary_2pq_PGcancel *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PGcancel_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PGcancel *__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(2, 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("psycopg_binary.pq.PGcancel.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/conninfo.pyx":11
 * 
 * class Conninfo:
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_defaults(cls) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Conninfo_1get_defaults(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8Conninfo_1get_defaults = {"get_defaults", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Conninfo_1get_defaults, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Conninfo_1get_defaults(PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_defaults (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8Conninfo_get_defaults(__pyx_self, ((PyObject *)__pyx_v_cls));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8Conninfo_get_defaults(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls) {
  PQconninfoOption *__pyx_v_opts;
  PyObject *__pyx_v_rv = NULL;
  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("get_defaults", 0);

  /* "psycopg_binary/pq/conninfo.pyx":13
 *     @classmethod
 *     def get_defaults(cls) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()             # <<<<<<<<<<<<<<
 *         if opts is NULL :
 *             raise MemoryError("couldn't allocate connection defaults")
*/
  __pyx_v_opts = PQconndefaults();

  /* "psycopg_binary/pq/conninfo.pyx":14
 *     def get_defaults(cls) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 *         if opts is NULL :             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate connection defaults")
 *         rv = _options_from_array(opts)
*/
  __pyx_t_1 = (__pyx_v_opts == NULL);

  if (unlikely(__pyx_t_1)) {


    /* "psycopg_binary/pq/conninfo.pyx":15
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 *         if opts is NULL :
 *             raise MemoryError("couldn't allocate connection defaults")             # <<<<<<<<<<<<<<
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_connection_def};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 15, __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(5, 15, __pyx_L1_error)

    /* "psycopg_binary/pq/conninfo.pyx":14
 *     def get_defaults(cls) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 *         if opts is NULL :             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate connection defaults")
 *         rv = _options_from_array(opts)
*/
  }

  /* "psycopg_binary/pq/conninfo.pyx":16
 *         if opts is NULL :
 *             raise MemoryError("couldn't allocate connection defaults")
 *         rv = _options_from_array(opts)             # <<<<<<<<<<<<<<
 *         libpq.PQconninfoFree(opts)
 *         return rv
*/
  __pyx_t_2 = __pyx_f_14psycopg_binary_2pq__options_from_array(__pyx_v_opts); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "psycopg_binary/pq/conninfo.pyx":17
 *             raise MemoryError("couldn't allocate connection defaults")
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQconninfoFree(__pyx_v_opts);

  /* "psycopg_binary/pq/conninfo.pyx":18
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_2 = __pyx_v_rv;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(5, 18, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/conninfo.pyx":11
 * 
 * class Conninfo:
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_defaults(cls) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_binary.pq.Conninfo.get_defaults", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;

  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/conninfo.pyx":20
 *         return rv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(cls, const char *conninfo) -> list[ConninfoOption]:
 *         cdef char *errmsg = NULL
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Conninfo_3parse(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_8Conninfo_3parse = {"parse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_8Conninfo_3parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Conninfo_3parse(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_cls = 0;
  char const *__pyx_v_conninfo;
  #if !CYTHON_VECTORCALL
  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("parse (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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_cls,&__pyx_mstate_global->__pyx_n_u_conninfo,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(5, 20, __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(5, 20, __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(5, 20, __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, "parse", 0) < (0)) __PYX_ERR(5, 20, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, i); __PYX_ERR(5, 20, __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(5, 20, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 20, __pyx_L3_error)
    }
    __pyx_v_cls = values[0];
    __pyx_v_conninfo = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(5, 21, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, __pyx_nargs); __PYX_ERR(5, 20, __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("psycopg_binary.pq.Conninfo.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8Conninfo_2parse(__pyx_self, __pyx_v_cls, __pyx_v_conninfo);

  /* 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_14psycopg_binary_2pq_8Conninfo_2parse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, char const *__pyx_v_conninfo) {
  char *__pyx_v_errmsg;
  PQconninfoOption *__pyx_v_opts;
  PyObject *__pyx_v_exc = NULL;
  PyObject *__pyx_v_rv = NULL;
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse", 0);

  /* "psycopg_binary/pq/conninfo.pyx":22
 *     @classmethod
 *     def parse(cls, const char *conninfo) -> list[ConninfoOption]:
 *         cdef char *errmsg = NULL             # <<<<<<<<<<<<<<
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)
 *         if opts is NULL:
*/
  __pyx_v_errmsg = NULL;

  /* "psycopg_binary/pq/conninfo.pyx":23
 *     def parse(cls, const char *conninfo) -> list[ConninfoOption]:
 *         cdef char *errmsg = NULL
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)             # <<<<<<<<<<<<<<
 *         if opts is NULL:
 *             if errmsg is NULL:
*/
  __pyx_v_opts = PQconninfoParse(__pyx_v_conninfo, (&__pyx_v_errmsg));

  /* "psycopg_binary/pq/conninfo.pyx":24
 *         cdef char *errmsg = NULL
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)
 *         if opts is NULL:             # <<<<<<<<<<<<<<
 *             if errmsg is NULL:
 *                 raise MemoryError("couldn't allocate on conninfo parse")
*/
  __pyx_t_1 = (__pyx_v_opts == NULL);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/conninfo.pyx":25
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)
 *         if opts is NULL:
 *             if errmsg is NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError("couldn't allocate on conninfo parse")
 *             else:
*/
    __pyx_t_1 = (__pyx_v_errmsg == NULL);

    if (unlikely(__pyx_t_1)) {


      /* "psycopg_binary/pq/conninfo.pyx":26
 *         if opts is NULL:
 *             if errmsg is NULL:
 *                 raise MemoryError("couldn't allocate on conninfo parse")             # <<<<<<<<<<<<<<
 *             else:
 *                 exc = e.OperationalError(errmsg.decode("utf8", "replace"))
*/
      __pyx_t_3 = NULL;
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_on_conninfo_pa};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __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;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 26, __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(5, 26, __pyx_L1_error)

      /* "psycopg_binary/pq/conninfo.pyx":25
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)
 *         if opts is NULL:
 *             if errmsg is NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError("couldn't allocate on conninfo parse")
 *             else:
*/
    }

    /* "psycopg_binary/pq/conninfo.pyx":28
 *                 raise MemoryError("couldn't allocate on conninfo parse")
 *             else:
 *                 exc = e.OperationalError(errmsg.decode("utf8", "replace"))             # <<<<<<<<<<<<<<
 *                 libpq.PQfreemem(errmsg)
 *                 raise exc
*/
    /*else*/ {
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_ssize_strlen(__pyx_v_errmsg); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(5, 28, __pyx_L1_error)
      __pyx_t_5 = __Pyx_decode_c_string(__pyx_v_errmsg, 0, __pyx_t_7, NULL, __pyx_k_replace, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      __pyx_t_4 = 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_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __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_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 28, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_v_exc = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "psycopg_binary/pq/conninfo.pyx":29
 *             else:
 *                 exc = e.OperationalError(errmsg.decode("utf8", "replace"))
 *                 libpq.PQfreemem(errmsg)             # <<<<<<<<<<<<<<
 *                 raise exc
 * 
*/
      PQfreemem(__pyx_v_errmsg);

      /* "psycopg_binary/pq/conninfo.pyx":30
 *                 exc = e.OperationalError(errmsg.decode("utf8", "replace"))
 *                 libpq.PQfreemem(errmsg)
 *                 raise exc             # <<<<<<<<<<<<<<
 * 
 *         rv = _options_from_array(opts)
*/
      __Pyx_Raise(__pyx_v_exc, 0, 0, 0);
      __PYX_ERR(5, 30, __pyx_L1_error)
    }

    /* "psycopg_binary/pq/conninfo.pyx":24
 *         cdef char *errmsg = NULL
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)
 *         if opts is NULL:             # <<<<<<<<<<<<<<
 *             if errmsg is NULL:
 *                 raise MemoryError("couldn't allocate on conninfo parse")
*/
  }

  /* "psycopg_binary/pq/conninfo.pyx":32
 *                 raise exc
 * 
 *         rv = _options_from_array(opts)             # <<<<<<<<<<<<<<
 *         libpq.PQconninfoFree(opts)
 *         return rv
*/
  __pyx_t_2 = __pyx_f_14psycopg_binary_2pq__options_from_array(__pyx_v_opts); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "psycopg_binary/pq/conninfo.pyx":33
 * 
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQconninfoFree(__pyx_v_opts);

  /* "psycopg_binary/pq/conninfo.pyx":34
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_2 = __pyx_v_rv;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(5, 34, __pyx_L1_error)
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = ((PyObject*)__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/conninfo.pyx":20
 *         return rv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(cls, const char *conninfo) -> list[ConninfoOption]:
 *         cdef char *errmsg = NULL
*/

  /* 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("psycopg_binary.pq.Conninfo.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;


  __Pyx_XDECREF(__pyx_v_exc);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/conninfo.pyx":36
 *         return rv
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Conninfo_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8Conninfo_5__repr__ = {"__repr__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Conninfo_5__repr__, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Conninfo_5__repr__(PyObject *__pyx_self, 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_14psycopg_binary_2pq_8Conninfo_4__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8Conninfo_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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[5];
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_binary/pq/conninfo.pyx":37
 * 
 *     def __repr__(self):
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_keyword); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_4[1] = __pyx_t_2;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__12;
  __pyx_t_4[3] = __pyx_t_3;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__13;
  __pyx_t_5 = 5;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[3]);
  #endif
  __pyx_t_6 = 0;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[3]);
  #endif
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6);
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/conninfo.pyx":36
 *         return rv
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_binary.pq.Conninfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/conninfo.pyx":40
 * 
 * 
 * cdef _options_from_array(libpq.PQconninfoOption *opts):             # <<<<<<<<<<<<<<
 *     rv = []
 *     cdef int i = 0
*/

static PyObject *__pyx_f_14psycopg_binary_2pq__options_from_array(PQconninfoOption *__pyx_v_opts) {
  PyObject *__pyx_v_rv = NULL;
  int __pyx_v_i;
  PQconninfoOption *__pyx_v_opt;
  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;
  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;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_options_from_array", 0);

  /* "psycopg_binary/pq/conninfo.pyx":41
 * 
 * cdef _options_from_array(libpq.PQconninfoOption *opts):
 *     rv = []             # <<<<<<<<<<<<<<
 *     cdef int i = 0
 *     cdef libpq.PQconninfoOption* opt
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/conninfo.pyx":42
 * cdef _options_from_array(libpq.PQconninfoOption *opts):
 *     rv = []
 *     cdef int i = 0             # <<<<<<<<<<<<<<
 *     cdef libpq.PQconninfoOption* opt
 *     while True:
*/
  __pyx_v_i = 0;

  /* "psycopg_binary/pq/conninfo.pyx":44
 *     cdef int i = 0
 *     cdef libpq.PQconninfoOption* opt
 *     while True:             # <<<<<<<<<<<<<<
 *         opt = opts + i
 *         if opt.keyword is NULL:
*/
  while (1) {

    /* "psycopg_binary/pq/conninfo.pyx":45
 *     cdef libpq.PQconninfoOption* opt
 *     while True:
 *         opt = opts + i             # <<<<<<<<<<<<<<
 *         if opt.keyword is NULL:
 *             break
*/
    __pyx_v_opt = (__pyx_v_opts + __pyx_v_i);

    /* "psycopg_binary/pq/conninfo.pyx":46
 *     while True:
 *         opt = opts + i
 *         if opt.keyword is NULL:             # <<<<<<<<<<<<<<
 *             break
 *         rv.append(
*/
    __pyx_t_2 = (__pyx_v_opt->keyword == NULL);

    if (__pyx_t_2) {


      /* "psycopg_binary/pq/conninfo.pyx":47
 *         opt = opts + i
 *         if opt.keyword is NULL:
 *             break             # <<<<<<<<<<<<<<
 *         rv.append(
 *             ConninfoOption(
*/
      goto __pyx_L4_break;

      /* "psycopg_binary/pq/conninfo.pyx":46
 *     while True:
 *         opt = opts + i
 *         if opt.keyword is NULL:             # <<<<<<<<<<<<<<
 *             break
 *         rv.append(
*/
    }

    /* "psycopg_binary/pq/conninfo.pyx":49
 *             break
 *         rv.append(
 *             ConninfoOption(             # <<<<<<<<<<<<<<
 *                 keyword=opt.keyword,
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ConninfoOption); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "psycopg_binary/pq/conninfo.pyx":50
 *         rv.append(
 *             ConninfoOption(
 *                 keyword=opt.keyword,             # <<<<<<<<<<<<<<
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,
 *                 compiled=opt.compiled if opt.compiled is not NULL else None,
*/
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_opt->keyword); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "psycopg_binary/pq/conninfo.pyx":51
 *             ConninfoOption(
 *                 keyword=opt.keyword,
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,             # <<<<<<<<<<<<<<
 *                 compiled=opt.compiled if opt.compiled is not NULL else None,
 *                 val=opt.val if opt.val is not NULL else None,
*/
    __pyx_t_2 = (__pyx_v_opt->envvar != NULL);

    if (__pyx_t_2) {
      __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_opt->envvar); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 51, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __pyx_t_7;
      __pyx_t_7 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_6 = Py_None;
    }


    /* "psycopg_binary/pq/conninfo.pyx":52
 *                 keyword=opt.keyword,
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,
 *                 compiled=opt.compiled if opt.compiled is not NULL else None,             # <<<<<<<<<<<<<<
 *                 val=opt.val if opt.val is not NULL else None,
 *                 label=opt.label if opt.label is not NULL else None,
*/
    __pyx_t_2 = (__pyx_v_opt->compiled != NULL);

    if (__pyx_t_2) {
      __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_opt->compiled); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __pyx_t_8;
      __pyx_t_8 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_7 = Py_None;
    }


    /* "psycopg_binary/pq/conninfo.pyx":53
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,
 *                 compiled=opt.compiled if opt.compiled is not NULL else None,
 *                 val=opt.val if opt.val is not NULL else None,             # <<<<<<<<<<<<<<
 *                 label=opt.label if opt.label is not NULL else None,
 *                 dispchar=opt.dispchar if opt.dispchar is not NULL else None,
*/
    __pyx_t_2 = (__pyx_v_opt->val != NULL);

    if (__pyx_t_2) {
      __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_opt->val); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_8 = Py_None;
    }


    /* "psycopg_binary/pq/conninfo.pyx":54
 *                 compiled=opt.compiled if opt.compiled is not NULL else None,
 *                 val=opt.val if opt.val is not NULL else None,
 *                 label=opt.label if opt.label is not NULL else None,             # <<<<<<<<<<<<<<
 *                 dispchar=opt.dispchar if opt.dispchar is not NULL else None,
 *                 dispsize=opt.dispsize,
*/
    __pyx_t_2 = (__pyx_v_opt->label != NULL);

    if (__pyx_t_2) {
      __pyx_t_10 = __Pyx_PyBytes_FromString(__pyx_v_opt->label); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __pyx_t_10;
      __pyx_t_10 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_9 = Py_None;
    }


    /* "psycopg_binary/pq/conninfo.pyx":55
 *                 val=opt.val if opt.val is not NULL else None,
 *                 label=opt.label if opt.label is not NULL else None,
 *                 dispchar=opt.dispchar if opt.dispchar is not NULL else None,             # <<<<<<<<<<<<<<
 *                 dispsize=opt.dispsize,
 *             )
*/
    __pyx_t_2 = (__pyx_v_opt->dispchar != NULL);

    if (__pyx_t_2) {
      __pyx_t_11 = __Pyx_PyBytes_FromString(__pyx_v_opt->dispchar); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 55, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = __pyx_t_11;
      __pyx_t_11 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_10 = Py_None;
    }


    /* "psycopg_binary/pq/conninfo.pyx":56
 *                 label=opt.label if opt.label is not NULL else None,
 *                 dispchar=opt.dispchar if opt.dispchar is not NULL else None,
 *                 dispsize=opt.dispsize,             # <<<<<<<<<<<<<<
 *             )
 *         )
*/
    __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_opt->dispsize); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = 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_12 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[8] = {__pyx_t_3, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11};
      #if CYTHON_VECTORCALL
      __pyx_t_13 = __pyx_mstate_global->__pyx_tuple[1];
      if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 49, __pyx_L1_error)
      __Pyx_INCREF(__pyx_t_13);
      #else
      {
        PyObject *__pyx_temp[7] = {__pyx_mstate_global->__pyx_n_u_keyword, __pyx_mstate_global->__pyx_n_u_envvar, __pyx_mstate_global->__pyx_n_u_compiled, __pyx_mstate_global->__pyx_n_u_val, __pyx_mstate_global->__pyx_n_u_label, __pyx_mstate_global->__pyx_n_u_dispchar, __pyx_mstate_global->__pyx_n_u_dispsize};
        __pyx_t_13 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 7);
        if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 49, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
      }
      #endif
      __pyx_t_1 = __Pyx_Object_VectorcallKwds((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_13);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 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_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }

    /* "psycopg_binary/pq/conninfo.pyx":48
 *         if opt.keyword is NULL:
 *             break
 *         rv.append(             # <<<<<<<<<<<<<<
 *             ConninfoOption(
 *                 keyword=opt.keyword,
*/
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(5, 48, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;


    /* "psycopg_binary/pq/conninfo.pyx":59
 *             )
 *         )
 *         i += 1             # <<<<<<<<<<<<<<
 * 
 *     return rv
*/
    __pyx_v_i = (__pyx_v_i + 1);
  }
  __pyx_L4_break:;

  /* "psycopg_binary/pq/conninfo.pyx":61
 *         i += 1
 * 
 *     return rv             # <<<<<<<<<<<<<<
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/conninfo.pyx":40
 * 
 * 
 * cdef _options_from_array(libpq.PQconninfoOption *opts):             # <<<<<<<<<<<<<<
 *     rv = []
 *     cdef int i = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_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_13);
  __Pyx_AddTraceback("psycopg_binary.pq._options_from_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);


  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/escaping.pyx":12
 * 
 * cdef class Escaping:
 *     def __init__(self, PGconn conn = None):             # <<<<<<<<<<<<<<
 *         self.conn = conn
 * 
*/

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_8Escaping_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_8Escaping_1__init__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_conn = 0;
  #if !CYTHON_VECTORCALL_TPNEW
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #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
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_conn,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(6, 12, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 12, __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(6, 12, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 12, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)Py_None));
    }
    __pyx_v_conn = ((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(6, 12, __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("psycopg_binary.pq.Escaping.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, 1, "conn", 0))) __PYX_ERR(6, 12, __pyx_L1_error)
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8Escaping___init__(((struct __pyx_obj_14psycopg_binary_2pq_Escaping *)__pyx_v_self), __pyx_v_conn);

  /* 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_14psycopg_binary_2pq_8Escaping___init__(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, struct __pyx_obj_14psycopg_binary_2pq_PGconn *__pyx_v_conn) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "psycopg_binary/pq/escaping.pyx":13
 * cdef class Escaping:
 *     def __init__(self, PGconn conn = None):
 *         self.conn = conn             # <<<<<<<<<<<<<<
 * 
 *     cpdef escape_literal(self, data):
*/
  __Pyx_INCREF((PyObject *)__pyx_v_conn);
  __Pyx_GIVEREF((PyObject *)__pyx_v_conn);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->conn);
  __Pyx_DECREF((PyObject *)__pyx_v_self->conn);
  __pyx_v_self->conn = __pyx_v_conn;

  /* "psycopg_binary/pq/escaping.pyx":12
 * 
 * cdef class Escaping:
 *     def __init__(self, PGconn conn = None):             # <<<<<<<<<<<<<<
 *         self.conn = conn
 * 
*/

  /* function exit code */
  __pyx_r = 0;

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/escaping.pyx":15
 *         self.conn = conn
 * 
 *     cpdef escape_literal(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
*/

static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_3escape_literal(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_8Escaping_escape_literal(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) {
  char *__pyx_v_out;
  char *__pyx_v_ptr;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_rv = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_literal", 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_14psycopg_binary_2pq_Escaping &&
  __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_escape_literal); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_14psycopg_binary_2pq_8Escaping_3escape_literal)) {
        __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, __pyx_v_data};
          __pyx_t_2 = __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_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 15, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        {
          PyObject *__pyx_temp;
          {
            __pyx_temp = __pyx_r;
            __pyx_r = __pyx_t_2;
          }
          __Pyx_XDECREF(__pyx_temp);
        }
        __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
  }

  /* "psycopg_binary/pq/escaping.pyx":20
 *         cdef Py_ssize_t length
 * 
 *         if self.conn is None:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("escape_literal failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
*/
  __pyx_t_6 = (((PyObject *)__pyx_v_self->conn) == Py_None);
  if (unlikely(__pyx_t_6)) {


    /* "psycopg_binary/pq/escaping.pyx":21
 * 
 *         if self.conn is None:
 *             raise e.OperationalError("escape_literal failed: no connection provided")             # <<<<<<<<<<<<<<
 *         if self.conn._pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 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_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_escape_literal_failed_no_connect};
      __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_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 21, __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(6, 21, __pyx_L1_error)

    /* "psycopg_binary/pq/escaping.pyx":20
 *         cdef Py_ssize_t length
 * 
 *         if self.conn is None:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("escape_literal failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
*/
  }

  /* "psycopg_binary/pq/escaping.pyx":22
 *         if self.conn is None:
 *             raise e.OperationalError("escape_literal failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
*/
  __pyx_t_6 = (__pyx_v_self->conn->_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_6)) {


    /* "psycopg_binary/pq/escaping.pyx":23
 *             raise e.OperationalError("escape_literal failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __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_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __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_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 23, __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(6, 23, __pyx_L1_error)

    /* "psycopg_binary/pq/escaping.pyx":22
 *         if self.conn is None:
 *             raise e.OperationalError("escape_literal failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
*/
  }

  /* "psycopg_binary/pq/escaping.pyx":25
 *             raise e.OperationalError("the connection is closed")
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
*/
  __pyx_t_7 = __pyx_f_14psycopg_binary_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 25, __pyx_L1_error)


  /* "psycopg_binary/pq/escaping.pyx":27
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)             # <<<<<<<<<<<<<<
 *         if out is NULL:
 *             raise e.OperationalError(
*/
  __pyx_v_out = PQescapeLiteral(__pyx_v_self->conn->_pgconn_ptr, __pyx_v_ptr, __pyx_v_length);

  /* "psycopg_binary/pq/escaping.pyx":28
 * 
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_literal failed: {self.conn.get_error_message()}"
*/
  __pyx_t_6 = (__pyx_v_out == NULL);

  if (unlikely(__pyx_t_6)) {


    /* "psycopg_binary/pq/escaping.pyx":29
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"escape_literal failed: {self.conn.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_binary/pq/escaping.pyx":30
 *         if out is NULL:
 *             raise e.OperationalError(
 *                 f"escape_literal failed: {self.conn.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self->conn);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_5, (1-__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(6, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_escape_literal_failed, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_t_3};
      __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_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 29, __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(6, 29, __pyx_L1_error)

    /* "psycopg_binary/pq/escaping.pyx":28
 * 
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_literal failed: {self.conn.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/escaping.pyx":33
 *             )
 * 
 *         rv = out[:strlen(out)]             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_out + 0, strlen(__pyx_v_out) - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/escaping.pyx":34
 * 
 *         rv = out[:strlen(out)]
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQfreemem(__pyx_v_out);

  /* "psycopg_binary/pq/escaping.pyx":35
 *         rv = out[:strlen(out)]
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     cpdef escape_identifier(self, data):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/escaping.pyx":15
 *         self.conn = conn
 * 
 *     cpdef escape_literal(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
*/

  /* 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_8);
  __Pyx_AddTraceback("psycopg_binary.pq.Escaping.escape_literal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;



  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_3escape_literal(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8Escaping_3escape_literal = {"escape_literal", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Escaping_3escape_literal, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_3escape_literal(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_literal (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8Escaping_2escape_literal(((struct __pyx_obj_14psycopg_binary_2pq_Escaping *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_2escape_literal(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__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("escape_literal", 0);
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq_8Escaping_escape_literal(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.Escaping.escape_literal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/escaping.pyx":37
 *         return rv
 * 
 *     cpdef escape_identifier(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
*/

static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_5escape_identifier(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_8Escaping_escape_identifier(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) {
  char *__pyx_v_out;
  char *__pyx_v_ptr;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_rv = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_identifier", 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_14psycopg_binary_2pq_Escaping &&
  __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_escape_identifier); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_14psycopg_binary_2pq_8Escaping_5escape_identifier)) {
        __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, __pyx_v_data};
          __pyx_t_2 = __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_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 37, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        {
          PyObject *__pyx_temp;
          {
            __pyx_temp = __pyx_r;
            __pyx_r = __pyx_t_2;
          }
          __Pyx_XDECREF(__pyx_temp);
        }
        __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
  }

  /* "psycopg_binary/pq/escaping.pyx":42
 *         cdef Py_ssize_t length
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         if self.conn is None:
*/
  __pyx_t_6 = __pyx_f_14psycopg_binary_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 42, __pyx_L1_error)


  /* "psycopg_binary/pq/escaping.pyx":44
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         if self.conn is None:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("escape_identifier failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
*/
  __pyx_t_7 = (((PyObject *)__pyx_v_self->conn) == Py_None);
  if (unlikely(__pyx_t_7)) {


    /* "psycopg_binary/pq/escaping.pyx":45
 * 
 *         if self.conn is None:
 *             raise e.OperationalError("escape_identifier failed: no connection provided")             # <<<<<<<<<<<<<<
 *         if self.conn._pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 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_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_escape_identifier_failed_no_conn};
      __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_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 45, __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(6, 45, __pyx_L1_error)

    /* "psycopg_binary/pq/escaping.pyx":44
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         if self.conn is None:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("escape_identifier failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
*/
  }

  /* "psycopg_binary/pq/escaping.pyx":46
 *         if self.conn is None:
 *             raise e.OperationalError("escape_identifier failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
*/
  __pyx_t_7 = (__pyx_v_self->conn->_pgconn_ptr == NULL);

  if (unlikely(__pyx_t_7)) {


    /* "psycopg_binary/pq/escaping.pyx":47
 *             raise e.OperationalError("escape_identifier failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __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_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __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_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 47, __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(6, 47, __pyx_L1_error)

    /* "psycopg_binary/pq/escaping.pyx":46
 *         if self.conn is None:
 *             raise e.OperationalError("escape_identifier failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
*/
  }

  /* "psycopg_binary/pq/escaping.pyx":49
 *             raise e.OperationalError("the connection is closed")
 * 
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)             # <<<<<<<<<<<<<<
 *         if out is NULL:
 *             raise e.OperationalError(
*/
  __pyx_v_out = PQescapeIdentifier(__pyx_v_self->conn->_pgconn_ptr, __pyx_v_ptr, __pyx_v_length);

  /* "psycopg_binary/pq/escaping.pyx":50
 * 
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_identifier failed: {self.conn.get_error_message()}"
*/
  __pyx_t_7 = (__pyx_v_out == NULL);

  if (unlikely(__pyx_t_7)) {


    /* "psycopg_binary/pq/escaping.pyx":51
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"escape_identifier failed: {self.conn.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_binary/pq/escaping.pyx":52
 *         if out is NULL:
 *             raise e.OperationalError(
 *                 f"escape_identifier failed: {self.conn.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self->conn);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_5, (1-__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(6, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_escape_identifier_failed, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_t_3};
      __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_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 51, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 51, __pyx_L1_error)

    /* "psycopg_binary/pq/escaping.pyx":50
 * 
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_identifier failed: {self.conn.get_error_message()}"
*/
  }

  /* "psycopg_binary/pq/escaping.pyx":55
 *             )
 * 
 *         rv = out[:strlen(out)]             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_out + 0, strlen(__pyx_v_out) - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/escaping.pyx":56
 * 
 *         rv = out[:strlen(out)]
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQfreemem(__pyx_v_out);

  /* "psycopg_binary/pq/escaping.pyx":57
 *         rv = out[:strlen(out)]
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     cpdef escape_string(self, data):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/escaping.pyx":37
 *         return rv
 * 
 *     cpdef escape_identifier(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
*/

  /* 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_8);
  __Pyx_AddTraceback("psycopg_binary.pq.Escaping.escape_identifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;



  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_5escape_identifier(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8Escaping_5escape_identifier = {"escape_identifier", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Escaping_5escape_identifier, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_5escape_identifier(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_identifier (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8Escaping_4escape_identifier(((struct __pyx_obj_14psycopg_binary_2pq_Escaping *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_4escape_identifier(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__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("escape_identifier", 0);
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq_8Escaping_escape_identifier(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.Escaping.escape_identifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/escaping.pyx":59
 *         return rv
 * 
 *     cpdef escape_string(self, data):             # <<<<<<<<<<<<<<
 *         cdef int error
 *         cdef size_t len_out
*/

static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_7escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_8Escaping_escape_string(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) {
  int __pyx_v_error;
  size_t __pyx_v_len_out;
  char *__pyx_v_ptr;
  char *__pyx_v_buf_out;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_rv = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_string", 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_14psycopg_binary_2pq_Escaping &&
  __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_escape_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 59, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_14psycopg_binary_2pq_8Escaping_7escape_string)) {
        __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, __pyx_v_data};
          __pyx_t_2 = __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_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 59, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        {
          PyObject *__pyx_temp;
          {
            __pyx_temp = __pyx_r;
            __pyx_r = __pyx_t_2;
          }
          __Pyx_XDECREF(__pyx_temp);
        }
        __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
  }

  /* "psycopg_binary/pq/escaping.pyx":66
 *         cdef Py_ssize_t length
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         if self.conn is not None:
*/
  __pyx_t_6 = __pyx_f_14psycopg_binary_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 66, __pyx_L1_error)


  /* "psycopg_binary/pq/escaping.pyx":68
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")
*/
  __pyx_t_7 = (((PyObject *)__pyx_v_self->conn) != Py_None);
  if (__pyx_t_7) {


    /* "psycopg_binary/pq/escaping.pyx":69
 * 
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError("the connection is closed")
 * 
*/
    __pyx_t_7 = (__pyx_v_self->conn->_pgconn_ptr == NULL);

    if (unlikely(__pyx_t_7)) {


      /* "psycopg_binary/pq/escaping.pyx":70
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *             buf_out = <char *>PyMem_Malloc(length * 2 + 1)
*/
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 70, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 70, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = 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_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
        __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_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 70, __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(6, 70, __pyx_L1_error)

      /* "psycopg_binary/pq/escaping.pyx":69
 * 
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError("the connection is closed")
 * 
*/
    }

    /* "psycopg_binary/pq/escaping.pyx":72
 *                 raise e.OperationalError("the connection is closed")
 * 
 *             buf_out = <char *>PyMem_Malloc(length * 2 + 1)             # <<<<<<<<<<<<<<
 *             len_out = libpq.PQescapeStringConn(
 *                 self.conn._pgconn_ptr, buf_out, ptr, length, &error
*/
    __pyx_v_buf_out = ((char *)PyMem_Malloc(((__pyx_v_length * 2) + 1)));

    /* "psycopg_binary/pq/escaping.pyx":73
 * 
 *             buf_out = <char *>PyMem_Malloc(length * 2 + 1)
 *             len_out = libpq.PQescapeStringConn(             # <<<<<<<<<<<<<<
 *                 self.conn._pgconn_ptr, buf_out, ptr, length, &error
 *             )
*/
    __pyx_v_len_out = PQescapeStringConn(__pyx_v_self->conn->_pgconn_ptr, __pyx_v_buf_out, __pyx_v_ptr, __pyx_v_length, (&__pyx_v_error));

    /* "psycopg_binary/pq/escaping.pyx":76
 *                 self.conn._pgconn_ptr, buf_out, ptr, length, &error
 *             )
 *             if error:             # <<<<<<<<<<<<<<
 *                 PyMem_Free(buf_out)
 *                 raise e.OperationalError(
*/
    __pyx_t_7 = (__pyx_v_error != 0);

    if (unlikely(__pyx_t_7)) {


      /* "psycopg_binary/pq/escaping.pyx":77
 *             )
 *             if error:
 *                 PyMem_Free(buf_out)             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError(
 *                     f"escape_string failed: {self.conn.get_error_message()}"
*/
      PyMem_Free(__pyx_v_buf_out);

      /* "psycopg_binary/pq/escaping.pyx":78
 *             if error:
 *                 PyMem_Free(buf_out)
 *                 raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                     f"escape_string failed: {self.conn.get_error_message()}"
 *                 )
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 78, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 78, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "psycopg_binary/pq/escaping.pyx":79
 *                 PyMem_Free(buf_out)
 *                 raise e.OperationalError(
 *                     f"escape_string failed: {self.conn.get_error_message()}"             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
      __pyx_t_8 = ((PyObject *)__pyx_v_self->conn);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 79, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_escape_string_failed, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __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(6, 78, __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(6, 78, __pyx_L1_error)

      /* "psycopg_binary/pq/escaping.pyx":76
 *                 self.conn._pgconn_ptr, buf_out, ptr, length, &error
 *             )
 *             if error:             # <<<<<<<<<<<<<<
 *                 PyMem_Free(buf_out)
 *                 raise e.OperationalError(
*/
    }

    /* "psycopg_binary/pq/escaping.pyx":68
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")
*/
    goto __pyx_L3;
  }

  /* "psycopg_binary/pq/escaping.pyx":83
 * 
 *         else:
 *             buf_out = <char *>PyMem_Malloc(length * 2 + 1)             # <<<<<<<<<<<<<<
 *             len_out = libpq.PQescapeString(buf_out, ptr, length)
 * 
*/
  /*else*/ {
    __pyx_v_buf_out = ((char *)PyMem_Malloc(((__pyx_v_length * 2) + 1)));

    /* "psycopg_binary/pq/escaping.pyx":84
 *         else:
 *             buf_out = <char *>PyMem_Malloc(length * 2 + 1)
 *             len_out = libpq.PQescapeString(buf_out, ptr, length)             # <<<<<<<<<<<<<<
 * 
 *         rv = buf_out[:len_out]
*/
    __pyx_v_len_out = PQescapeString(__pyx_v_buf_out, __pyx_v_ptr, __pyx_v_length);
  }
  __pyx_L3:;

  /* "psycopg_binary/pq/escaping.pyx":86
 *             len_out = libpq.PQescapeString(buf_out, ptr, length)
 * 
 *         rv = buf_out[:len_out]             # <<<<<<<<<<<<<<
 *         PyMem_Free(buf_out)
 *         return rv
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_buf_out + 0, __pyx_v_len_out - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/escaping.pyx":87
 * 
 *         rv = buf_out[:len_out]
 *         PyMem_Free(buf_out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PyMem_Free(__pyx_v_buf_out);

  /* "psycopg_binary/pq/escaping.pyx":88
 *         rv = buf_out[:len_out]
 *         PyMem_Free(buf_out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     cpdef escape_bytea(self, data):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/escaping.pyx":59
 *         return rv
 * 
 *     cpdef escape_string(self, data):             # <<<<<<<<<<<<<<
 *         cdef int error
 *         cdef size_t len_out
*/

  /* 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_8);
  __Pyx_AddTraceback("psycopg_binary.pq.Escaping.escape_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;





  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_7escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8Escaping_7escape_string = {"escape_string", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Escaping_7escape_string, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_7escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_string (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8Escaping_6escape_string(((struct __pyx_obj_14psycopg_binary_2pq_Escaping *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_6escape_string(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__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("escape_string", 0);
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq_8Escaping_escape_string(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.Escaping.escape_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/escaping.pyx":90
 *         return rv
 * 
 *     cpdef escape_bytea(self, data):             # <<<<<<<<<<<<<<
 *         cdef size_t len_out
 *         cdef unsigned char *out
*/

static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_9escape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_8Escaping_escape_bytea(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) {
  size_t __pyx_v_len_out;
  unsigned char *__pyx_v_out;
  char *__pyx_v_ptr;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_rv = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_bytea", 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_14psycopg_binary_2pq_Escaping &&
  __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_escape_bytea); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_14psycopg_binary_2pq_8Escaping_9escape_bytea)) {
        __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, __pyx_v_data};
          __pyx_t_2 = __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_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 90, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        {
          PyObject *__pyx_temp;
          {
            __pyx_temp = __pyx_r;
            __pyx_r = __pyx_t_2;
          }
          __Pyx_XDECREF(__pyx_temp);
        }
        __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
  }

  /* "psycopg_binary/pq/escaping.pyx":96
 *         cdef Py_ssize_t length
 * 
 *         if self.conn is not None and self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
*/
  __pyx_t_7 = (((PyObject *)__pyx_v_self->conn) != Py_None);
  if (__pyx_t_7) {

  } else {

    __pyx_t_6 = __pyx_t_7;

    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_self->conn->_pgconn_ptr == NULL);


  __pyx_t_6 = __pyx_t_7;

  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_6)) {


    /* "psycopg_binary/pq/escaping.pyx":97
 * 
 *         if self.conn is not None and self.conn._pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 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_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __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_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 97, __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(6, 97, __pyx_L1_error)

    /* "psycopg_binary/pq/escaping.pyx":96
 *         cdef Py_ssize_t length
 * 
 *         if self.conn is not None and self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
*/
  }

  /* "psycopg_binary/pq/escaping.pyx":99
 *             raise e.OperationalError("the connection is closed")
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         if self.conn is not None:
*/
  __pyx_t_8 = __pyx_f_14psycopg_binary_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 99, __pyx_L1_error)


  /* "psycopg_binary/pq/escaping.pyx":101
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             out = libpq.PQescapeByteaConn(
 *                 self.conn._pgconn_ptr, <unsigned char *>ptr, length, &len_out)
*/
  __pyx_t_6 = (((PyObject *)__pyx_v_self->conn) != Py_None);
  if (__pyx_t_6) {


    /* "psycopg_binary/pq/escaping.pyx":102
 * 
 *         if self.conn is not None:
 *             out = libpq.PQescapeByteaConn(             # <<<<<<<<<<<<<<
 *                 self.conn._pgconn_ptr, <unsigned char *>ptr, length, &len_out)
 *         else:
*/
    __pyx_v_out = PQescapeByteaConn(__pyx_v_self->conn->_pgconn_ptr, ((unsigned char *)__pyx_v_ptr), __pyx_v_length, (&__pyx_v_len_out));

    /* "psycopg_binary/pq/escaping.pyx":101
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             out = libpq.PQescapeByteaConn(
 *                 self.conn._pgconn_ptr, <unsigned char *>ptr, length, &len_out)
*/
    goto __pyx_L6;
  }

  /* "psycopg_binary/pq/escaping.pyx":105
 *                 self.conn._pgconn_ptr, <unsigned char *>ptr, length, &len_out)
 *         else:
 *             out = libpq.PQescapeBytea(<unsigned char *>ptr, length, &len_out)             # <<<<<<<<<<<<<<
 * 
 *         if out is NULL:
*/
  /*else*/ {
    __pyx_v_out = PQescapeBytea(((unsigned char *)__pyx_v_ptr), __pyx_v_length, (&__pyx_v_len_out));
  }
  __pyx_L6:;

  /* "psycopg_binary/pq/escaping.pyx":107
 *             out = libpq.PQescapeBytea(<unsigned char *>ptr, length, &len_out)
 * 
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError(
 *                 f"couldn't allocate for escape_bytea of {len(data)} bytes"
*/
  __pyx_t_6 = (__pyx_v_out == NULL);

  if (unlikely(__pyx_t_6)) {


    /* "psycopg_binary/pq/escaping.pyx":108
 * 
 *         if out is NULL:
 *             raise MemoryError(             # <<<<<<<<<<<<<<
 *                 f"couldn't allocate for escape_bytea of {len(data)} bytes"
 *             )
*/
    __pyx_t_3 = NULL;

    /* "psycopg_binary/pq/escaping.pyx":109
 *         if out is NULL:
 *             raise MemoryError(
 *                 f"couldn't allocate for escape_bytea of {len(data)} bytes"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_9 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(6, 109, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_9, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_for_escape_byt;
    __pyx_t_10[1] = __pyx_t_2;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_bytes;
    __pyx_t_9 = 44;
    #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
    __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[1]);
    #endif
    __pyx_t_8 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, __pyx_t_9, __pyx_t_8);
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __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_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 108, __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(6, 108, __pyx_L1_error)

    /* "psycopg_binary/pq/escaping.pyx":107
 *             out = libpq.PQescapeBytea(<unsigned char *>ptr, length, &len_out)
 * 
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError(
 *                 f"couldn't allocate for escape_bytea of {len(data)} bytes"
*/
  }

  /* "psycopg_binary/pq/escaping.pyx":112
 *             )
 * 
 *         rv = out[:len_out - 1]  # out includes final 0             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_out) + 0, (__pyx_v_len_out - 1) - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/escaping.pyx":113
 * 
 *         rv = out[:len_out - 1]  # out includes final 0
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQfreemem(__pyx_v_out);

  /* "psycopg_binary/pq/escaping.pyx":114
 *         rv = out[:len_out - 1]  # out includes final 0
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     cpdef unescape_bytea(self, const unsigned char *data):
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/escaping.pyx":90
 *         return rv
 * 
 *     cpdef escape_bytea(self, data):             # <<<<<<<<<<<<<<
 *         cdef size_t len_out
 *         cdef unsigned char *out
*/

  /* 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("psycopg_binary.pq.Escaping.escape_bytea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;




  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_9escape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8Escaping_9escape_bytea = {"escape_bytea", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Escaping_9escape_bytea, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_9escape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_bytea (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8Escaping_8escape_bytea(((struct __pyx_obj_14psycopg_binary_2pq_Escaping *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_8escape_bytea(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__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("escape_bytea", 0);
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq_8Escaping_escape_bytea(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.Escaping.escape_bytea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/escaping.pyx":116
 *         return rv
 * 
 *     cpdef unescape_bytea(self, const unsigned char *data):             # <<<<<<<<<<<<<<
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
*/

static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_11unescape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_arg_data); /*proto*/
static PyObject *__pyx_f_14psycopg_binary_2pq_8Escaping_unescape_bytea(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, unsigned char const *__pyx_v_data, int __pyx_skip_dispatch) {
  size_t __pyx_v_len_out;
  unsigned char *__pyx_v_out;
  PyObject *__pyx_v_rv = 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;
  size_t __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9[3];
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unescape_bytea", 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_14psycopg_binary_2pq_Escaping &&
  __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_unescape_bytea); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_14psycopg_binary_2pq_8Escaping_11unescape_bytea)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyBytes_FromCString(__pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 116, __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[2] = {__pyx_t_3, __pyx_t_5};
          __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_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(6, 116, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        {
          PyObject *__pyx_temp;
          {
            __pyx_temp = __pyx_r;
            __pyx_r = __pyx_t_2;
          }
          __Pyx_XDECREF(__pyx_temp);
        }
        __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
  }

  /* "psycopg_binary/pq/escaping.pyx":119
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")
*/
  __pyx_t_7 = (((PyObject *)__pyx_v_self->conn) != Py_None);
  if (__pyx_t_7) {


    /* "psycopg_binary/pq/escaping.pyx":120
 *         # if a connection is passed in, it must be valid.
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError("the connection is closed")
 * 
*/
    __pyx_t_7 = (__pyx_v_self->conn->_pgconn_ptr == NULL);

    if (unlikely(__pyx_t_7)) {


      /* "psycopg_binary/pq/escaping.pyx":121
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *         cdef size_t len_out
*/
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 121, __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_the_connection_is_closed};
        __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(6, 121, __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(6, 121, __pyx_L1_error)

      /* "psycopg_binary/pq/escaping.pyx":120
 *         # if a connection is passed in, it must be valid.
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError("the connection is closed")
 * 
*/
    }

    /* "psycopg_binary/pq/escaping.pyx":119
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")
*/
  }

  /* "psycopg_binary/pq/escaping.pyx":124
 * 
 *         cdef size_t len_out
 *         cdef unsigned char *out = libpq.PQunescapeBytea(data, &len_out)             # <<<<<<<<<<<<<<
 *         if out is NULL:
 *             raise MemoryError(
*/
  __pyx_v_out = PQunescapeBytea(__pyx_v_data, (&__pyx_v_len_out));

  /* "psycopg_binary/pq/escaping.pyx":125
 *         cdef size_t len_out
 *         cdef unsigned char *out = libpq.PQunescapeBytea(data, &len_out)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError(
 *                 f"couldn't allocate for unescape_bytea of {len(data)} bytes"
*/
  __pyx_t_7 = (__pyx_v_out == NULL);

  if (unlikely(__pyx_t_7)) {


    /* "psycopg_binary/pq/escaping.pyx":126
 *         cdef unsigned char *out = libpq.PQunescapeBytea(data, &len_out)
 *         if out is NULL:
 *             raise MemoryError(             # <<<<<<<<<<<<<<
 *                 f"couldn't allocate for unescape_bytea of {len(data)} bytes"
 *             )
*/
    __pyx_t_5 = NULL;

    /* "psycopg_binary/pq/escaping.pyx":127
 *         if out is NULL:
 *             raise MemoryError(
 *                 f"couldn't allocate for unescape_bytea of {len(data)} bytes"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_8 = __Pyx_ssize_strlen(((char const *)__pyx_v_data)); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(6, 127, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_8, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_for_unescape_b;
    __pyx_t_9[1] = __pyx_t_2;
    __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_bytes;
    __pyx_t_8 = 46;
    #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[1]);
    #endif
    __pyx_t_10 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, __pyx_t_8, __pyx_t_10);
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __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(6, 126, __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(6, 126, __pyx_L1_error)

    /* "psycopg_binary/pq/escaping.pyx":125
 *         cdef size_t len_out
 *         cdef unsigned char *out = libpq.PQunescapeBytea(data, &len_out)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError(
 *                 f"couldn't allocate for unescape_bytea of {len(data)} bytes"
*/
  }

  /* "psycopg_binary/pq/escaping.pyx":130
 *             )
 * 
 *         rv = out[:len_out]             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_out) + 0, __pyx_v_len_out - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/escaping.pyx":131
 * 
 *         rv = out[:len_out]
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
*/
  PQfreemem(__pyx_v_out);

  /* "psycopg_binary/pq/escaping.pyx":132
 *         rv = out[:len_out]
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/escaping.pyx":116
 *         return rv
 * 
 *     cpdef unescape_bytea(self, const unsigned char *data):             # <<<<<<<<<<<<<<
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
*/

  /* 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("psycopg_binary.pq.Escaping.unescape_bytea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;


  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_11unescape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_arg_data); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8Escaping_11unescape_bytea = {"unescape_bytea", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Escaping_11unescape_bytea, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_11unescape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_arg_data) {
  unsigned char const *__pyx_v_data;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unescape_bytea (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_data); {
    __pyx_v_data = __Pyx_PyObject_AsUString(__pyx_arg_data); if (unlikely((!__pyx_v_data) && PyErr_Occurred())) __PYX_ERR(6, 116, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_binary.pq.Escaping.unescape_bytea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8Escaping_10unescape_bytea(((struct __pyx_obj_14psycopg_binary_2pq_Escaping *)__pyx_v_self), ((unsigned char const *)__pyx_v_data));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_10unescape_bytea(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__pyx_v_self, unsigned char const *__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("unescape_bytea", 0);
  __pyx_t_1 = __pyx_f_14psycopg_binary_2pq_8Escaping_unescape_bytea(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_1;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.Escaping.unescape_bytea", __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_14psycopg_binary_2pq_8Escaping_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8Escaping_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Escaping_13__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8Escaping_12__reduce_cython__(((struct __pyx_obj_14psycopg_binary_2pq_Escaping *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_12__reduce_cython__(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__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;
  int __pyx_t_3;
  int __pyx_t_4;
  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
 *     with CRITICAL_SECTION(self):             # <<<<<<<<<<<<<<
 *         state = (self.conn,)
 *         _dict = getattr(self, '__dict__', None)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     with CRITICAL_SECTION(self):
 *         state = (self.conn,)             # <<<<<<<<<<<<<<
 *         _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF((PyObject *)__pyx_v_self->conn);
        __Pyx_GIVEREF((PyObject *)__pyx_v_self->conn);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->conn)) != (0)) __PYX_ERR(2, 6, __pyx_L4_error);
        __pyx_v_state = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "(tree fragment)":7
 *     with CRITICAL_SECTION(self):
 *         state = (self.conn,)
 *         _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
        __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_v__dict = __pyx_t_2;
        __pyx_t_2 = 0;
      }

      /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     with CRITICAL_SECTION(self):             # <<<<<<<<<<<<<<
 *         state = (self.conn,)
 *         _dict = getattr(self, '__dict__', None)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "(tree fragment)":8
 *         state = (self.conn,)
 *         _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_4 = (__pyx_v__dict != Py_None);
  if (__pyx_t_4) {

  } else {

    __pyx_t_3 = __pyx_t_4;

    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 8, __pyx_L1_error)

  __pyx_t_3 = __pyx_t_4;

  __pyx_L7_bool_binop_done:;
  if (__pyx_t_3) {


    /* "(tree fragment)":9
 *         _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(2, 9, __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(2, 9, __pyx_L1_error);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "(tree fragment)":10
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.conn is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":8
 *         state = (self.conn,)
 *         _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L6;
  }

  /* "(tree fragment)":12
 *         use_setstate = True
 *     else:
 *         use_setstate = self.conn is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state
*/
  /*else*/ {
    __pyx_t_3 = (((PyObject *)__pyx_v_self->conn) != Py_None);
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L6:;

  /* "(tree fragment)":13
 *     else:
 *         use_setstate = self.conn is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":14
 *         use_setstate = self.conn is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Escaping); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __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(2, 14, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_8405287);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_8405287);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_8405287) != (0)) __PYX_ERR(2, 14, __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(2, 14, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(2, 14, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(2, 14, __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(2, 14, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_5;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":13
 *     else:
 *         use_setstate = self.conn is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state
 *     else:
*/
  }

  /* "(tree fragment)":16
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Escaping__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Escaping); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 16, __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(2, 16, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_8405287);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_8405287);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_8405287) != (0)) __PYX_ERR(2, 16, __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(2, 16, __pyx_L1_error);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(2, 16, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(2, 16, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    {
      PyObject *__pyx_temp;
      {
        __pyx_temp = __pyx_r;
        __pyx_r = __pyx_t_2;
      }
      __Pyx_XDECREF(__pyx_temp);
    }
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_binary.pq.Escaping.__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)":17
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Escaping__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8Escaping_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Escaping_15__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8Escaping_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8Escaping_14__setstate_cython__(((struct __pyx_obj_14psycopg_binary_2pq_Escaping *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8Escaping_14__setstate_cython__(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__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)":18
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Escaping__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(2, 18, __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 \047not None\047");
    __PYX_ERR(2, 18, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_14psycopg_binary_2pq___pyx_unpickle_Escaping__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 18, __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)":17
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Escaping__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("psycopg_binary.pq.Escaping.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":18
 *     Wrap a chunk of memory allocated by the libpq and expose it as memoryview.
 *     """
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PQBuffer _from_buffer(unsigned char *buf, Py_ssize_t length):
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)
*/

static struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_f_14psycopg_binary_2pq_8PQBuffer__from_buffer(unsigned char *__pyx_v_buf, Py_ssize_t __pyx_v_length) {
  struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_rv = 0;
  struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__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("_from_buffer", 0);

  /* "psycopg_binary/pq/pqbuffer.pyx":20
 *     @staticmethod
 *     cdef PQBuffer _from_buffer(unsigned char *buf, Py_ssize_t length):
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)             # <<<<<<<<<<<<<<
 *         rv.buf = buf
 *         rv.len = length
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_14psycopg_binary_2pq_PQBuffer(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PQBuffer), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pqbuffer.pyx":21
 *     cdef PQBuffer _from_buffer(unsigned char *buf, Py_ssize_t length):
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)
 *         rv.buf = buf             # <<<<<<<<<<<<<<
 *         rv.len = length
 *         return rv
*/
  __pyx_v_rv->buf = __pyx_v_buf;

  /* "psycopg_binary/pq/pqbuffer.pyx":22
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)
 *         rv.buf = buf
 *         rv.len = length             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  __pyx_v_rv->len = __pyx_v_length;

  /* "psycopg_binary/pq/pqbuffer.pyx":23
 *         rv.buf = buf
 *         rv.len = length
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  {
    struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pqbuffer.pyx":18
 *     Wrap a chunk of memory allocated by the libpq and expose it as memoryview.
 *     """
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PQBuffer _from_buffer(unsigned char *buf, Py_ssize_t length):
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.PQBuffer._from_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":25
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 *         self.len = 0
*/

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_8PQBuffer_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_8PQBuffer_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL_TPNEW
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #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
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__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_FASTCALL_TPNEW(__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_14psycopg_binary_2pq_8PQBuffer___cinit__(((struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_8PQBuffer___cinit__(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self) {
  int __pyx_r;

  /* "psycopg_binary/pq/pqbuffer.pyx":26
 * 
 *     def __cinit__(self):
 *         self.buf = NULL             # <<<<<<<<<<<<<<
 *         self.len = 0
 * 
*/
  __pyx_v_self->buf = NULL;

  /* "psycopg_binary/pq/pqbuffer.pyx":27
 *     def __cinit__(self):
 *         self.buf = NULL
 *         self.len = 0             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
  __pyx_v_self->len = 0;

  /* "psycopg_binary/pq/pqbuffer.pyx":25
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 *         self.len = 0
*/

  /* function exit code */
  __pyx_r = 0;

  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":29
 *         self.len = 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.buf:
 *             libpq.PQfreemem(self.buf)
*/

/* Python wrapper */
static void __pyx_pw_14psycopg_binary_2pq_8PQBuffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_14psycopg_binary_2pq_8PQBuffer_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_14psycopg_binary_2pq_8PQBuffer_2__dealloc__(((struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_14psycopg_binary_2pq_8PQBuffer_2__dealloc__(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self) {
  int __pyx_t_1;

  /* "psycopg_binary/pq/pqbuffer.pyx":30
 * 
 *     def __dealloc__(self):
 *         if self.buf:             # <<<<<<<<<<<<<<
 *             libpq.PQfreemem(self.buf)
 * 
*/
  __pyx_t_1 = (__pyx_v_self->buf != 0);

  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pqbuffer.pyx":31
 *     def __dealloc__(self):
 *         if self.buf:
 *             libpq.PQfreemem(self.buf)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
    PQfreemem(__pyx_v_self->buf);

    /* "psycopg_binary/pq/pqbuffer.pyx":30
 * 
 *     def __dealloc__(self):
 *         if self.buf:             # <<<<<<<<<<<<<<
 *             libpq.PQfreemem(self.buf)
 * 
*/
  }

  /* "psycopg_binary/pq/pqbuffer.pyx":29
 *         self.len = 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.buf:
 *             libpq.PQfreemem(self.buf)
*/

  /* function exit code */

}

/* "psycopg_binary/pq/pqbuffer.pyx":33
 *             libpq.PQfreemem(self.buf)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PQBuffer_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PQBuffer_5__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_14psycopg_binary_2pq_8PQBuffer_4__repr__(((struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PQBuffer_4__repr__(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[6];
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_binary/pq/pqbuffer.pyx":35
 *     def __repr__(self):
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *             f"({bytes(self)})"
 *         )
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __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_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_qualname); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_binary/pq/pqbuffer.pyx":36
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *             f"({bytes(self)})"             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5[0] = __pyx_t_1;
  __pyx_t_5[1] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_5[2] = __pyx_t_2;
  __pyx_t_5[3] = __pyx_mstate_global->__pyx_kp_u__14;
  __pyx_t_5[4] = __pyx_t_4;
  __pyx_t_5[5] = __pyx_mstate_global->__pyx_kp_u__15;

  /* "psycopg_binary/pq/pqbuffer.pyx":35
 *     def __repr__(self):
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *             f"({bytes(self)})"
 *         )
*/
  __pyx_t_6 = 3;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5[0]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5[2]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5[4]);
  #endif
  __pyx_t_7 = 0;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_7 |= __Pyx_PyUnicode_KIND_04(__pyx_t_5[0]) | __Pyx_PyUnicode_KIND_04(__pyx_t_5[2]) | __Pyx_PyUnicode_KIND_04(__pyx_t_5[4]);
  #endif
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 6, __pyx_t_6, __pyx_t_7);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 35, __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_4); __pyx_t_4 = 0;
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_3;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pqbuffer.pyx":33
 *             libpq.PQfreemem(self.buf)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
*/

  /* 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("psycopg_binary.pq.PQBuffer.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":39
 *         )
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = self.buf
 *         buffer.obj = self
*/

/* Python wrapper */
CYTHON_UNUSED static int __pyx_pw_14psycopg_binary_2pq_8PQBuffer_7__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static int __pyx_pw_14psycopg_binary_2pq_8PQBuffer_7__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PQBuffer_6__getbuffer__(((struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags));

  /* function exit code */


  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_8PQBuffer_6__getbuffer__(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned char *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  if (unlikely(__pyx_v_buffer == NULL)) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);

  /* "psycopg_binary/pq/pqbuffer.pyx":40
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):
 *         buffer.buf = self.buf             # <<<<<<<<<<<<<<
 *         buffer.obj = self
 *         buffer.len = self.len
*/
  __pyx_t_1 = __pyx_v_self->buf;

  __pyx_v_buffer->buf = __pyx_t_1;

  /* "psycopg_binary/pq/pqbuffer.pyx":41
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):
 *         buffer.buf = self.buf
 *         buffer.obj = self             # <<<<<<<<<<<<<<
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)
*/
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_buffer->obj);
  __Pyx_DECREF(__pyx_v_buffer->obj);
  __pyx_v_buffer->obj = ((PyObject *)__pyx_v_self);

  /* "psycopg_binary/pq/pqbuffer.pyx":42
 *         buffer.buf = self.buf
 *         buffer.obj = self
 *         buffer.len = self.len             # <<<<<<<<<<<<<<
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1
*/
  __pyx_t_2 = __pyx_v_self->len;

  __pyx_v_buffer->len = __pyx_t_2;

  /* "psycopg_binary/pq/pqbuffer.pyx":43
 *         buffer.obj = self
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)             # <<<<<<<<<<<<<<
 *         buffer.readonly = 1
 *         buffer.ndim = 1
*/
  __pyx_v_buffer->itemsize = (sizeof(unsigned char));

  /* "psycopg_binary/pq/pqbuffer.pyx":44
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1             # <<<<<<<<<<<<<<
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char
*/
  __pyx_v_buffer->readonly = 1;

  /* "psycopg_binary/pq/pqbuffer.pyx":45
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1
 *         buffer.ndim = 1             # <<<<<<<<<<<<<<
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len
*/
  __pyx_v_buffer->ndim = 1;

  /* "psycopg_binary/pq/pqbuffer.pyx":46
 *         buffer.readonly = 1
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char             # <<<<<<<<<<<<<<
 *         buffer.shape = &self.len
 *         buffer.strides = NULL
*/
  __pyx_v_buffer->format = NULL;

  /* "psycopg_binary/pq/pqbuffer.pyx":47
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len             # <<<<<<<<<<<<<<
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL
*/
  __pyx_v_buffer->shape = (&__pyx_v_self->len);

  /* "psycopg_binary/pq/pqbuffer.pyx":48
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len
 *         buffer.strides = NULL             # <<<<<<<<<<<<<<
 *         buffer.suboffsets = NULL
 *         buffer.internal = NULL
*/
  __pyx_v_buffer->strides = NULL;

  /* "psycopg_binary/pq/pqbuffer.pyx":49
 *         buffer.shape = &self.len
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         buffer.internal = NULL
 * 
*/
  __pyx_v_buffer->suboffsets = NULL;

  /* "psycopg_binary/pq/pqbuffer.pyx":50
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL
 *         buffer.internal = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):
*/
  __pyx_v_buffer->internal = NULL;

  /* "psycopg_binary/pq/pqbuffer.pyx":39
 *         )
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = self.buf
 *         buffer.obj = self
*/

  /* function exit code */
  __pyx_r = 0;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":52
 *         buffer.internal = NULL
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):             # <<<<<<<<<<<<<<
 *         pass
 * 
*/

/* Python wrapper */
CYTHON_UNUSED static void __pyx_pw_14psycopg_binary_2pq_8PQBuffer_9__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/
CYTHON_UNUSED static void __pyx_pw_14psycopg_binary_2pq_8PQBuffer_9__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_14psycopg_binary_2pq_8PQBuffer_8__releasebuffer__(((struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_14psycopg_binary_2pq_8PQBuffer_8__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer) {

  /* 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_14psycopg_binary_2pq_8PQBuffer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PQBuffer_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PQBuffer_11__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PQBuffer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PQBuffer_10__reduce_cython__(((struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PQBuffer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__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(2, 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("psycopg_binary.pq.PQBuffer.__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_14psycopg_binary_2pq_8PQBuffer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_8PQBuffer_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PQBuffer_13__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_8PQBuffer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_8PQBuffer_12__setstate_cython__(((struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_8PQBuffer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *__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(2, 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("psycopg_binary.pq.PQBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":61
 *     Wrap a chunk of memory owned by a different object.
 *     """
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ViewBuffer _from_buffer(
 *         object obj, unsigned char *buf, Py_ssize_t length
*/

static struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_f_14psycopg_binary_2pq_10ViewBuffer__from_buffer(PyObject *__pyx_v_obj, unsigned char *__pyx_v_buf, Py_ssize_t __pyx_v_length) {
  struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_rv = 0;
  struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__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("_from_buffer", 0);

  /* "psycopg_binary/pq/pqbuffer.pyx":65
 *         object obj, unsigned char *buf, Py_ssize_t length
 *     ):
 *         cdef ViewBuffer rv = ViewBuffer.__new__(ViewBuffer)             # <<<<<<<<<<<<<<
 *         rv.obj = obj
 *         rv.buf = buf
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_14psycopg_binary_2pq_ViewBuffer(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_binary/pq/pqbuffer.pyx":66
 *     ):
 *         cdef ViewBuffer rv = ViewBuffer.__new__(ViewBuffer)
 *         rv.obj = obj             # <<<<<<<<<<<<<<
 *         rv.buf = buf
 *         rv.len = length
*/
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  __Pyx_GOTREF(__pyx_v_rv->obj);
  __Pyx_DECREF(__pyx_v_rv->obj);
  __pyx_v_rv->obj = __pyx_v_obj;

  /* "psycopg_binary/pq/pqbuffer.pyx":67
 *         cdef ViewBuffer rv = ViewBuffer.__new__(ViewBuffer)
 *         rv.obj = obj
 *         rv.buf = buf             # <<<<<<<<<<<<<<
 *         rv.len = length
 *         return rv
*/
  __pyx_v_rv->buf = __pyx_v_buf;

  /* "psycopg_binary/pq/pqbuffer.pyx":68
 *         rv.obj = obj
 *         rv.buf = buf
 *         rv.len = length             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  __pyx_v_rv->len = __pyx_v_length;

  /* "psycopg_binary/pq/pqbuffer.pyx":69
 *         rv.buf = buf
 *         rv.len = length
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  {
    struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF((PyObject *)__pyx_v_rv);
      __pyx_r = __pyx_v_rv;
    }
    __Pyx_XDECREF((PyObject *)__pyx_temp);
  }
  goto __pyx_L0;

  /* "psycopg_binary/pq/pqbuffer.pyx":61
 *     Wrap a chunk of memory owned by a different object.
 *     """
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ViewBuffer _from_buffer(
 *         object obj, unsigned char *buf, Py_ssize_t length
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.ViewBuffer._from_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":71
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 *         self.len = 0
*/

/* Python wrapper */
static int __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_1__cinit__(PyObject *__pyx_v_self, 
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_VECTORCALL_TPNEW
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if !CYTHON_VECTORCALL_TPNEW
  #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
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__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_FASTCALL_TPNEW(__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_14psycopg_binary_2pq_10ViewBuffer___cinit__(((struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_10ViewBuffer___cinit__(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_self) {
  int __pyx_r;

  /* "psycopg_binary/pq/pqbuffer.pyx":72
 * 
 *     def __cinit__(self):
 *         self.buf = NULL             # <<<<<<<<<<<<<<
 *         self.len = 0
 * 
*/
  __pyx_v_self->buf = NULL;

  /* "psycopg_binary/pq/pqbuffer.pyx":73
 *     def __cinit__(self):
 *         self.buf = NULL
 *         self.len = 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_v_self->len = 0;

  /* "psycopg_binary/pq/pqbuffer.pyx":71
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 *         self.len = 0
*/

  /* function exit code */
  __pyx_r = 0;

  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":75
 *         self.len = 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_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_14psycopg_binary_2pq_10ViewBuffer_2__repr__(((struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_10ViewBuffer_2__repr__(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[6];
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_binary/pq/pqbuffer.pyx":77
 *     def __repr__(self):
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *             f"({bytes(self)})"
 *         )
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __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_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_qualname); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_binary/pq/pqbuffer.pyx":78
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *             f"({bytes(self)})"             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5[0] = __pyx_t_1;
  __pyx_t_5[1] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_5[2] = __pyx_t_2;
  __pyx_t_5[3] = __pyx_mstate_global->__pyx_kp_u__14;
  __pyx_t_5[4] = __pyx_t_4;
  __pyx_t_5[5] = __pyx_mstate_global->__pyx_kp_u__15;

  /* "psycopg_binary/pq/pqbuffer.pyx":77
 *     def __repr__(self):
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *             f"({bytes(self)})"
 *         )
*/
  __pyx_t_6 = 3;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5[0]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5[2]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5[4]);
  #endif
  __pyx_t_7 = 0;
  #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
  __pyx_t_7 |= __Pyx_PyUnicode_KIND_04(__pyx_t_5[0]) | __Pyx_PyUnicode_KIND_04(__pyx_t_5[2]) | __Pyx_PyUnicode_KIND_04(__pyx_t_5[4]);
  #endif
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 6, __pyx_t_6, __pyx_t_7);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 77, __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_4); __pyx_t_4 = 0;
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __pyx_r = __pyx_t_3;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_binary/pq/pqbuffer.pyx":75
 *         self.len = 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
*/

  /* 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("psycopg_binary.pq.ViewBuffer.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":81
 *         )
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = self.buf
 *         buffer.obj = self
*/

/* Python wrapper */
CYTHON_UNUSED static int __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static int __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_10ViewBuffer_4__getbuffer__(((struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags));

  /* function exit code */


  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_14psycopg_binary_2pq_10ViewBuffer_4__getbuffer__(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned char *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  if (unlikely(__pyx_v_buffer == NULL)) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);

  /* "psycopg_binary/pq/pqbuffer.pyx":82
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):
 *         buffer.buf = self.buf             # <<<<<<<<<<<<<<
 *         buffer.obj = self
 *         buffer.len = self.len
*/
  __pyx_t_1 = __pyx_v_self->buf;

  __pyx_v_buffer->buf = __pyx_t_1;

  /* "psycopg_binary/pq/pqbuffer.pyx":83
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):
 *         buffer.buf = self.buf
 *         buffer.obj = self             # <<<<<<<<<<<<<<
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)
*/
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_buffer->obj);
  __Pyx_DECREF(__pyx_v_buffer->obj);
  __pyx_v_buffer->obj = ((PyObject *)__pyx_v_self);

  /* "psycopg_binary/pq/pqbuffer.pyx":84
 *         buffer.buf = self.buf
 *         buffer.obj = self
 *         buffer.len = self.len             # <<<<<<<<<<<<<<
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1
*/
  __pyx_t_2 = __pyx_v_self->len;

  __pyx_v_buffer->len = __pyx_t_2;

  /* "psycopg_binary/pq/pqbuffer.pyx":85
 *         buffer.obj = self
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)             # <<<<<<<<<<<<<<
 *         buffer.readonly = 1
 *         buffer.ndim = 1
*/
  __pyx_v_buffer->itemsize = (sizeof(unsigned char));

  /* "psycopg_binary/pq/pqbuffer.pyx":86
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1             # <<<<<<<<<<<<<<
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char
*/
  __pyx_v_buffer->readonly = 1;

  /* "psycopg_binary/pq/pqbuffer.pyx":87
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1
 *         buffer.ndim = 1             # <<<<<<<<<<<<<<
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len
*/
  __pyx_v_buffer->ndim = 1;

  /* "psycopg_binary/pq/pqbuffer.pyx":88
 *         buffer.readonly = 1
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char             # <<<<<<<<<<<<<<
 *         buffer.shape = &self.len
 *         buffer.strides = NULL
*/
  __pyx_v_buffer->format = NULL;

  /* "psycopg_binary/pq/pqbuffer.pyx":89
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len             # <<<<<<<<<<<<<<
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL
*/
  __pyx_v_buffer->shape = (&__pyx_v_self->len);

  /* "psycopg_binary/pq/pqbuffer.pyx":90
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len
 *         buffer.strides = NULL             # <<<<<<<<<<<<<<
 *         buffer.suboffsets = NULL
 *         buffer.internal = NULL
*/
  __pyx_v_buffer->strides = NULL;

  /* "psycopg_binary/pq/pqbuffer.pyx":91
 *         buffer.shape = &self.len
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         buffer.internal = NULL
 * 
*/
  __pyx_v_buffer->suboffsets = NULL;

  /* "psycopg_binary/pq/pqbuffer.pyx":92
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL
 *         buffer.internal = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):
*/
  __pyx_v_buffer->internal = NULL;

  /* "psycopg_binary/pq/pqbuffer.pyx":81
 *         )
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = self.buf
 *         buffer.obj = self
*/

  /* function exit code */
  __pyx_r = 0;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }

  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":94
 *         buffer.internal = NULL
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):             # <<<<<<<<<<<<<<
 *         pass
 * 
*/

/* Python wrapper */
CYTHON_UNUSED static void __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/
CYTHON_UNUSED static void __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_14psycopg_binary_2pq_10ViewBuffer_6__releasebuffer__(((struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer));

  /* function exit code */

  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_14psycopg_binary_2pq_10ViewBuffer_6__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer) {

  /* 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_14psycopg_binary_2pq_10ViewBuffer_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_10ViewBuffer_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_9__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_10ViewBuffer_8__reduce_cython__(((struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_10ViewBuffer_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__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(2, 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("psycopg_binary.pq.ViewBuffer.__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_14psycopg_binary_2pq_10ViewBuffer_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_14psycopg_binary_2pq_10ViewBuffer_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_11__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_10ViewBuffer_10__setstate_cython__(((struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_14psycopg_binary_2pq_10ViewBuffer_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *__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(2, 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("psycopg_binary.pq.ViewBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_binary/pq/pqbuffer.pyx":98
 * 
 * 
 * cdef int _buffer_as_string_and_size(             # <<<<<<<<<<<<<<
 *     data: "Buffer", char **ptr, Py_ssize_t *length
 * ) except -1:
*/

static int __pyx_f_14psycopg_binary_2pq__buffer_as_string_and_size(PyObject *__pyx_v_data, char **__pyx_v_ptr, Py_ssize_t *__pyx_v_length) {
  Py_buffer __pyx_v_buf;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_buffer_as_string_and_size", 0);

  /* "psycopg_binary/pq/pqbuffer.pyx":103
 *     cdef Py_buffer buf
 * 
 *     if isinstance(data, bytes):             # <<<<<<<<<<<<<<
 *         PyBytes_AsStringAndSize(data, ptr, length)
 *     elif PyObject_CheckBuffer(data):
*/
  __pyx_t_1 = PyBytes_Check(__pyx_v_data); 
  if (__pyx_t_1) {


    /* "psycopg_binary/pq/pqbuffer.pyx":104
 * 
 *     if isinstance(data, bytes):
 *         PyBytes_AsStringAndSize(data, ptr, length)             # <<<<<<<<<<<<<<
 *     elif PyObject_CheckBuffer(data):
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)
*/
    __pyx_t_2 = PyBytes_AsStringAndSize(__pyx_v_data, __pyx_v_ptr, __pyx_v_length); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 104, __pyx_L1_error)


    /* "psycopg_binary/pq/pqbuffer.pyx":103
 *     cdef Py_buffer buf
 * 
 *     if isinstance(data, bytes):             # <<<<<<<<<<<<<<
 *         PyBytes_AsStringAndSize(data, ptr, length)
 *     elif PyObject_CheckBuffer(data):
*/
    goto __pyx_L3;
  }

  /* "psycopg_binary/pq/pqbuffer.pyx":105
 *     if isinstance(data, bytes):
 *         PyBytes_AsStringAndSize(data, ptr, length)
 *     elif PyObject_CheckBuffer(data):             # <<<<<<<<<<<<<<
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)
 *         ptr[0] = <char *>buf.buf
*/
  __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data);

  if (likely(__pyx_t_1)) {


    /* "psycopg_binary/pq/pqbuffer.pyx":106
 *         PyBytes_AsStringAndSize(data, ptr, length)
 *     elif PyObject_CheckBuffer(data):
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)             # <<<<<<<<<<<<<<
 *         ptr[0] = <char *>buf.buf
 *         length[0] = buf.len
*/
    __pyx_t_2 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 106, __pyx_L1_error)


    /* "psycopg_binary/pq/pqbuffer.pyx":107
 *     elif PyObject_CheckBuffer(data):
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)
 *         ptr[0] = <char *>buf.buf             # <<<<<<<<<<<<<<
 *         length[0] = buf.len
 *         PyBuffer_Release(&buf)
*/
    (__pyx_v_ptr[0]) = ((char *)__pyx_v_buf.buf);

    /* "psycopg_binary/pq/pqbuffer.pyx":108
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)
 *         ptr[0] = <char *>buf.buf
 *         length[0] = buf.len             # <<<<<<<<<<<<<<
 *         PyBuffer_Release(&buf)
 *     else:
*/
    __pyx_t_3 = __pyx_v_buf.len;

    (__pyx_v_length[0]) = __pyx_t_3;


    /* "psycopg_binary/pq/pqbuffer.pyx":109
 *         ptr[0] = <char *>buf.buf
 *         length[0] = buf.len
 *         PyBuffer_Release(&buf)             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError(f"bytes or buffer expected, got {type(data)}")
*/
    PyBuffer_Release((&__pyx_v_buf));

    /* "psycopg_binary/pq/pqbuffer.pyx":105
 *     if isinstance(data, bytes):
 *         PyBytes_AsStringAndSize(data, ptr, length)
 *     elif PyObject_CheckBuffer(data):             # <<<<<<<<<<<<<<
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)
 *         ptr[0] = <char *>buf.buf
*/
    goto __pyx_L3;
  }

  /* "psycopg_binary/pq/pqbuffer.pyx":111
 *         PyBuffer_Release(&buf)
 *     else:
 *         raise TypeError(f"bytes or buffer expected, got {type(data)}")             # <<<<<<<<<<<<<<
*/
  /*else*/ {
    __pyx_t_5 = NULL;
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_bytes_or_buffer_expected_got, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
      __pyx_t_4 = __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_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 111, __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(7, 111, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "psycopg_binary/pq/pqbuffer.pyx":98
 * 
 * 
 * cdef int _buffer_as_string_and_size(             # <<<<<<<<<<<<<<
 *     data: "Buffer", char **ptr, Py_ssize_t *length
 * ) except -1:
*/

  /* function exit code */
  __pyx_r = 0;
  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_AddTraceback("psycopg_binary.pq._buffer_as_string_and_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;


  __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_Escaping(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
*/

/* Python wrapper */
static PyObject *__pyx_pw_14psycopg_binary_2pq_3__pyx_unpickle_Escaping(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_14psycopg_binary_2pq_3__pyx_unpickle_Escaping = {"__pyx_unpickle_Escaping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_3__pyx_unpickle_Escaping, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14psycopg_binary_2pq_3__pyx_unpickle_Escaping(PyObject *__pyx_self, 
#if CYTHON_VECTORCALL
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_VECTORCALL
  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_Escaping (wrapper)", 0);
  #if !CYTHON_VECTORCALL
  #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(2, 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(2, 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(2, 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(2, 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_Escaping", 0) < (0)) __PYX_ERR(2, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Escaping", 1, 3, 3, i); __PYX_ERR(2, 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(2, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 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(2, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Escaping", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 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("psycopg_binary.pq.__pyx_unpickle_Escaping", __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(2, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_14psycopg_binary_2pq_2__pyx_unpickle_Escaping(__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_14psycopg_binary_2pq_2__pyx_unpickle_Escaping(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_Escaping", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_Escaping(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')             # <<<<<<<<<<<<<<
 *     __pyx_result = Escaping.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, __pyx_k_conn); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 6, __pyx_L1_error)


  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
 *     __pyx_result = Escaping.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_Escaping);
  __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, __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(2, 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, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
 *     __pyx_result = Escaping.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __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 = Escaping.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __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 \047not None\047");
      __PYX_ERR(2, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_14psycopg_binary_2pq___pyx_unpickle_Escaping__set_state(((struct __pyx_obj_14psycopg_binary_2pq_Escaping *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
 *     __pyx_result = Escaping.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, __pyx_state: tuple):
 *     __pyx_result.conn = __pyx_state[0]
*/
  {
    PyObject *__pyx_temp;
    {
      __pyx_temp = __pyx_r;
      __Pyx_INCREF(__pyx_v___pyx_result);
      __pyx_r = __pyx_v___pyx_result;
    }
    __Pyx_XDECREF(__pyx_temp);
  }
  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_Escaping(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_binary.pq.__pyx_unpickle_Escaping", __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_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.conn = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

static PyObject *__pyx_f_14psycopg_binary_2pq___pyx_unpickle_Escaping__set_state(struct __pyx_obj_14psycopg_binary_2pq_Escaping *__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_Escaping__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, __pyx_state: tuple):
 *     __pyx_result.conn = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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_14psycopg_binary_2pq_PGconn))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->conn);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->conn);
  __pyx_v___pyx_result->conn = ((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, __pyx_state: tuple):
 *     __pyx_result.conn = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)


  /* "(tree fragment)":11
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.conn = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_binary.pq.__pyx_unpickle_Escaping__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_14psycopg_binary_2pq_PGconn __pyx_vtable_14psycopg_binary_2pq_PGconn;

static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_PGconn(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *p = ((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)o);
  p->__pyx_vtab = __pyx_vtabptr_14psycopg_binary_2pq_PGconn;
  p->notice_handler = Py_None; Py_INCREF(Py_None);
  p->notify_handler = Py_None; Py_INCREF(Py_None);
  {
    int cinit_result = __pyx_pw_14psycopg_binary_2pq_6PGconn_1__cinit__(
    #if CYTHON_VECTORCALL_TPNEW
    o, NULL, 0, NULL);
    #else
    o, __pyx_mstate_global->__pyx_empty_tuple, NULL);
    #endif
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGconn(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_14psycopg_binary_2pq_PGconn(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_PGconn(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGconn, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_PGconn(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGconn((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_14psycopg_binary_2pq_PGconn(PyObject *o) {
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *p = (struct __pyx_obj_14psycopg_binary_2pq_PGconn *)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_14psycopg_binary_2pq_PGconn) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  {
    PyObject *etype, *eval, *etb;
    __Pyx_PyErr_FetchException(&etype, &eval, &etb);
    __Pyx_DeallocKeepAliveBegin(o);
    __pyx_pw_14psycopg_binary_2pq_6PGconn_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    __Pyx_PyErr_RestoreException(etype, eval, etb);
  }
  Py_CLEAR(p->notice_handler);
  Py_CLEAR(p->notify_handler);
  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_14psycopg_binary_2pq_PGconn(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *p = (struct __pyx_obj_14psycopg_binary_2pq_PGconn *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->notice_handler) {
    e = (*v)(p->notice_handler, a); if (e) return e;
  }
  if (p->notify_handler) {
    e = (*v)(p->notify_handler, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_14psycopg_binary_2pq_PGconn(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_14psycopg_binary_2pq_PGconn *p = (struct __pyx_obj_14psycopg_binary_2pq_PGconn *)o;
  tmp = ((PyObject*)p->notice_handler);
  p->notice_handler = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->notify_handler);
  p->notify_handler = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_pgconn_ptr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_10pgconn_ptr_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_info(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_4info_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_db(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_2db_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_user(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_4user_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_password(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_8password_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_host(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_4host_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_hostaddr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_8hostaddr_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_port(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_4port_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_tty(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_3tty_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_7options_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_6status_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_transaction_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_18transaction_status_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_error_message(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_13error_message_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn__encoding(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_9_encoding_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_protocol_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_16protocol_version_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_full_protocol_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_21full_protocol_version_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_server_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_14server_version_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_socket(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_6socket_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_backend_pid(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_11backend_pid_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_needs_password(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_14needs_password_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_used_password(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_13used_password_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_used_gssapi(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_11used_gssapi_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_ssl_in_use(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_10ssl_in_use_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_nonblocking(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_11nonblocking_1__get__(o);
}

static int __pyx_setprop_14psycopg_binary_2pq_6PGconn_nonblocking(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14psycopg_binary_2pq_6PGconn_11nonblocking_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_pipeline_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_15pipeline_status_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_notice_handler(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_14notice_handler_1__get__(o);
}

static int __pyx_setprop_14psycopg_binary_2pq_6PGconn_notice_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14psycopg_binary_2pq_6PGconn_14notice_handler_3__set__(o, v);
  }
  else {
    return __pyx_pw_14psycopg_binary_2pq_6PGconn_14notice_handler_5__del__(o);
  }
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_6PGconn_notify_handler(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_6PGconn_14notify_handler_1__get__(o);
}

static int __pyx_setprop_14psycopg_binary_2pq_6PGconn_notify_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_14psycopg_binary_2pq_6PGconn_14notify_handler_3__set__(o, v);
  }
  else {
    return __pyx_pw_14psycopg_binary_2pq_6PGconn_14notify_handler_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_14psycopg_binary_2pq_PGconn[] = {
  {"connect", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_7connect, METH_O, 0},
  {"connect_start", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_9connect_start, METH_O, 0},
  {"connect_poll", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_11connect_poll, METH_NOARGS, 0},
  {"finish", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_13finish, METH_NOARGS, 0},
  {"reset", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_15reset, METH_NOARGS, 0},
  {"reset_start", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_17reset_start, METH_NOARGS, 0},
  {"reset_poll", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_19reset_poll, METH_NOARGS, 0},
  {"ping", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_21ping, METH_O, 0},
  {"parameter_status", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_23parameter_status, METH_O, 0},
  {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_25get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"exec_", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_27exec_, METH_O, 0},
  {"send_query", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_29send_query, METH_O, 0},
  {"exec_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_31exec_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"send_query_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_33send_query_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"send_prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_35send_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"send_query_prepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_37send_query_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_39prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"exec_prepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_41exec_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"describe_prepared", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_43describe_prepared, METH_O, 0},
  {"send_describe_prepared", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_45send_describe_prepared, METH_O, 0},
  {"describe_portal", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_47describe_portal, METH_O, 0},
  {"send_describe_portal", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_49send_describe_portal, METH_O, 0},
  {"close_prepared", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_51close_prepared, METH_O, 0},
  {"send_close_prepared", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_53send_close_prepared, METH_O, 0},
  {"close_portal", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_55close_portal, METH_O, 0},
  {"send_close_portal", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_57send_close_portal, METH_O, 0},
  {"get_result", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_59get_result, METH_NOARGS, 0},
  {"consume_input", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_61consume_input, METH_NOARGS, 0},
  {"is_busy", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_63is_busy, METH_NOARGS, 0},
  {"set_single_row_mode", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_67set_single_row_mode, METH_NOARGS, 0},
  {"set_chunked_rows_mode", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_69set_chunked_rows_mode, METH_O, 0},
  {"cancel_conn", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_71cancel_conn, METH_NOARGS, 0},
  {"get_cancel", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_73get_cancel, METH_NOARGS, 0},
  {"put_copy_data", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_77put_copy_data, METH_O, 0},
  {"put_copy_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_79put_copy_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get_copy_data", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_81get_copy_data, METH_O, 0},
  {"trace", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_83trace, METH_O, 0},
  {"set_trace_flags", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_85set_trace_flags, METH_O, 0},
  {"untrace", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_87untrace, METH_NOARGS, 0},
  {"encrypt_password", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_89encrypt_password, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"change_password", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_6PGconn_91change_password, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"make_empty_result", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_93make_empty_result, METH_O, 0},
  {"enter_pipeline_mode", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_95enter_pipeline_mode, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_6PGconn_94enter_pipeline_mode},
  {"exit_pipeline_mode", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_97exit_pipeline_mode, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_6PGconn_96exit_pipeline_mode},
  {"pipeline_sync", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_99pipeline_sync, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_6PGconn_98pipeline_sync},
  {"send_flush_request", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_101send_flush_request, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_6PGconn_100send_flush_request},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_103__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_6PGconn_105__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_14psycopg_binary_2pq_PGconn[] = {
  {"pgconn_ptr", __pyx_getprop_14psycopg_binary_2pq_6PGconn_pgconn_ptr, 0, 0, 0},
  {"info", __pyx_getprop_14psycopg_binary_2pq_6PGconn_info, 0, 0, 0},
  {"db", __pyx_getprop_14psycopg_binary_2pq_6PGconn_db, 0, 0, 0},
  {"user", __pyx_getprop_14psycopg_binary_2pq_6PGconn_user, 0, 0, 0},
  {"password", __pyx_getprop_14psycopg_binary_2pq_6PGconn_password, 0, 0, 0},
  {"host", __pyx_getprop_14psycopg_binary_2pq_6PGconn_host, 0, 0, 0},
  {"hostaddr", __pyx_getprop_14psycopg_binary_2pq_6PGconn_hostaddr, 0, 0, 0},
  {"port", __pyx_getprop_14psycopg_binary_2pq_6PGconn_port, 0, 0, 0},
  {"tty", __pyx_getprop_14psycopg_binary_2pq_6PGconn_tty, 0, 0, 0},
  {"options", __pyx_getprop_14psycopg_binary_2pq_6PGconn_options, 0, 0, 0},
  {"status", __pyx_getprop_14psycopg_binary_2pq_6PGconn_status, 0, 0, 0},
  {"transaction_status", __pyx_getprop_14psycopg_binary_2pq_6PGconn_transaction_status, 0, 0, 0},
  {"error_message", __pyx_getprop_14psycopg_binary_2pq_6PGconn_error_message, 0, 0, 0},
  {"_encoding", __pyx_getprop_14psycopg_binary_2pq_6PGconn__encoding, 0, 0, 0},
  {"protocol_version", __pyx_getprop_14psycopg_binary_2pq_6PGconn_protocol_version, 0, 0, 0},
  {"full_protocol_version", __pyx_getprop_14psycopg_binary_2pq_6PGconn_full_protocol_version, 0, 0, 0},
  {"server_version", __pyx_getprop_14psycopg_binary_2pq_6PGconn_server_version, 0, 0, 0},
  {"socket", __pyx_getprop_14psycopg_binary_2pq_6PGconn_socket, 0, 0, 0},
  {"backend_pid", __pyx_getprop_14psycopg_binary_2pq_6PGconn_backend_pid, 0, 0, 0},
  {"needs_password", __pyx_getprop_14psycopg_binary_2pq_6PGconn_needs_password, 0, 0, 0},
  {"used_password", __pyx_getprop_14psycopg_binary_2pq_6PGconn_used_password, 0, 0, 0},
  {"used_gssapi", __pyx_getprop_14psycopg_binary_2pq_6PGconn_used_gssapi, 0, 0, 0},
  {"ssl_in_use", __pyx_getprop_14psycopg_binary_2pq_6PGconn_ssl_in_use, 0, 0, 0},
  {"nonblocking", __pyx_getprop_14psycopg_binary_2pq_6PGconn_nonblocking, __pyx_setprop_14psycopg_binary_2pq_6PGconn_nonblocking, 0, 0},
  {"pipeline_status", __pyx_getprop_14psycopg_binary_2pq_6PGconn_pipeline_status, 0, PyDoc_STR("The current pipeline mode status.\n\n        For libpq < 14.0, always return 0 (PQ_PIPELINE_OFF).\n        "), 0},
  {"notice_handler", __pyx_getprop_14psycopg_binary_2pq_6PGconn_notice_handler, __pyx_setprop_14psycopg_binary_2pq_6PGconn_notice_handler, 0, 0},
  {"notify_handler", __pyx_getprop_14psycopg_binary_2pq_6PGconn_notify_handler, __pyx_setprop_14psycopg_binary_2pq_6PGconn_notify_handler, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyMemberDef __pyx_type_14psycopg_binary_2pq_PGconn_members[] = {
  #if !CYTHON_USE_TYPE_SLOTS
  {"__weaklistoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_14psycopg_binary_2pq_PGconn, __weakref__), READONLY, 0},
  #endif
  {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_type_14psycopg_binary_2pq_PGconn_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_14psycopg_binary_2pq_PGconn},
  {Py_tp_repr, (void *)__pyx_pw_14psycopg_binary_2pq_6PGconn_5__repr__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_14psycopg_binary_2pq_PGconn},
  {Py_tp_clear, (void *)__pyx_tp_clear_14psycopg_binary_2pq_PGconn},
  {Py_tp_methods, (void *)__pyx_methods_14psycopg_binary_2pq_PGconn},
  {Py_tp_getset, (void *)__pyx_getsets_14psycopg_binary_2pq_PGconn},
  {Py_tp_new, (void *)__pyx_tp_new_14psycopg_binary_2pq_PGconn},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_14psycopg_binary_2pq_PGconn},
  #endif
  #endif
  {Py_tp_members, (void*)__pyx_type_14psycopg_binary_2pq_PGconn_members},
  {0, 0},
};
static PyType_Spec __pyx_type_14psycopg_binary_2pq_PGconn_spec = {
  "psycopg_binary.pq.PGconn",
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGconn),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_14psycopg_binary_2pq_PGconn_slots,
};
#else

static PyTypeObject __pyx_type_14psycopg_binary_2pq_PGconn = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_binary.pq.""PGconn", /*tp_name*/
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGconn), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_14psycopg_binary_2pq_PGconn, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_14psycopg_binary_2pq_6PGconn_5__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_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_14psycopg_binary_2pq_PGconn, /*tp_traverse*/
  __pyx_tp_clear_14psycopg_binary_2pq_PGconn, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_14psycopg_binary_2pq_PGconn, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_14psycopg_binary_2pq_PGconn, /*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_14psycopg_binary_2pq_PGconn, /*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) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_14psycopg_binary_2pq_PGconn, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_14psycopg_binary_2pq_PGresult __pyx_vtable_14psycopg_binary_2pq_PGresult;

static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_PGresult(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_14psycopg_binary_2pq_PGresult *p = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)o);
  p->__pyx_vtab = __pyx_vtabptr_14psycopg_binary_2pq_PGresult;
  {
    int cinit_result = __pyx_pw_14psycopg_binary_2pq_8PGresult_1__cinit__(
    #if CYTHON_VECTORCALL_TPNEW
    o, NULL, 0, NULL);
    #else
    o, __pyx_mstate_global->__pyx_empty_tuple, NULL);
    #endif
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGresult(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_PGresult > 0) & __PYX_CHECK_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGresult))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_14psycopg_binary_2pq_PGresult[--__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_PGresult];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGresult));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 0);
  }
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_14psycopg_binary_2pq_PGresult(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_PGresult(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGresult, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_PGresult(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGresult((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_14psycopg_binary_2pq_PGresult(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_14psycopg_binary_2pq_PGresult) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    __Pyx_PyErr_FetchException(&etype, &eval, &etb);
    __Pyx_DeallocKeepAliveBegin(o);
    __pyx_pw_14psycopg_binary_2pq_8PGresult_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    __Pyx_PyErr_RestoreException(etype, eval, etb);
  }
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_PGresult < 8) & __PYX_CHECK_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGresult))))
  {
    __pyx_mstate_global->__pyx_freelist_14psycopg_binary_2pq_PGresult[__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_PGresult++] = ((struct __pyx_obj_14psycopg_binary_2pq_PGresult *)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 PyObject *__pyx_getprop_14psycopg_binary_2pq_8PGresult_pgresult_ptr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_8PGresult_12pgresult_ptr_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_8PGresult_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_8PGresult_6status_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_8PGresult_error_message(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_8PGresult_13error_message_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_8PGresult_ntuples(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_8PGresult_7ntuples_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_8PGresult_nfields(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_8PGresult_7nfields_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_8PGresult_binary_tuples(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_8PGresult_13binary_tuples_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_8PGresult_nparams(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_8PGresult_7nparams_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_8PGresult_command_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_8PGresult_14command_status_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_8PGresult_command_tuples(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_8PGresult_14command_tuples_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_8PGresult_oid_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_8PGresult_9oid_value_1__get__(o);
}

static PyMethodDef __pyx_methods_14psycopg_binary_2pq_PGresult[] = {
  {"clear", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_7clear, METH_NOARGS, 0},
  {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_8PGresult_9get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"error_field", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_11error_field, METH_O, 0},
  {"fname", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_13fname, METH_O, 0},
  {"ftable", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_15ftable, METH_O, 0},
  {"ftablecol", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_17ftablecol, METH_O, 0},
  {"fformat", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_19fformat, METH_O, 0},
  {"ftype", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_21ftype, METH_O, 0},
  {"fmod", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_23fmod, METH_O, 0},
  {"fsize", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_25fsize, METH_O, 0},
  {"get_value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_8PGresult_27get_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"param_type", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_29param_type, METH_O, 0},
  {"set_attributes", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_31set_attributes, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_33__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGresult_35__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_14psycopg_binary_2pq_PGresult[] = {
  {"pgresult_ptr", __pyx_getprop_14psycopg_binary_2pq_8PGresult_pgresult_ptr, 0, 0, 0},
  {"status", __pyx_getprop_14psycopg_binary_2pq_8PGresult_status, 0, 0, 0},
  {"error_message", __pyx_getprop_14psycopg_binary_2pq_8PGresult_error_message, 0, 0, 0},
  {"ntuples", __pyx_getprop_14psycopg_binary_2pq_8PGresult_ntuples, 0, 0, 0},
  {"nfields", __pyx_getprop_14psycopg_binary_2pq_8PGresult_nfields, 0, 0, 0},
  {"binary_tuples", __pyx_getprop_14psycopg_binary_2pq_8PGresult_binary_tuples, 0, 0, 0},
  {"nparams", __pyx_getprop_14psycopg_binary_2pq_8PGresult_nparams, 0, 0, 0},
  {"command_status", __pyx_getprop_14psycopg_binary_2pq_8PGresult_command_status, 0, 0, 0},
  {"command_tuples", __pyx_getprop_14psycopg_binary_2pq_8PGresult_command_tuples, 0, 0, 0},
  {"oid_value", __pyx_getprop_14psycopg_binary_2pq_8PGresult_oid_value, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_14psycopg_binary_2pq_PGresult_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_14psycopg_binary_2pq_PGresult},
  {Py_tp_repr, (void *)__pyx_pw_14psycopg_binary_2pq_8PGresult_5__repr__},
  {Py_tp_methods, (void *)__pyx_methods_14psycopg_binary_2pq_PGresult},
  {Py_tp_getset, (void *)__pyx_getsets_14psycopg_binary_2pq_PGresult},
  {Py_tp_new, (void *)__pyx_tp_new_14psycopg_binary_2pq_PGresult},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_14psycopg_binary_2pq_PGresult},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_14psycopg_binary_2pq_PGresult_spec = {
  "psycopg_binary.pq.PGresult",
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGresult),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_14psycopg_binary_2pq_PGresult_slots,
};
#else

static PyTypeObject __pyx_type_14psycopg_binary_2pq_PGresult = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_binary.pq.""PGresult", /*tp_name*/
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGresult), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_14psycopg_binary_2pq_PGresult, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_14psycopg_binary_2pq_8PGresult_5__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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_14psycopg_binary_2pq_PGresult, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_14psycopg_binary_2pq_PGresult, /*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_14psycopg_binary_2pq_PGresult, /*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) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_14psycopg_binary_2pq_PGresult, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_14psycopg_binary_2pq_PGcancelConn __pyx_vtable_14psycopg_binary_2pq_PGcancelConn;

static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_PGcancelConn(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *p = ((struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *)o);
  p->__pyx_vtab = __pyx_vtabptr_14psycopg_binary_2pq_PGcancelConn;
  {
    int cinit_result = __pyx_pw_14psycopg_binary_2pq_12PGcancelConn_1__cinit__(
    #if CYTHON_VECTORCALL_TPNEW
    o, NULL, 0, NULL);
    #else
    o, __pyx_mstate_global->__pyx_empty_tuple, NULL);
    #endif
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGcancelConn(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_14psycopg_binary_2pq_PGcancelConn(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_PGcancelConn(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGcancelConn, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_PGcancelConn(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGcancelConn((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_14psycopg_binary_2pq_PGcancelConn(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_14psycopg_binary_2pq_PGcancelConn) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    __Pyx_PyErr_FetchException(&etype, &eval, &etb);
    __Pyx_DeallocKeepAliveBegin(o);
    __pyx_pw_14psycopg_binary_2pq_12PGcancelConn_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    __Pyx_PyErr_RestoreException(etype, eval, etb);
  }
  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 PyObject *__pyx_getprop_14psycopg_binary_2pq_12PGcancelConn_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_12PGcancelConn_6status_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_12PGcancelConn_socket(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_12PGcancelConn_6socket_1__get__(o);
}

static PyObject *__pyx_getprop_14psycopg_binary_2pq_12PGcancelConn_error_message(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_14psycopg_binary_2pq_12PGcancelConn_13error_message_1__get__(o);
}

static PyMethodDef __pyx_methods_14psycopg_binary_2pq_PGcancelConn[] = {
  {"start", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_5start, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_12PGcancelConn_4start},
  {"blocking", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_7blocking, METH_NOARGS, __pyx_doc_14psycopg_binary_2pq_12PGcancelConn_6blocking},
  {"poll", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_9poll, METH_NOARGS, 0},
  {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_11get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"reset", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_13reset, METH_NOARGS, 0},
  {"finish", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_15finish, METH_NOARGS, 0},
  {"_ensure_pgcancelconn", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_17_ensure_pgcancelconn, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_19__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_12PGcancelConn_21__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_14psycopg_binary_2pq_PGcancelConn[] = {
  {"status", __pyx_getprop_14psycopg_binary_2pq_12PGcancelConn_status, 0, 0, 0},
  {"socket", __pyx_getprop_14psycopg_binary_2pq_12PGcancelConn_socket, 0, 0, 0},
  {"error_message", __pyx_getprop_14psycopg_binary_2pq_12PGcancelConn_error_message, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_14psycopg_binary_2pq_PGcancelConn_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_14psycopg_binary_2pq_PGcancelConn},
  {Py_tp_methods, (void *)__pyx_methods_14psycopg_binary_2pq_PGcancelConn},
  {Py_tp_getset, (void *)__pyx_getsets_14psycopg_binary_2pq_PGcancelConn},
  {Py_tp_new, (void *)__pyx_tp_new_14psycopg_binary_2pq_PGcancelConn},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_14psycopg_binary_2pq_PGcancelConn},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_14psycopg_binary_2pq_PGcancelConn_spec = {
  "psycopg_binary.pq.PGcancelConn",
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_14psycopg_binary_2pq_PGcancelConn_slots,
};
#else

static PyTypeObject __pyx_type_14psycopg_binary_2pq_PGcancelConn = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_binary.pq.""PGcancelConn", /*tp_name*/
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_14psycopg_binary_2pq_PGcancelConn, /*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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_14psycopg_binary_2pq_PGcancelConn, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_14psycopg_binary_2pq_PGcancelConn, /*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_14psycopg_binary_2pq_PGcancelConn, /*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) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_14psycopg_binary_2pq_PGcancelConn, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_14psycopg_binary_2pq_PGcancel __pyx_vtable_14psycopg_binary_2pq_PGcancel;

static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_PGcancel(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_14psycopg_binary_2pq_PGcancel *p = ((struct __pyx_obj_14psycopg_binary_2pq_PGcancel *)o);
  p->__pyx_vtab = __pyx_vtabptr_14psycopg_binary_2pq_PGcancel;
  {
    int cinit_result = __pyx_pw_14psycopg_binary_2pq_8PGcancel_1__cinit__(
    #if CYTHON_VECTORCALL_TPNEW
    o, NULL, 0, NULL);
    #else
    o, __pyx_mstate_global->__pyx_empty_tuple, NULL);
    #endif
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGcancel(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_14psycopg_binary_2pq_PGcancel(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_PGcancel(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGcancel, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_PGcancel(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancel || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_14psycopg_binary_2pq_PGcancel((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_14psycopg_binary_2pq_PGcancel(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_14psycopg_binary_2pq_PGcancel) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    __Pyx_PyErr_FetchException(&etype, &eval, &etb);
    __Pyx_DeallocKeepAliveBegin(o);
    __pyx_pw_14psycopg_binary_2pq_8PGcancel_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    __Pyx_PyErr_RestoreException(etype, eval, etb);
  }
  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 PyMethodDef __pyx_methods_14psycopg_binary_2pq_PGcancel[] = {
  {"free", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGcancel_5free, METH_NOARGS, 0},
  {"cancel", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGcancel_7cancel, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGcancel_9__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PGcancel_11__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_14psycopg_binary_2pq_PGcancel_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_14psycopg_binary_2pq_PGcancel},
  {Py_tp_methods, (void *)__pyx_methods_14psycopg_binary_2pq_PGcancel},
  {Py_tp_new, (void *)__pyx_tp_new_14psycopg_binary_2pq_PGcancel},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_14psycopg_binary_2pq_PGcancel},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_14psycopg_binary_2pq_PGcancel_spec = {
  "psycopg_binary.pq.PGcancel",
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGcancel),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_14psycopg_binary_2pq_PGcancel_slots,
};
#else

static PyTypeObject __pyx_type_14psycopg_binary_2pq_PGcancel = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_binary.pq.""PGcancel", /*tp_name*/
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_PGcancel), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_14psycopg_binary_2pq_PGcancel, /*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_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_14psycopg_binary_2pq_PGcancel, /*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_14psycopg_binary_2pq_PGcancel, /*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) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_14psycopg_binary_2pq_PGcancel, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_14psycopg_binary_2pq_Escaping __pyx_vtable_14psycopg_binary_2pq_Escaping;

static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_Escaping(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_14psycopg_binary_2pq_Escaping *p = ((struct __pyx_obj_14psycopg_binary_2pq_Escaping *)o);
  p->__pyx_vtab = __pyx_vtabptr_14psycopg_binary_2pq_Escaping;
  p->conn = ((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)Py_None); Py_INCREF(Py_None);
  return o;
}

static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_Escaping(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_14psycopg_binary_2pq_Escaping(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_Escaping(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_14psycopg_binary_2pq_Escaping, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_Escaping(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_Escaping || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_14psycopg_binary_2pq_Escaping((PyTypeObject*)t, args, nargs, kwnames);
  if (likely(o)) {
    assert(Py_TYPE(o) == (PyTypeObject*)t);
    if (unlikely(__pyx_pw_14psycopg_binary_2pq_8Escaping_1__init__(o, args, nargs, kwnames) < 0)) {
      Py_CLEAR(o);
    }
  }
  return o;
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static int __pyx_tp_init_14psycopg_binary_2pq_Escaping(PyObject *o, PyObject *args, PyObject *kwds) {
  return __Pyx_CallTpinitAsVectorcall(__pyx_pw_14psycopg_binary_2pq_8Escaping_1__init__, o, args, kwds);
}
#endif

static void __pyx_tp_dealloc_14psycopg_binary_2pq_Escaping(PyObject *o) {
  struct __pyx_obj_14psycopg_binary_2pq_Escaping *p = (struct __pyx_obj_14psycopg_binary_2pq_Escaping *)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_14psycopg_binary_2pq_Escaping) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->conn);
  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_14psycopg_binary_2pq_Escaping(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_14psycopg_binary_2pq_Escaping *p = (struct __pyx_obj_14psycopg_binary_2pq_Escaping *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->conn) {
    e = (*v)(((PyObject *)p->conn), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_14psycopg_binary_2pq_Escaping(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_14psycopg_binary_2pq_Escaping *p = (struct __pyx_obj_14psycopg_binary_2pq_Escaping *)o;
  tmp = ((PyObject*)p->conn);
  p->conn = ((struct __pyx_obj_14psycopg_binary_2pq_PGconn *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_14psycopg_binary_2pq_Escaping[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Escaping_13__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8Escaping_15__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_14psycopg_binary_2pq_Escaping_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_14psycopg_binary_2pq_Escaping},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_14psycopg_binary_2pq_Escaping},
  {Py_tp_clear, (void *)__pyx_tp_clear_14psycopg_binary_2pq_Escaping},
  {Py_tp_methods, (void *)__pyx_methods_14psycopg_binary_2pq_Escaping},
  {Py_tp_init, (void *)__pyx_tp_init_14psycopg_binary_2pq_Escaping},
  {Py_tp_new, (void *)__pyx_tp_new_14psycopg_binary_2pq_Escaping},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_14psycopg_binary_2pq_Escaping},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_14psycopg_binary_2pq_Escaping_spec = {
  "psycopg_binary.pq.Escaping",
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_Escaping),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_14psycopg_binary_2pq_Escaping_slots,
};
#else

static PyTypeObject __pyx_type_14psycopg_binary_2pq_Escaping = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_binary.pq.""Escaping", /*tp_name*/
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_Escaping), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_14psycopg_binary_2pq_Escaping, /*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_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_14psycopg_binary_2pq_Escaping, /*tp_traverse*/
  __pyx_tp_clear_14psycopg_binary_2pq_Escaping, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_14psycopg_binary_2pq_Escaping, /*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_tp_init_14psycopg_binary_2pq_Escaping, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_14psycopg_binary_2pq_Escaping, /*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) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_14psycopg_binary_2pq_Escaping, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_14psycopg_binary_2pq_PQBuffer __pyx_vtable_14psycopg_binary_2pq_PQBuffer;

static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_PQBuffer(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *p = ((struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *)o);
  p->__pyx_vtab = __pyx_vtabptr_14psycopg_binary_2pq_PQBuffer;
  {
    int cinit_result = __pyx_pw_14psycopg_binary_2pq_8PQBuffer_1__cinit__(
    #if CYTHON_VECTORCALL_TPNEW
    o, NULL, 0, NULL);
    #else
    o, __pyx_mstate_global->__pyx_empty_tuple, NULL);
    #endif
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PQBuffer(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_PQBuffer > 0) & __PYX_CHECK_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PQBuffer, sizeof(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_14psycopg_binary_2pq_PQBuffer[--__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_PQBuffer];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 0);
  }
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_14psycopg_binary_2pq_PQBuffer(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_PQBuffer(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_14psycopg_binary_2pq_PQBuffer, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_PQBuffer(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PQBuffer || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_14psycopg_binary_2pq_PQBuffer((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_14psycopg_binary_2pq_PQBuffer(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_14psycopg_binary_2pq_PQBuffer) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    __Pyx_PyErr_FetchException(&etype, &eval, &etb);
    __Pyx_DeallocKeepAliveBegin(o);
    __pyx_pw_14psycopg_binary_2pq_8PQBuffer_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    __Pyx_PyErr_RestoreException(etype, eval, etb);
  }
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_PQBuffer < 32) & __PYX_CHECK_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PQBuffer, sizeof(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer))))
  {
    __pyx_mstate_global->__pyx_freelist_14psycopg_binary_2pq_PQBuffer[__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_PQBuffer++] = ((struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *)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 PyMethodDef __pyx_methods_14psycopg_binary_2pq_PQBuffer[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PQBuffer_11__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_8PQBuffer_13__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
#if !CYTHON_COMPILING_IN_LIMITED_API

static PyBufferProcs __pyx_tp_as_buffer_PQBuffer = {
  __pyx_pw_14psycopg_binary_2pq_8PQBuffer_7__getbuffer__, /*bf_getbuffer*/
  __pyx_pw_14psycopg_binary_2pq_8PQBuffer_9__releasebuffer__, /*bf_releasebuffer*/
};
#endif
static PyType_Slot __pyx_type_14psycopg_binary_2pq_PQBuffer_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_14psycopg_binary_2pq_PQBuffer},
  {Py_tp_repr, (void *)__pyx_pw_14psycopg_binary_2pq_8PQBuffer_5__repr__},
  #if defined(Py_bf_getbuffer)
  {Py_bf_getbuffer, (void *)__pyx_pw_14psycopg_binary_2pq_8PQBuffer_7__getbuffer__},
  #endif
  #if defined(Py_bf_releasebuffer)
  {Py_bf_releasebuffer, (void *)__pyx_pw_14psycopg_binary_2pq_8PQBuffer_9__releasebuffer__},
  #endif
  {Py_tp_doc, (void *)PyDoc_STR("\n    Wrap a chunk of memory allocated by the libpq and expose it as memoryview.\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_14psycopg_binary_2pq_PQBuffer},
  {Py_tp_new, (void *)__pyx_tp_new_14psycopg_binary_2pq_PQBuffer},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_14psycopg_binary_2pq_PQBuffer},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_14psycopg_binary_2pq_PQBuffer_spec = {
  "psycopg_binary.pq.PQBuffer",
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
  __pyx_type_14psycopg_binary_2pq_PQBuffer_slots,
};
#else

static PyBufferProcs __pyx_tp_as_buffer_PQBuffer = {
  __pyx_pw_14psycopg_binary_2pq_8PQBuffer_7__getbuffer__, /*bf_getbuffer*/
  __pyx_pw_14psycopg_binary_2pq_8PQBuffer_9__releasebuffer__, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type_14psycopg_binary_2pq_PQBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_binary.pq.""PQBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_PQBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_14psycopg_binary_2pq_PQBuffer, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_14psycopg_binary_2pq_8PQBuffer_5__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*/
  &__pyx_tp_as_buffer_PQBuffer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n    Wrap a chunk of memory allocated by the libpq and expose it as memoryview.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_14psycopg_binary_2pq_PQBuffer, /*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_14psycopg_binary_2pq_PQBuffer, /*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) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_14psycopg_binary_2pq_PQBuffer, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_14psycopg_binary_2pq_ViewBuffer __pyx_vtable_14psycopg_binary_2pq_ViewBuffer;

static PyObject *__pyx_tp_new__initialisation_14psycopg_binary_2pq_ViewBuffer(PyObject *o, 
#if CYTHON_VECTORCALL_TPNEW
    CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
#else
    CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
#endif
) {
  struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *p = ((struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)o);
  p->__pyx_vtab = __pyx_vtabptr_14psycopg_binary_2pq_ViewBuffer;
  p->obj = Py_None; Py_INCREF(Py_None);
  {
    int cinit_result = __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_1__cinit__(
    #if CYTHON_VECTORCALL_TPNEW
    o, NULL, 0, NULL);
    #else
    o, __pyx_mstate_global->__pyx_empty_tuple, NULL);
    #endif
    if (unlikely(cinit_result)) goto bad;
  }
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_new_vectorcall_14psycopg_binary_2pq_ViewBuffer(PyTypeObject *t, 
#if CYTHON_VECTORCALL_TPNEW
    PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
#else
    PyObject *a, PyObject *k
#endif
) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_ViewBuffer > 0) & __PYX_CHECK_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer, sizeof(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_14psycopg_binary_2pq_ViewBuffer[--__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_ViewBuffer];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer));
    #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, 0);
  }
  if (unlikely(!o)) return 0;
  return __pyx_tp_new__initialisation_14psycopg_binary_2pq_ViewBuffer(o, 
#if CYTHON_VECTORCALL_TPNEW
    args, nargs, kwnames
#else
    a, k
#endif
);
}

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_new_14psycopg_binary_2pq_ViewBuffer(PyTypeObject *t, PyObject *a, PyObject *k) {
  return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_14psycopg_binary_2pq_ViewBuffer, t, a, k);
}
#endif

#if CYTHON_VECTORCALL_TPNEW
static PyObject *__pyx_tp_vectorcall_14psycopg_binary_2pq_ViewBuffer(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
  if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
    return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
  }
  Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  PyObject *o = __pyx_tp_new_vectorcall_14psycopg_binary_2pq_ViewBuffer((PyTypeObject*)t, args, nargs, kwnames);
  return o;
}
#endif

static void __pyx_tp_dealloc_14psycopg_binary_2pq_ViewBuffer(PyObject *o) {
  struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *p = (struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)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_14psycopg_binary_2pq_ViewBuffer) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->obj);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_ViewBuffer < 32) & __PYX_CHECK_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer, sizeof(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer))))
  {
    __pyx_mstate_global->__pyx_freelist_14psycopg_binary_2pq_ViewBuffer[__pyx_mstate_global->__pyx_freecount_14psycopg_binary_2pq_ViewBuffer++] = ((struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)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_14psycopg_binary_2pq_ViewBuffer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *p = (struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->obj) {
    e = (*v)(p->obj, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_14psycopg_binary_2pq_ViewBuffer(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *p = (struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *)o;
  tmp = ((PyObject*)p->obj);
  p->obj = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_14psycopg_binary_2pq_ViewBuffer[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_9__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_11__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
#if !CYTHON_COMPILING_IN_LIMITED_API

static PyBufferProcs __pyx_tp_as_buffer_ViewBuffer = {
  __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_5__getbuffer__, /*bf_getbuffer*/
  __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_7__releasebuffer__, /*bf_releasebuffer*/
};
#endif
static PyType_Slot __pyx_type_14psycopg_binary_2pq_ViewBuffer_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_14psycopg_binary_2pq_ViewBuffer},
  {Py_tp_repr, (void *)__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_3__repr__},
  #if defined(Py_bf_getbuffer)
  {Py_bf_getbuffer, (void *)__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_5__getbuffer__},
  #endif
  #if defined(Py_bf_releasebuffer)
  {Py_bf_releasebuffer, (void *)__pyx_pw_14psycopg_binary_2pq_10ViewBuffer_7__releasebuffer__},
  #endif
  {Py_tp_doc, (void *)PyDoc_STR("\n    Wrap a chunk of memory owned by a different object.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_14psycopg_binary_2pq_ViewBuffer},
  {Py_tp_clear, (void *)__pyx_tp_clear_14psycopg_binary_2pq_ViewBuffer},
  {Py_tp_methods, (void *)__pyx_methods_14psycopg_binary_2pq_ViewBuffer},
  {Py_tp_new, (void *)__pyx_tp_new_14psycopg_binary_2pq_ViewBuffer},
  #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_14psycopg_binary_2pq_ViewBuffer},
  #endif
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_14psycopg_binary_2pq_ViewBuffer_spec = {
  "psycopg_binary.pq.ViewBuffer",
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_14psycopg_binary_2pq_ViewBuffer_slots,
};
#else

static PyBufferProcs __pyx_tp_as_buffer_ViewBuffer = {
  __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_5__getbuffer__, /*bf_getbuffer*/
  __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_7__releasebuffer__, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type_14psycopg_binary_2pq_ViewBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_binary.pq.""ViewBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_14psycopg_binary_2pq_ViewBuffer, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_14psycopg_binary_2pq_10ViewBuffer_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*/
  &__pyx_tp_as_buffer_ViewBuffer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    Wrap a chunk of memory owned by a different object.\n    "), /*tp_doc*/
  __pyx_tp_traverse_14psycopg_binary_2pq_ViewBuffer, /*tp_traverse*/
  __pyx_tp_clear_14psycopg_binary_2pq_ViewBuffer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_14psycopg_binary_2pq_ViewBuffer, /*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_14psycopg_binary_2pq_ViewBuffer, /*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) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
  #if CYTHON_VECTORCALL_TPNEW
  __pyx_tp_vectorcall_14psycopg_binary_2pq_ViewBuffer, /*tp_vectorcall*/
  #else
  NULL, /*tp_vectorcall*/
  #endif
  #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 < 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_InitAfterSharedUtility(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_Exttype___pyx_obj_14psycopg_binary_2pq_PGconn(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGresult(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGcancelConn(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGcancel(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_Escaping(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PQBuffer(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_ViewBuffer(__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_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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Function_export_code", 0);
  /*--- Function export code ---*/
  {
    __pyx_t_1 = __Pyx_ApiExport_GetApiDict(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_export_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_int_PyObject_char_Py_ssize_t__bu);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_export_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_export_name = __pyx_export_signature + 40;
    void (*const __pyx_export_pointers[])(void) = {(void (*)(void))&__pyx_f_14psycopg_binary_2pq__buffer_as_string_and_size, (void (*)(void)) NULL};
    void (*const *__pyx_export_pointer)(void) = __pyx_export_pointers;
    const char *__pyx_export_current_signature = __pyx_export_signature;
    while (*__pyx_export_pointer) {
      if (__Pyx_ExportFunction(__pyx_t_1, __pyx_export_name, *__pyx_export_pointer, __pyx_export_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_export_pointer;
      __pyx_export_name = strchr(__pyx_export_name, '\0') + 1;
      __pyx_export_signature = strchr(__pyx_export_signature, '\0') + 1;
      if (*__pyx_export_signature != '\0') __pyx_export_current_signature = __pyx_export_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;
}

static int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGconn(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGconn", 0);
  /*--- Exttype __pyx_obj_14psycopg_binary_2pq_PGconn ---*/
  __pyx_vtabptr_14psycopg_binary_2pq_PGconn = &__pyx_vtable_14psycopg_binary_2pq_PGconn;
  __pyx_vtable_14psycopg_binary_2pq_PGconn._from_ptr = (struct __pyx_obj_14psycopg_binary_2pq_PGconn *(*)(PGconn *))__pyx_f_14psycopg_binary_2pq_6PGconn__from_ptr;
  __pyx_vtable_14psycopg_binary_2pq_PGconn.flush = (int (*)(struct __pyx_obj_14psycopg_binary_2pq_PGconn *, int __pyx_skip_dispatch))__pyx_f_14psycopg_binary_2pq_6PGconn_flush;
  __pyx_vtable_14psycopg_binary_2pq_PGconn.notifies = (PyObject *(*)(struct __pyx_obj_14psycopg_binary_2pq_PGconn *, int __pyx_skip_dispatch))__pyx_f_14psycopg_binary_2pq_6PGconn_notifies;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_14psycopg_binary_2pq_PGconn_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn)) __PYX_ERR(1, 48, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn = &__pyx_type_14psycopg_binary_2pq_PGconn;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn) < (0)) __PYX_ERR(1, 48, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn->tp_dictoffset && __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_vtabptr_14psycopg_binary_2pq_PGconn) < (0)) __PYX_ERR(1, 48, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PGconn, (PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn) < (0)) __PYX_ERR(1, 48, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn->tp_weaklistoffset = offsetof(struct __pyx_obj_14psycopg_binary_2pq_PGconn, __weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGconn) < (0)) __PYX_ERR(1, 48, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGresult(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGresult", 0);
  /*--- Exttype __pyx_obj_14psycopg_binary_2pq_PGresult ---*/
  __pyx_vtabptr_14psycopg_binary_2pq_PGresult = &__pyx_vtable_14psycopg_binary_2pq_PGresult;
  __pyx_vtable_14psycopg_binary_2pq_PGresult._from_ptr = (struct __pyx_obj_14psycopg_binary_2pq_PGresult *(*)(PGresult *))__pyx_f_14psycopg_binary_2pq_8PGresult__from_ptr;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_14psycopg_binary_2pq_PGresult_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult)) __PYX_ERR(3, 14, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult = &__pyx_type_14psycopg_binary_2pq_PGresult;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult->tp_dictoffset && __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_vtabptr_14psycopg_binary_2pq_PGresult) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PGresult, (PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGresult) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGcancelConn(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGcancelConn", 0);
  /*--- Exttype __pyx_obj_14psycopg_binary_2pq_PGcancelConn ---*/
  __pyx_vtabptr_14psycopg_binary_2pq_PGcancelConn = &__pyx_vtable_14psycopg_binary_2pq_PGcancelConn;
  __pyx_vtable_14psycopg_binary_2pq_PGcancelConn._from_ptr = (struct __pyx_obj_14psycopg_binary_2pq_PGcancelConn *(*)(PGcancelConn *))__pyx_f_14psycopg_binary_2pq_12PGcancelConn__from_ptr;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_14psycopg_binary_2pq_PGcancelConn_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn)) __PYX_ERR(4, 8, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn = &__pyx_type_14psycopg_binary_2pq_PGcancelConn;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn) < (0)) __PYX_ERR(4, 8, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn->tp_dictoffset && __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn, __pyx_vtabptr_14psycopg_binary_2pq_PGcancelConn) < (0)) __PYX_ERR(4, 8, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PGcancelConn, (PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn) < (0)) __PYX_ERR(4, 8, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn) < (0)) __PYX_ERR(4, 8, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGcancel(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGcancel", 0);
  /*--- Exttype __pyx_obj_14psycopg_binary_2pq_PGcancel ---*/
  __pyx_vtabptr_14psycopg_binary_2pq_PGcancel = &__pyx_vtable_14psycopg_binary_2pq_PGcancel;
  __pyx_vtable_14psycopg_binary_2pq_PGcancel._from_ptr = (struct __pyx_obj_14psycopg_binary_2pq_PGcancel *(*)(PGcancel *))__pyx_f_14psycopg_binary_2pq_8PGcancel__from_ptr;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_14psycopg_binary_2pq_PGcancel_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel)) __PYX_ERR(4, 79, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel = &__pyx_type_14psycopg_binary_2pq_PGcancel;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel) < (0)) __PYX_ERR(4, 79, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel->tp_dictoffset && __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel, __pyx_vtabptr_14psycopg_binary_2pq_PGcancel) < (0)) __PYX_ERR(4, 79, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PGcancel, (PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel) < (0)) __PYX_ERR(4, 79, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PGcancel) < (0)) __PYX_ERR(4, 79, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_Escaping(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_Escaping", 0);
  /*--- Exttype __pyx_obj_14psycopg_binary_2pq_Escaping ---*/
  __pyx_vtabptr_14psycopg_binary_2pq_Escaping = &__pyx_vtable_14psycopg_binary_2pq_Escaping;
  __pyx_vtable_14psycopg_binary_2pq_Escaping.escape_literal = (PyObject *(*)(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch))__pyx_f_14psycopg_binary_2pq_8Escaping_escape_literal;
  __pyx_vtable_14psycopg_binary_2pq_Escaping.escape_identifier = (PyObject *(*)(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch))__pyx_f_14psycopg_binary_2pq_8Escaping_escape_identifier;
  __pyx_vtable_14psycopg_binary_2pq_Escaping.escape_string = (PyObject *(*)(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch))__pyx_f_14psycopg_binary_2pq_8Escaping_escape_string;
  __pyx_vtable_14psycopg_binary_2pq_Escaping.escape_bytea = (PyObject *(*)(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch))__pyx_f_14psycopg_binary_2pq_8Escaping_escape_bytea;
  __pyx_vtable_14psycopg_binary_2pq_Escaping.unescape_bytea = (PyObject *(*)(struct __pyx_obj_14psycopg_binary_2pq_Escaping *, unsigned char const *, int __pyx_skip_dispatch))__pyx_f_14psycopg_binary_2pq_8Escaping_unescape_bytea;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_14psycopg_binary_2pq_Escaping_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping)) __PYX_ERR(6, 11, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping = &__pyx_type_14psycopg_binary_2pq_Escaping;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping) < (0)) __PYX_ERR(6, 11, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping->tp_dictoffset && __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping, __pyx_vtabptr_14psycopg_binary_2pq_Escaping) < (0)) __PYX_ERR(6, 11, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Escaping, (PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping) < (0)) __PYX_ERR(6, 11, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_Escaping) < (0)) __PYX_ERR(6, 11, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PQBuffer(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PQBuffer", 0);
  /*--- Exttype __pyx_obj_14psycopg_binary_2pq_PQBuffer ---*/
  __pyx_vtabptr_14psycopg_binary_2pq_PQBuffer = &__pyx_vtable_14psycopg_binary_2pq_PQBuffer;
  __pyx_vtable_14psycopg_binary_2pq_PQBuffer._from_buffer = (struct __pyx_obj_14psycopg_binary_2pq_PQBuffer *(*)(unsigned char *, Py_ssize_t))__pyx_f_14psycopg_binary_2pq_8PQBuffer__from_buffer;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_14psycopg_binary_2pq_PQBuffer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer)) __PYX_ERR(7, 13, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer->tp_as_buffer = &__pyx_tp_as_buffer_PQBuffer;
  #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
  /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
  #endif
  #else
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer = &__pyx_type_14psycopg_binary_2pq_PQBuffer;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer->tp_dictoffset && __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer, __pyx_vtabptr_14psycopg_binary_2pq_PQBuffer) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PQBuffer, (PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_PQBuffer) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_ViewBuffer(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_ViewBuffer", 0);
  /*--- Exttype __pyx_obj_14psycopg_binary_2pq_ViewBuffer ---*/
  __pyx_vtabptr_14psycopg_binary_2pq_ViewBuffer = &__pyx_vtable_14psycopg_binary_2pq_ViewBuffer;
  __pyx_vtable_14psycopg_binary_2pq_ViewBuffer._from_buffer = (struct __pyx_obj_14psycopg_binary_2pq_ViewBuffer *(*)(PyObject *, unsigned char *, Py_ssize_t))__pyx_f_14psycopg_binary_2pq_10ViewBuffer__from_buffer;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_14psycopg_binary_2pq_ViewBuffer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer)) __PYX_ERR(7, 56, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer->tp_as_buffer = &__pyx_tp_as_buffer_ViewBuffer;
  #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
  /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
  #endif
  #else
  __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer = &__pyx_type_14psycopg_binary_2pq_ViewBuffer;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer) < (0)) __PYX_ERR(7, 56, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer->tp_dictoffset && __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer, __pyx_vtabptr_14psycopg_binary_2pq_ViewBuffer) < (0)) __PYX_ERR(7, 56, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ViewBuffer, (PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer) < (0)) __PYX_ERR(7, 56, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_14psycopg_binary_2pq_ViewBuffer) < (0)) __PYX_ERR(7, 56, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __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(8, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(8, 9, __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);
  __Pyx_RefNannySetupContext("__Pyx_modinit_Function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_pq(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_pq},
  #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_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "pq",
      __pyx_k_libpq_Python_wrapper_using_cyth, /* 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_pq(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_pq(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
      (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            if (!PyErr_ExceptionMatches(PyExc_Exception)) {
                goto bad; // BaseException
            }
            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 < 0x030A0000 &&\
      (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
    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_pq(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;
  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
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'pq' 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 "pq" 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) {
    if (PyErr_ExceptionMatches(PyExc_Exception)) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
    }
    if (!__Pyx_RefNanny)
        Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  
__Pyx_RefNannySetupContext("PyInit_pq", 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_psycopg_binary__pq) {
    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, "psycopg_binary.pq")) {
      if (unlikely((PyDict_SetItemString(modules, "psycopg_binary.pq", __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);
  if (unlikely((__Pyx_modinit_Function_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Type init code ---*/
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGconn(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGresult(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGcancelConn(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PGcancel(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_Escaping(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_PQBuffer(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_Exttype___pyx_obj_14psycopg_binary_2pq_ViewBuffer(__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);
  (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
  if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Execution code ---*/

  /* "psycopg_binary/pq.pyx":9
 * from psycopg_binary.pq cimport libpq
 * 
 * import logging             # <<<<<<<<<<<<<<
 * 
 * from psycopg import errors as e
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_logging, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __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_logging, __pyx_t_2) < (0)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq.pyx":11
 * import logging
 * 
 * from psycopg import errors as e             # <<<<<<<<<<<<<<
 * 
 * logger = logging.getLogger("psycopg")
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_errors};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __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_errors};
    __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, 11, __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_e, __pyx_t_4) < (0)) __PYX_ERR(0, 11, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq.pyx":13
 * from psycopg import errors as e
 * 
 * logger = logging.getLogger("psycopg")             # <<<<<<<<<<<<<<
 * 
 * __impl__ = "binary"
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_psycopg};
    __pyx_t_2 = __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_2)) __PYX_ERR(0, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_logger, __pyx_t_2) < (0)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq.pyx":15
 * logger = logging.getLogger("psycopg")
 * 
 * __impl__ = "binary"             # <<<<<<<<<<<<<<
 * __build_version__ = libpq.PG_VERSION_NUM
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_impl, __pyx_mstate_global->__pyx_n_u_binary) < (0)) __PYX_ERR(0, 15, __pyx_L1_error)

  /* "psycopg_binary/pq.pyx":16
 * 
 * __impl__ = "binary"
 * __build_version__ = libpq.PG_VERSION_NUM             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(PG_VERSION_NUM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_build_version, __pyx_t_2) < (0)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq.pyx":19
 * 
 * 
 * def version():             # <<<<<<<<<<<<<<
 *     return libpq.PQlibVersion()
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_1version, 0, __pyx_mstate_global->__pyx_n_u_version, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __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_version, __pyx_t_2) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":29
 * from cpython.memoryview cimport PyMemoryView_FromObject
 * 
 * import sys             # <<<<<<<<<<<<<<
 * 
 * from psycopg.pq import Format as PqFormat
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __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_sys, __pyx_t_2) < (0)) __PYX_ERR(1, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":31
 * import sys
 * 
 * from psycopg.pq import Format as PqFormat             # <<<<<<<<<<<<<<
 * from psycopg.pq import Trace, version_pretty
 * from psycopg.pq.misc import PGnotify, _clean_error_message, connection_summary
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Format};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __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_Format};
    __pyx_t_3 = 0; {
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 31, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      switch (__pyx_t_3) {
        case 0:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PqFormat, __pyx_t_6) < (0)) __PYX_ERR(1, 31, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":32
 * 
 * from psycopg.pq import Format as PqFormat
 * from psycopg.pq import Trace, version_pretty             # <<<<<<<<<<<<<<
 * from psycopg.pq.misc import PGnotify, _clean_error_message, connection_summary
 * from psycopg.pq._enums import ExecStatus
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Trace,__pyx_mstate_global->__pyx_n_u_version_pretty};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq, __pyx_imported_names, 2, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __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_Trace,__pyx_mstate_global->__pyx_n_u_version_pretty};
    for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) {
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_6) < (0)) __PYX_ERR(1, 32, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":33
 * from psycopg.pq import Format as PqFormat
 * from psycopg.pq import Trace, version_pretty
 * from psycopg.pq.misc import PGnotify, _clean_error_message, connection_summary             # <<<<<<<<<<<<<<
 * from psycopg.pq._enums import ExecStatus
 * from psycopg._encodings import pg2pyenc
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_PGnotify,__pyx_mstate_global->__pyx_n_u_clean_error_message,__pyx_mstate_global->__pyx_n_u_connection_summary};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq_misc, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __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_PGnotify,__pyx_mstate_global->__pyx_n_u_clean_error_message,__pyx_mstate_global->__pyx_n_u_connection_summary};
    for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) {
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_6) < (0)) __PYX_ERR(1, 33, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":34
 * from psycopg.pq import Trace, version_pretty
 * from psycopg.pq.misc import PGnotify, _clean_error_message, connection_summary
 * from psycopg.pq._enums import ExecStatus             # <<<<<<<<<<<<<<
 * from psycopg._encodings import pg2pyenc
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ExecStatus};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq__enums, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __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_ExecStatus};
    __pyx_t_3 = 0; {
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 34, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_6) < (0)) __PYX_ERR(1, 34, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":35
 * from psycopg.pq.misc import PGnotify, _clean_error_message, connection_summary
 * from psycopg.pq._enums import ExecStatus
 * from psycopg._encodings import pg2pyenc             # <<<<<<<<<<<<<<
 * 
 * from psycopg_binary.pq cimport PQBuffer
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_pg2pyenc};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg__encodings, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __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_pg2pyenc};
    __pyx_t_3 = 0; {
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 35, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_6) < (0)) __PYX_ERR(1, 35, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":73
 *         return f"<{cls} {info} at 0x{id(self):x}>"
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGconn) < (0)) __PYX_ERR(1, 73, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_7connect, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_connect, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect, __pyx_t_6) < (0)) __PYX_ERR(1, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject*)__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect, __pyx_t_2) < (0)) __PYX_ERR(1, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":81
 *         return PGconn._from_ptr(pgconn)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGconn) < (0)) __PYX_ERR(1, 81, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_9connect_start, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_connect_start, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect_start, __pyx_t_6) < (0)) __PYX_ERR(1, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject*)__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect_start, __pyx_t_2) < (0)) __PYX_ERR(1, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":89
 *         return PGconn._from_ptr(pgconn)
 * 
 *     def connect_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 89, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_11connect_poll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_connect_poll, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect_poll, __pyx_t_6) < (0)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":92
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr is not NULL:
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 92, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_13finish, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_finish, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_finish, __pyx_t_2) < (0)) __PYX_ERR(1, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":121
 *         return rv
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 121, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_15reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_reset, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_6) < (0)) __PYX_ERR(1, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":129
 *             raise e.OperationalError("the connection is closed")
 * 
 *     def reset_start(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 129, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_17reset_start, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_reset_start, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 129, __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_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_reset_start, __pyx_t_2) < (0)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":136
 *             raise e.OperationalError("couldn't reset connection")
 * 
 *     def reset_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 136, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_19reset_poll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_reset_poll, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_reset_poll, __pyx_t_6) < (0)) __PYX_ERR(1, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":139
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 139, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_21ping, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_ping, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __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_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_ping, __pyx_t_2) < (0)) __PYX_ERR(1, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_ping); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_ping, __pyx_t_6) < (0)) __PYX_ERR(1, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":198
 *         return rv
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef const char *rv = <const char *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQparameterStatus, name)
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_bytes_None) < (0)) __PYX_ERR(1, 198, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_23parameter_status, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_parameter_status, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 198, __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_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_parameter_status, __pyx_t_2) < (0)) __PYX_ERR(1, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":213
 *         return rv
 * 
 *     def get_error_message(self, encoding: str = "") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_encoding, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(1, 213, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(1, 213, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_25get_error_message, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_get_error_message, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_t_6) < (0)) __PYX_ERR(1, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":288
 *         return bool(_call_libpq_int(self, <conn_int_f>libpq.PQsslInUse))
 * 
 *     def exec_(self, const char *command) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 288, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_27exec_, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_exec, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __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_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_exec, __pyx_t_2) < (0)) __PYX_ERR(1, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":301
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 301, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_29send_query, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_query, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_query, __pyx_t_6) < (0)) __PYX_ERR(1, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":319
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         cdef Py_ssize_t cnparams
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__7 = __pyx_t_8;


  /* "psycopg_binary/pq/pgconn.pyx":318
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_binary/pq/pgconn.pyx":319
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         cdef Py_ssize_t cnparams
*/
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);


  /* "psycopg_binary/pq/pgconn.pyx":313
 *                 f"sending query failed: {self.get_error_message()}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/
  {
    PyObject* __pyx_temp[3] = {Py_None, Py_None, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_param_values, __pyx_mstate_global->__pyx_kp_u_Sequence_bytes_None_None) < (0)) __PYX_ERR(1, 313, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_param_types, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 313, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_param_formats, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 313, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 313, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_31exec_params, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_exec_params, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 313, __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_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_exec_params, __pyx_t_4) < (0)) __PYX_ERR(1, 313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":350
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         cdef Py_ssize_t cnparams
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_mstate_global->__pyx_k__8 = __pyx_t_8;


  /* "psycopg_binary/pq/pgconn.pyx":349
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "psycopg_binary/pq/pgconn.pyx":350
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         cdef Py_ssize_t cnparams
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);


  /* "psycopg_binary/pq/pgconn.pyx":344
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/
  {
    PyObject* __pyx_temp[3] = {Py_None, Py_None, __pyx_t_4};
    __pyx_t_6 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_values, __pyx_mstate_global->__pyx_kp_u_Sequence_bytes_None_None) < (0)) __PYX_ERR(1, 344, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_types, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 344, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_formats, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 344, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 344, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_33send_query_params, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_query_params, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 344, __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_SetDefaultsTuple(__pyx_t_2, __pyx_t_6);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_query_params, __pyx_t_2) < (0)) __PYX_ERR(1, 344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":375
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_param_types, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 375, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 375, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_35send_prepare, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_prepare, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 375, __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_mstate_global->__pyx_tuple[3]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_prepare, __pyx_t_4) < (0)) __PYX_ERR(1, 375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":414
 *         param_values: Sequence[bytes | None] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         cdef Py_ssize_t cnparams
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__9 = __pyx_t_8;


  /* "psycopg_binary/pq/pgconn.pyx":413
 *         const char *name,
 *         param_values: Sequence[bytes | None] | None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_binary/pq/pgconn.pyx":414
 *         param_values: Sequence[bytes | None] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         cdef Py_ssize_t cnparams
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);


  /* "psycopg_binary/pq/pgconn.pyx":409
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  {
    PyObject* __pyx_temp[2] = {Py_None, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_values, __pyx_mstate_global->__pyx_kp_u_Sequence_bytes_None_None) < (0)) __PYX_ERR(1, 409, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_formats, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 409, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 409, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_37send_query_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_query_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_query_prepared, __pyx_t_6) < (0)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":439
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_param_types, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 439, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 439, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_39prepare, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_prepare, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 439, __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_mstate_global->__pyx_tuple[3]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_prepare, __pyx_t_4) < (0)) __PYX_ERR(1, 439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":477
 *         param_values: Sequence[bytes] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         cdef Py_ssize_t cnparams
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 477, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_mstate_global->__pyx_k__10 = __pyx_t_8;


  /* "psycopg_binary/pq/pgconn.pyx":476
 *         const char *name,
 *         param_values: Sequence[bytes] | None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "psycopg_binary/pq/pgconn.pyx":477
 *         param_values: Sequence[bytes] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         cdef Py_ssize_t cnparams
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 477, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);


  /* "psycopg_binary/pq/pgconn.pyx":472
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  {
    PyObject* __pyx_temp[2] = {Py_None, __pyx_t_4};
    __pyx_t_6 = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_values, __pyx_mstate_global->__pyx_kp_u_Sequence_bytes_None) < (0)) __PYX_ERR(1, 472, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_formats, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 472, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 472, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_41exec_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_exec_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __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_SetDefaultsTuple(__pyx_t_2, __pyx_t_6);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_exec_prepared, __pyx_t_2) < (0)) __PYX_ERR(1, 472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":504
 *         return PGresult._from_ptr(rv)
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, name)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 504, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_43describe_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_describe_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 504, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_describe_prepared, __pyx_t_4) < (0)) __PYX_ERR(1, 504, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":513
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, name)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 513, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_45send_describe_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_describe_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 513, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_describe_prepared, __pyx_t_2) < (0)) __PYX_ERR(1, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":521
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePortal, name)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 521, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_47describe_portal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_describe_portal, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 521, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_describe_portal, __pyx_t_4) < (0)) __PYX_ERR(1, 521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":530
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, name)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 530, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_49send_describe_portal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_describe_portal, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 530, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_describe_portal, __pyx_t_2) < (0)) __PYX_ERR(1, 530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":538
 *             )
 * 
 *     def close_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePrepared", 170000)
 *         cdef libpq.PGresult *rv
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 538, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_51close_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_close_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 538, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_close_prepared, __pyx_t_4) < (0)) __PYX_ERR(1, 538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":553
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePrepared", 170000)
 *         cdef int rv
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 553, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_53send_close_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_close_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 553, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_close_prepared, __pyx_t_2) < (0)) __PYX_ERR(1, 553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":567
 *             )
 * 
 *     def close_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePortal", 170000)
 *         cdef libpq.PGresult *rv
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 567, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_55close_portal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_close_portal, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 567, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_close_portal, __pyx_t_4) < (0)) __PYX_ERR(1, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":582
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePortal", 170000)
 *         cdef int rv
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 582, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_57send_close_portal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_close_portal, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_close_portal, __pyx_t_2) < (0)) __PYX_ERR(1, 582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":596
 *             )
 * 
 *     def get_result(self) -> "PGresult" | None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_PGresult_None) < (0)) __PYX_ERR(1, 596, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_59get_result, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_get_result, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 596, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_get_result, __pyx_t_4) < (0)) __PYX_ERR(1, 596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":604
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 604, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_61consume_input, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_consume_input, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 604, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_consume_input, __pyx_t_2) < (0)) __PYX_ERR(1, 604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":612
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 612, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_63is_busy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_is_busy, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 612, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_is_busy, __pyx_t_4) < (0)) __PYX_ERR(1, 612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":634
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
 *     cpdef int flush(self) except -1:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_65flush, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_flush, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 634, __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_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_flush, __pyx_t_4) < (0)) __PYX_ERR(1, 634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":646
 *         return rv
 * 
 *     def set_single_row_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 646, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_67set_single_row_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_set_single_row_mode, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_set_single_row_mode, __pyx_t_2) < (0)) __PYX_ERR(1, 646, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":653
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef int s = size
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 653, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 653, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_69set_chunked_rows_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_set_chunked_rows_mode, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 653, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_set_chunked_rows_mode, __pyx_t_4) < (0)) __PYX_ERR(1, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":661
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
 *     def cancel_conn(self) -> PGcancelConn:             # <<<<<<<<<<<<<<
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGcancelConn) < (0)) __PYX_ERR(1, 661, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_71cancel_conn, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_cancel_conn, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_cancel_conn, __pyx_t_2) < (0)) __PYX_ERR(1, 661, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":670
 *         return PGcancelConn._from_ptr(ptr)
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGcancel) < (0)) __PYX_ERR(1, 670, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_73get_cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_get_cancel, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 670, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_get_cancel, __pyx_t_4) < (0)) __PYX_ERR(1, 670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":678
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), nogil:
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_75notifies, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_notifies, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 678, __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_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_notifies, __pyx_t_4) < (0)) __PYX_ERR(1, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":689
 *             return None
 * 
 *     def put_copy_data(self, buffer) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef char *cbuffer
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 689, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_77put_copy_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_put_copy_data, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 689, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_put_copy_data, __pyx_t_2) < (0)) __PYX_ERR(1, 689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":702
 *         return rv
 * 
 *     def put_copy_end(self, error: bytes | None = None) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef const char *cerr = NULL
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_error, __pyx_mstate_global->__pyx_kp_u_bytes_None) < (0)) __PYX_ERR(1, 702, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 702, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_79put_copy_end, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_put_copy_end, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 702, __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_mstate_global->__pyx_tuple[3]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_put_copy_end, __pyx_t_4) < (0)) __PYX_ERR(1, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":715
 *         return rv
 * 
 *     def get_copy_data(self, int async_) -> tuple[int, memoryview]:             # <<<<<<<<<<<<<<
 *         cdef char *buffer_ptr = NULL
 *         cdef int nbytes
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_memoryview) < (0)) __PYX_ERR(1, 715, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_81get_copy_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_get_copy_data, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 715, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_get_copy_data, __pyx_t_2) < (0)) __PYX_ERR(1, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":731
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def trace(self, fileno: int) -> None:             # <<<<<<<<<<<<<<
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_fileno, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 731, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 731, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_83trace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_trace, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 731, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_trace, __pyx_t_4) < (0)) __PYX_ERR(1, 731, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":738
 *             libpq.PQtrace(self._pgconn_ptr, stream)
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = flags
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_flags, __pyx_mstate_global->__pyx_n_u_Trace) < (0)) __PYX_ERR(1, 738, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 738, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_85set_trace_flags, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_set_trace_flags, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 738, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_set_trace_flags, __pyx_t_2) < (0)) __PYX_ERR(1, 738, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":744
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
 * 
 *     def untrace(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             libpq.PQuntrace(self._pgconn_ptr)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 744, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_87untrace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_untrace, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 744, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_untrace, __pyx_t_4) < (0)) __PYX_ERR(1, 744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":748
 *             libpq.PQuntrace(self._pgconn_ptr)
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bytes_2) < (0)) __PYX_ERR(1, 748, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_89encrypt_password, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_encrypt_password, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 748, __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_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_encrypt_password, __pyx_t_2) < (0)) __PYX_ERR(1, 748, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":768
 *         return rv
 * 
 *     def change_password(             # <<<<<<<<<<<<<<
 *         self, const char *user, const char *passwd
 *     ) -> None:
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 768, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_91change_password, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_change_password, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 768, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_change_password, __pyx_t_4) < (0)) __PYX_ERR(1, 768, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":781
 *             )
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 781, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_93make_empty_result, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_make_empty_result, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 781, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_make_empty_result, __pyx_t_2) < (0)) __PYX_ERR(1, 781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":803
 *         return rv
 * 
 *     def enter_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enter pipeline mode.
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 803, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_95enter_pipeline_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_enter_pipeline_mode, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 803, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_enter_pipeline_mode, __pyx_t_4) < (0)) __PYX_ERR(1, 803, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":816
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
 *     def exit_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Exit pipeline mode.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 816, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_97exit_pipeline_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_exit_pipeline_mode, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 816, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_exit_pipeline_mode, __pyx_t_2) < (0)) __PYX_ERR(1, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":829
 *             raise e.OperationalError(self.get_error_message())
 * 
 *     def pipeline_sync(self) -> None:             # <<<<<<<<<<<<<<
 *         """Mark a synchronization point in a pipeline.
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 829, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_99pipeline_sync, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_pipeline_sync, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_pipeline_sync, __pyx_t_4) < (0)) __PYX_ERR(1, 829, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgconn.pyx":844
 *             raise e.OperationalError("failed to sync pipeline")
 * 
 *     def send_flush_request(self) -> None:             # <<<<<<<<<<<<<<
 *         """Sends a request for the server to flush its output buffer.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 844, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_6PGconn_101send_flush_request, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_flush_request, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 844, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_flush_request, __pyx_t_2) < (0)) __PYX_ERR(1, 844, __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_14psycopg_binary_2pq_6PGconn_103__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 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_14psycopg_binary_2pq_6PGconn_105__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":10
 * from cpython.mem cimport PyMem_Free, PyMem_Malloc
 * 
 * from psycopg.pq.misc import PGresAttDesc             # <<<<<<<<<<<<<<
 * from psycopg.pq._enums import ExecStatus
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_PGresAttDesc};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq_misc, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10, __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_PGresAttDesc};
    __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(3, 10, __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(3, 10, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":11
 * 
 * from psycopg.pq.misc import PGresAttDesc
 * from psycopg.pq._enums import ExecStatus             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ExecStatus};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq__enums, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 11, __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_ExecStatus};
    __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(3, 11, __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(3, 11, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":33
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
 * 
 *     def clear(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(3, 33, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_7clear, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_clear, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 33, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_clear, __pyx_t_4) < (0)) __PYX_ERR(3, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_encoding, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(3, 53, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(3, 53, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_9get_error_message, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_get_error_message, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 53, __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_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_t_2) < (0)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":56
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def error_field(self, int fieldcode) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_bytes_None) < (0)) __PYX_ERR(3, 56, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_11error_field, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_error_field, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 56, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_error_field, __pyx_t_4) < (0)) __PYX_ERR(3, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":71
 *         return libpq.PQnfields(self._pgresult_ptr)
 * 
 *     def fname(self, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_bytes_None) < (0)) __PYX_ERR(3, 71, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_13fname, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_fname, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 71, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_fname, __pyx_t_2) < (0)) __PYX_ERR(3, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":78
 *             return None
 * 
 *     def ftable(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 78, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_15ftable, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_ftable, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 78, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_ftable, __pyx_t_4) < (0)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":81
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 *     def ftablecol(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 81, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_17ftablecol, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_ftablecol, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 81, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_ftablecol, __pyx_t_2) < (0)) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":84
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 *     def fformat(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 84, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_19fformat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_fformat, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 84, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_fformat, __pyx_t_4) < (0)) __PYX_ERR(3, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":87
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 *     def ftype(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 87, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_21ftype, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_ftype, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_ftype, __pyx_t_2) < (0)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":90
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 *     def fmod(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 90, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_23fmod, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_fmod, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 90, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_fmod, __pyx_t_4) < (0)) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":93
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 *     def fsize(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 93, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_25fsize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_fsize, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 93, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_fsize, __pyx_t_2) < (0)) __PYX_ERR(3, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":100
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 * 
 *     def get_value(self, int row_number, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_bytes_None) < (0)) __PYX_ERR(3, 100, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_27get_value, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_get_value, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 100, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_get_value, __pyx_t_4) < (0)) __PYX_ERR(3, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":119
 *         return libpq.PQnparams(self._pgresult_ptr)
 * 
 *     def param_type(self, int param_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 119, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_29param_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_param_type, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 119, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_param_type, __pyx_t_2) < (0)) __PYX_ERR(3, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgresult.pyx":142
 *         return libpq.PQoidValue(self._pgresult_ptr)
 * 
 *     def set_attributes(self, descriptions: list[PGresAttDesc]):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t num = len(descriptions)
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_descriptions, __pyx_mstate_global->__pyx_kp_u_list_PGresAttDesc) < (0)) __PYX_ERR(3, 142, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGresult_31set_attributes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_set_attributes, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 142, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_set_attributes, __pyx_t_4) < (0)) __PYX_ERR(3, 142, __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_14psycopg_binary_2pq_8PGresult_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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(2, 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_14psycopg_binary_2pq_8PGresult_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":21
 *         self.finish()
 * 
 *     def start(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a non-blocking manner.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 21, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_5start, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_start, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 21, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_start, __pyx_t_2) < (0)) __PYX_ERR(4, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":32
 *             )
 * 
 *     def blocking(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a blocking manner.
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 32, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_7blocking, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_blocking, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 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
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_blocking, __pyx_t_4) < (0)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":43
 *             )
 * 
 *     def poll(self) -> int:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(4, 43, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_9poll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_poll, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 43, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_poll, __pyx_t_2) < (0)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":62
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_encoding, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(4, 62, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(4, 62, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_11get_error_message, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_get_error_message, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 62, __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_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_t_4) < (0)) __PYX_ERR(4, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":65
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 65, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_13reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_reset, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 65, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_2) < (0)) __PYX_ERR(4, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":69
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is not NULL:
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 69, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_15finish, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_finish, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 69, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_finish, __pyx_t_4) < (0)) __PYX_ERR(4, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":74
 *             self.pgcancelconn_ptr = NULL
 * 
 *     def _ensure_pgcancelconn(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is NULL:
 *             raise e.OperationalError("the cancel connection is closed")
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 74, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_12PGcancelConn_17_ensure_pgcancelconn, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn__ensure_pgcancelcon, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 74, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_ensure_pgcancelconn, __pyx_t_2) < (0)) __PYX_ERR(4, 74, __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_14psycopg_binary_2pq_12PGcancelConn_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 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_14psycopg_binary_2pq_12PGcancelConn_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":92
 *         self.free()
 * 
 *     def free(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 92, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGcancel_5free, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancel_free, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 92, __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_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancel, __pyx_mstate_global->__pyx_n_u_free, __pyx_t_4) < (0)) __PYX_ERR(4, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/pgcancel.pyx":97
 *             self.pgcancel_ptr = NULL
 * 
 *     def cancel(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 97, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8PGcancel_7cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancel_cancel, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 97, __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_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_14psycopg_binary_2pq_PGcancel, __pyx_mstate_global->__pyx_n_u_cancel, __pyx_t_2) < (0)) __PYX_ERR(4, 97, __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_14psycopg_binary_2pq_8PGcancel_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancel___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 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_14psycopg_binary_2pq_8PGcancel_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancel___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/conninfo.pyx":7
 * # Copyright (C) 2020 The Psycopg Team
 * 
 * from psycopg.pq.misc import ConninfoOption             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ConninfoOption};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq_misc, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 7, __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_ConninfoOption};
    __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(5, 7, __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(5, 7, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/conninfo.pyx":10
 * 
 * 
 * class Conninfo:             # <<<<<<<<<<<<<<
 *     @classmethod
 *     def get_defaults(cls) -> list[ConninfoOption]:
*/
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Conninfo, __pyx_mstate_global->__pyx_n_u_Conninfo, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_binary/pq/conninfo.pyx":11
 * 
 * class Conninfo:
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_defaults(cls) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_ConninfoOption) < (0)) __PYX_ERR(5, 11, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8Conninfo_1get_defaults, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_mstate_global->__pyx_n_u_Conninfo_get_defaults, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_defaults, __pyx_t_4) < (0)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/conninfo.pyx":20
 *         return rv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(cls, const char *conninfo) -> list[ConninfoOption]:
 *         cdef char *errmsg = NULL
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_ConninfoOption) < (0)) __PYX_ERR(5, 20, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8Conninfo_3parse, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_mstate_global->__pyx_n_u_Conninfo_parse, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_parse, __pyx_t_4) < (0)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/conninfo.pyx":36
 *         return rv
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8Conninfo_5__repr__, 0, __pyx_mstate_global->__pyx_n_u_Conninfo___repr, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 36, __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_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_repr, __pyx_t_4) < (0)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_binary/pq/conninfo.pyx":10
 * 
 * 
 * class Conninfo:             # <<<<<<<<<<<<<<
 *     @classmethod
 *     def get_defaults(cls) -> list[ConninfoOption]:
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Conninfo, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 10, __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_Conninfo, __pyx_t_4) < (0)) __PYX_ERR(5, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/escaping.pyx":15
 *         self.conn = conn
 * 
 *     cpdef escape_literal(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8Escaping_3escape_literal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping_escape_literal, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 15, __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_14psycopg_binary_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_escape_literal, __pyx_t_2) < (0)) __PYX_ERR(6, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/escaping.pyx":37
 *         return rv
 * 
 *     cpdef escape_identifier(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8Escaping_5escape_identifier, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping_escape_identifier, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 37, __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_14psycopg_binary_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_escape_identifier, __pyx_t_2) < (0)) __PYX_ERR(6, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/escaping.pyx":59
 *         return rv
 * 
 *     cpdef escape_string(self, data):             # <<<<<<<<<<<<<<
 *         cdef int error
 *         cdef size_t len_out
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8Escaping_7escape_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping_escape_string, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 59, __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_14psycopg_binary_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_escape_string, __pyx_t_2) < (0)) __PYX_ERR(6, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/escaping.pyx":90
 *         return rv
 * 
 *     cpdef escape_bytea(self, data):             # <<<<<<<<<<<<<<
 *         cdef size_t len_out
 *         cdef unsigned char *out
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8Escaping_9escape_bytea, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping_escape_bytea, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 90, __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_14psycopg_binary_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_escape_bytea, __pyx_t_2) < (0)) __PYX_ERR(6, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq/escaping.pyx":116
 *         return rv
 * 
 *     cpdef unescape_bytea(self, const unsigned char *data):             # <<<<<<<<<<<<<<
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8Escaping_11unescape_bytea, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping_unescape_bytea, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 116, __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_14psycopg_binary_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_unescape_bytea, __pyx_t_2) < (0)) __PYX_ERR(6, 116, __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_14psycopg_binary_2pq_8Escaping_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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_14psycopg_binary_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":17
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Escaping__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_8Escaping_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __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_14psycopg_binary_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 17, __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_14psycopg_binary_2pq_8PQBuffer_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PQBuffer___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 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_14psycopg_binary_2pq_8PQBuffer_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PQBuffer___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[90])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 3, __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_14psycopg_binary_2pq_10ViewBuffer_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewBuffer___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 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_14psycopg_binary_2pq_10ViewBuffer_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewBuffer___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq.pyx":32
 * 
 * # importing the ssl module sets up Python's libcrypto callbacks
 * import ssl  # no-cython-lint             # <<<<<<<<<<<<<<
 * 
 * # disable libcrypto setup in libpq, so it won't stomp on the callbacks
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ssl, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __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_ssl, __pyx_t_2) < (0)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq.pyx":36
 * # disable libcrypto setup in libpq, so it won't stomp on the callbacks
 * # that have already been set up
 * libpq.PQinitOpenSSL(1, 0)             # <<<<<<<<<<<<<<
*/
  PQinitOpenSSL(1, 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_Escaping(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14psycopg_binary_2pq_3__pyx_unpickle_Escaping, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Escaping, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_binary_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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_Escaping, __pyx_t_2) < (0)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_binary/pq.pyx":1
 * """             # <<<<<<<<<<<<<<
 * libpq Python wrapper using cython bindings.
 * """
*/
  __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_5);
  __Pyx_XDECREF(__pyx_t_6);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init psycopg_binary.pq", __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;
      __Pyx_PyErr_FetchException(&tp, &value, &tb);
      __Pyx_State_RemoveModule(&__pyx_moduledef);
      __Pyx_PyErr_RestoreException(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init psycopg_binary.pq");
  }
  __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) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(1, 71, __pyx_L1_error)

  /* Cached unbound methods */
  __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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "psycopg_binary/pq/conninfo.pyx":37
 * 
 *     def __repr__(self):
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_ascii};
    __pyx_mstate_global->__pyx_tuple[0] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(5, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "psycopg_binary/pq/conninfo.pyx":49
 *             break
 *         rv.append(
 *             ConninfoOption(             # <<<<<<<<<<<<<<
 *                 keyword=opt.keyword,
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,
*/
  {
    PyObject* __pyx_temp[7] = {__pyx_mstate_global->__pyx_n_u_keyword, __pyx_mstate_global->__pyx_n_u_envvar, __pyx_mstate_global->__pyx_n_u_compiled, __pyx_mstate_global->__pyx_n_u_val, __pyx_mstate_global->__pyx_n_u_label, __pyx_mstate_global->__pyx_n_u_dispchar, __pyx_mstate_global->__pyx_n_u_dispsize};
    __pyx_mstate_global->__pyx_tuple[1] = __Pyx_PyTuple_FromArray(__pyx_temp, 7); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(5, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "psycopg_binary/pq/pgconn.pyx":213
 *         return rv
 * 
 *     def get_error_message(self, encoding: str = "") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
*/
  {
    PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_kp_u__6};
    __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(1, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "psycopg_binary/pq/pgconn.pyx":375
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  {
    PyObject* __pyx_temp[1] = {Py_None};
    __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(1, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "psycopg_binary/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/
  {
    PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_kp_u_utf_8};
    __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(3, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  }
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<5; ++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) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  CYTHON_UNUSED_VAR(__pyx_mstate);
  {
    const struct { const unsigned int length: 8; } str_length_index[] = {{0},{1},{2},{2},{6},{18},{6},{24},{14},{12},{18},{32},{17},{1},{15},{1},{2},{1},{1},{1},{1},{179},{19},{23},{29},{22},{20},{7},{8},{30},{12},{28},{15},{23},{31},{24},{24},{37},{33},{32},{38},{40},{35},{29},{33},{25},{28},{33},{26},{7},{6},{28},{26},{48},{23},{45},{22},{33},{24},{29},{23},{22},{17},{41},{2},{4},{9},{20},{18},{50},{28},{24},{21},{30},{30},{30},{28},{30},{28},{31},{26},{25},{34},{31},{33},{22},{32},{28},{30},{31},{24},{22},{22},{5},{10},{8},{17},{21},{14},{14},{8},{26},{28},{21},{26},{23},{22},{23},{10},{6},{4},{17},{16},{8},{26},{28},{15},{13},{12},{30},{32},{33},{21},{19},{30},{17},{18},{18},{6},{24},{26},{18},{22},{19},{21},{14},{19},{20},{20},{22},{24},{23},{26},{12},{18},{20},{25},{13},{12},{17},{20},{24},{17},{14},{24},{15},{23},{11},{20},{14},{20},{19},{12},{17},{18},{24},{26},{27},{29},{25},{19},{17},{24},{26},{28},{26},{22},{12},{14},{8},{12},{8},{26},{28},{14},{20},{16},{13},{14},{14},{15},{18},{14},{26},{18},{19},{23},{8},{26},{28},{14},{16},{13},{15},{22},{21},{19},{18},{21},{10},{14},{17},{19},{15},{8},{4},{5},{10},{28},{30},{20},{12},{17},{9},{8},{7},{8},{12},{8},{8},{13},{10},{8},{7},{11},{12},{14},{12},{11},{10},{23},{14},{12},{10},{17},{13},{8},{12},{12},{19},{8},{20},{5},{9},{20},{13},{9},{5},{6},{18},{5},{9},{6},{6},{8},{3},{6},{10},{5},{5},{6},{11},{7},{4},{4},{8},{15},{5},{8},{18},{12},{14},{3},{8},{13},{8},{7},{8},{4},{7},{12},{13},{18},{8},{13},{4},{6},{7},{4},{6},{5},{15},{17},{12},{8},{8},{1},{8},{16},{19},{6},{6},{5},{11},{13},{6},{12},{17},{14},{13},{3},{9},{5},{11},{13},{11},{18},{1},{7},{9},{6},{6},{5},{5},{4},{5},{6},{4},{5},{6},{9},{5},{9},{10},{13},{12},{17},{10},{9},{1},{2},{3},{7},{5},{7},{5},{6},{5},{6},{7},{17},{4},{6},{8},{7},{3},{4},{3},{13},{12},{10},{11},{12},{16},{5},{6},{8},{6},{10},{8},{4},{13},{8},{4},{3},{7},{7},{18},{10},{17},{15},{17},{3},{13},{12},{3},{5},{10},{11},{13},{6},{10},{2},{1},{4},{17},{19},{20},{22},{18},{12},{10},{17},{19},{14},{21},{19},{15},{10},{4},{3},{5},{5},{6},{3},{6},{3},{7},{5},{10},{5},{6},{14},{7},{6},{12},{4},{1},{3},{6},{7},{14},{1}};
    const struct { const unsigned int length: 8; } bytes_length_index[] = {{0},{66},{9},{9},{11},{55},{102},{29},{52},{14},{105},{39},{39},{110},{75},{61},{106},{167},{177},{171},{161},{215},{204},{145},{145},{163},{190},{33},{24},{33},{22},{53},{42},{34},{37},{52},{19},{28},{43},{19},{49},{44},{57},{59},{40},{19},{52},{75},{95},{87},{65},{60},{41},{55},{38},{29},{80},{19},{19},{38},{30},{24},{50},{19},{189},{108},{19},{39},{101},{19},{109},{90},{110},{67},{45},{53},{99},{67},{99},{53},{53},{87}};
    #ifndef CYTHON_COMPRESS_STRINGS
      #define CYTHON_COMPRESS_STRINGS 90
    #endif
    #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (4570 bytes) */
static const char cstring[] = "BZh91AY&SY\332\307\241\027\000\003\025\377\377\377\377\377\377\377\377\377\377\377\377\377\337\277\377\377\375\300@@@@@@@@@@@@\000@\000`\023\235\327\325\010o\276>\360_n\373oom{\335\246UCLH\3625\026\303R\240h\035\263\251\026l\201\203\300\252\007\267\335\300\002P\211&\322\236MS\324?$\311\224\365\036)\355\033 \215\030\231S\364\024z\231<\223G\250<Q\223jyM\003\312y=$\323i\246Q\265\017M\023j\014D\000\215F\224\323\3256M\021\231S\323S\321\r\001\246 \365\030\203\004h\r\000\000\001\240\001\22044h4\310\321I\002\207\241\000\0035\032b\032\001\240\000\000\000h\032\000\000\000\000\001\247\250\002MI\002\010S\324\r\r\r\0314\017S \003\0042\003@\006\236\243@\000\0000\230\206\2322hh\rEF\203&\365&\214\232\032d\00014\003#\004\014\201\221\223&\206\206\324\031\031\014\2034 \303SC#L$H\020&\2010MF\214\232\006\243\023\021 4\332\203\023OP`\231\000z\203#!\223A\246\214\200\030\232g\307L`\222\232\255V\246\201\221PX\207\277\334\240O\353\240\177\177\311Rrb\006\354(\335rC\002\037&\010\254\243\2270+\025\203\033\240HT\r\260\245\207+\303#\n2q\276\324d\005\370\364\244\351H\037\353\002\231\t\206\005`\255\370\343\371\022Ej\023\236<U\364.IR\341\030\2314\010m4\321\"\212\260\005\"\304dTb\2501P\004`\333\006\006\023\224\222\334\201X\306\301,2\346\004mI \320%\242\3024h\222\004`\301`\261@\024\223X\312\030\231\261\243>\000`8\305\221Eb]\233T\324\261\243)&\210h\320h&\001:\265\004\316\206\2204\261a/EXI|\271$\324\252\226\221\222\214$\3245$\231\3443\206\265\232\251\254Z\353T\261E\370\n\204@J\215\352M\303\256\243$^\030\002I\260P\000\031\204\002\321\202\303)\330z\000\271\204x\t\242\033pg\235\346hi\230\\\213\005\312\325\252\256f\002\3240\304Z\007x\332/\272\000\300\260Y,C\252\346\213\312\2718\005`\277\"\025\246\005\030\317 ^\013Pu\223,h3\2522\245\010M0%\3136\216\274\013\033\000[\0323\005\353\005{\214M\014\321\267\270\016\363\022\342]\305Pi\250| \360\343\331\"\024\212K\200Z.\221\376\202\026\326\245\232\033N\220D\000\262{.eD\363\376\250#LK\003Q\261\342\322.uB\r\324\024\332f6\020\r\270JU\237\241/y}+]d\002ZG\n\017i\210\264!""\210\377I\244\033E0\327\026\010\363n\276/I1\017A%\376\342?\325\206kS\225L\214\325\363\243u\320\215\2053\375\252\006\006\221\t\246\202Po\357k\302\r\"f\204\361,Yr\341\223&M\343\341U\037#r|\376\272I#(\323\240D\014\242\343\327\314E\254$A&E\307\274~\231p\036\201\037\"\017K\026\000\222\232\234\217\312\306s\245eZ9\223\234\031Y\242%\016\047+VN\226\320\026J>\014\217^n\362E\250\217\226fc3\014\n\t,\037\304\014\022\304\261\222Y\005\342\354\256\337\325\334\010\274c\2706\334ff|),,X\355\354\270\320x\022+\035s#\327\220\262\374\325\270f\\>\236\217\207\026\356\017\234\257Y\341\277\244g5\250\311\340\030a\200W\342\304\236\357\212K\231\313\342_\223x\256\306\312\343I\335\273\341/\257\244\373J\227\322\245+h\216w\274y\"\224bu\217`\301\307\225`\243}\371J\014lz\363\t\365L\310 \200\276\362\353o\033\322\364\230!W\205\0051.B\213\222\225/i\263T^\374*Nu\235Z\023h\223\330\266\034\221\313\217\355F\360\335\310K\263\254\350\rhl\016\223\237w\2771\334:\356\023/\000::\005\210\026\000X\017\231\300\372x\356\354|j+Z\010ub\365\370T\361D\322\"\225\351\013M\225\210\005U\032ia\311\212\241\265\315\351\345\354\354\240\246 \262KR\372u\304\376^\337\336\274\274\000\317R\323\211\201BA\231i\026!\364\344\020\307\2330g\233\201!(V\243\312\267\250/\256\t\231\3065\323\340f\370z\215@\324.Nbd(\210L\230\023+K\207&R\"5y\330\317\037\366\223}\271R\177\026\353T\233~>F\014\303\277\343\373\336\323n\001\271$\266%\3437/\217\343\017\047\226\326\264\023p\376\255\367\332\305\\\376\304\026\t\024\005\005P\235e\211%\246RV\027\226.\031.E\345\372J\270\230\236\315\257\005\034S=\020[Z\367\376K\237U\345\213\324\275\301N<\"\325\034\003\256\030\030np\342\024\370|\323\246\331\234}/\\\347\353\2453\332\2632\376\205\346k\177\034\372~W\330\226\320\0221/f(\362\325\020S\n\016\236\023\357G\244\223\020\317\0247\227\222\016\003&^#\302d\252rg\020\005\334\030aT \273 \177>\377\242\340\207\363}:\334\r@\357\320<\016F\323\345\026\305\340=\r\233D\024-\364s:\007\2719\271L_\353\306U\225\022d\232\024\244\0342\206\215\036\367~:\014\325\324\315\220\030\267Vt\303\255""\327?\362\3271\333\n\3711\273+\255\020O\030-\217\351S\353\371W\346~\214\000t\365\371\275P.\344\244\016\020\334\016\214\225\020\214\"\004\224D\022;\022\033\253\031\212\313D\300&\245\010\010 \200\255k%7)9\313g\201\371tm\373\274 \345X\367\221\231\202\237\372\277d\215\006\250\205\254\357\337y^\236\367=\027\026,\026\301#\307\030\327}J\3149\3510\010\314D\n*\010\216y\347o\203aC\222\t\244\377{\2034\007\336@\203\035\254Ar\001N\257I\210p\214\\a\177\224ak8z\375-\260\377\201Hw\243\322IiW3\020+\267Ix\246h\031q\336\rd\205Z\200w\004\212\004\224e1\340\344\2658\342\232\007\025\021\310rf\200\210(Kf\014\322\234\247\n]-+D\220\263$\210\002\366U\225d2%}]\221!4\035e\325\323\021qR\251D\307\203\001\032UHaY\031\006\304\321fp\342\256\342 !\220\200\224\323\n\020\377\250\255\240\212\212)`\374=\002K\025\272\206.\300=\030nK\372\177\322\246)Y\005\302h-\265\336\222W\233r\242\217E\001,\047o\302 q\000,Z&,@\276\367=@\316\3466k\327\\\314n[\222\3171\211\350\005\251\315\323Cq9\005\346\322h\256H\273\036\256\245\340GXxDu\320\2247@s<\364\207\3357x\210J\346\360%V$\026!\325\013\271\247\253\234\033\341\003\212v\343n#o\256\353\n\210\347\342\354\277\267v\034\270s\361\322\203\261\002\215~\310we\347]$\033\035\241\353\221\002\225\321\336\217t5D\010\364\275\271\277\0166\047l\020\020\304M,s\325\270$\270\244A\310rI\356b\001\247\214\353\215{yd\035^\3319\327\222\036\030\235\370g\030CQ\031\177\304\313e\023I\341\262[>\003G\022\034\204\0008\"\000\272\273;B\030\035\nX\320\021\230\260\371\035{\323v`\001\221\320\230\265\263;@Q\204LD\002$;\201\001\310P\006\322^\345`\255\340\034\322;\022^>8n\271C\033\033\022L\210\207\014n\032\333\234\344\246#s\002\007L\214L\231\323}\257v\323|\261n\2407\000\215\252\226\347\017X\201Z\036h\355Y\246RZ\324Q.hhL\r\3543qK\022+\302\366\2115\010\221[o\004\364\201\333fn\346\311\004\202*\301\nip\371\354%\317\030w|\031\314I\217^\266\r\324\014\":}\234sN\355\245\0040\005\260nj\2303bV\213\352\256n3IjUUU\\\266\345\245\301\226\005\005\005\346FmeUUU\316V\023\003SA+\034#-\235\332\201}\306\276\256#\237\331\220(]""\2103z\006\002\250f\273\324\021\000\252\304\000\361\024wV*.\305\006\014A\206\215\nI\263\376\034\001=\362\2255\243\355\274]\020OX\350\330\240\005\270n\323\255\327\017\311]\322\320\311\327\205\333\354\355z\244d\210\005k\261a}\362\255w\221\264\351\245\240!b\326\317j\337 \363ft\020\034\345\022c\033\026\374$D\366\221\205\331j\215 \334\247\031\343\330GwT\203V\310\3130g\032\270~\262\361\203\365a\271Q\047~\215\356\366x\337\345\220,tTRcx\350\245\047\310T\357M@\346\200\342\320Ff\346&1\200\323\030\231hc\206\2053\201c\000\327\302v\32577vz\316\231\316_\251\325\257\304x\217Oo\215~^\337\016-\202Z\241\034:\322\032Dj\224\352\367\212\224/\237B\204\030m`\361]N@D\005\305(8\254F\214\334\357$\020M\307\303\315\301#\235\003\021H\310\214\324f\332YDv\246\276\215\035{\245\305\227\267\272\272su\023\010\013\2574\353\236\213\331U&\316\345\335\317\221\356\363\330\226\030\241\244\334\003H7\271+\213e\333\303x\215c.\247o\022z\3569\005\374\256\351X\261x\325\262KM\267\367\330%{.\227>E\324\321\344\003@)\267\245\005c^mk\352\354}\265(:Dj\021*\301\023\223\216K\252\223\330\2722\324\077\077\240\257\334\331lsBlc\023\304\366\014\006\264\343\202:)\254v\217!q\240\334\350x\216\005\353\312\313 \366{\203\224\303\247\244\366\207W\2602\260\2220\365\322\364\306 c3\206\342 \362\262#\214\315\276.\377\276\314B\267Z\352\260uD\037\230\221\267eS\301\203\300X\260\241\004\244\020\025w\235+d\301r\311\210H\237\013?\243\260\005\016\262eRX,\023\241\347\346\301\370I\"F\262\r3\306\341\013[\024\205\211\320nh\227\177O.j\327U\007\217\257\227Y\313\241\005\225\201\217k\227\020j\3425\263\034\362\324P\004\222/H\346{a\315\310fh\241\316;\023\016\212-\261\301g\035\344\210\230$\230\320\304\022e%\262P\346\352<\262\343\234\267X\n\333\255ixId\222R\205\"\221&)\214Hc\002\244\330\323c\001\321 \226\271\226YVBH\262`T\321r\t\005\225A\002\250\356;\367@X\321\035\034\275\274\342\270\344\267\345\rbCm\260\033\231\212\264\211\224\215\375=\236\344n\3113{\035\354Z\316<\371\010\255\016\000|\241\3644\332i\334\260\362\\P;\342f\366h\260\305\324\321\027B$$\330""\302\037\251\047>\263\005D\001A@PY\"\213\026\004b\304\263\034\240\025\330\302\th\301\261\036\370\017Wd\333J\244\356\0170\305~\224\006\231\305\372[\322\306\321wf\t\020sb9\032\267O\301I\363s\233\216\371\203n\202\025\047G)\242]X\256\264\007lq\005\341\217\201\212\003\251\245\355\300y\354\234\265cK\270\271 \326\366l=Y\0057\316\355\0330+eG\301\201\322T\325\346\261\254L\340;yt\n\001^\341\263\216\237\227\006\251\362F\032\303\211\034\260/\325\265p5q|eD\037;iz*.}\010;\354\246k`\254(G\241+\001\344G\233\334\017=\003\330\335(\347\2509Y\001q\227\211\213TC\026\242\002\006b\"sG`\352J\234*\336\357\006\230\242\221*\267)\2567\000\303\177\332\213\016\342\301\211\001\226z\333V\txe\014\354~2\324=\336>.\273\002:y\264\231ve\263\324\222\357\r\005\255ud8\323\207\250\327:u-\017\315\344\337rKs\310n\321\004\263\236=\002 2j3\211\300#\177\047\006 \360\200\250\337\201\332\273\270\265\302\272\036PD\207\032\0339\016\345\301\033\031\224\322\204\232\031xD\374\004n\016\333J^\230W\267\272\005\031ZQ\033](\211\226\230\303\300\030U\020F\200\244m/\027\215\341Y\202v\310\225\230\003\253{\016t\247\017\024\362\370\n\313\2252e\252\035\345\\\324\2355\200oR1C\002vS\347\210t\233\223\227JM\332\257n<c9k\0306\251c4k\313\234]K\351\240\211\220_\201<g\3011|\211\310\224\357\213L\010V\036\335\32563vD1\rW\205u\354\240j\2552\241$\205\360\\\2558\047`3\332\t\322\267\017_\235\024\276}UW\351\375\002u\321\205c\002\342\021\250@\000\226\340\364U\335i\010=\223\313<;S\322-A\213\225\216k\344\320\261/B\316r\362\353,\025a\220m6\214\315sq\250A\242ia\036\005\006W\350\243NY@\311\204\332\006Il\261o\323\253s2,\026\013\332}6P\3268\357],c\351\276\364\004g\2205v\007@\307\236\326@\321\231&\t\204\331J\344R\217\313\036\047V\256{\373p\327\"$|\351\207\017\r\3322t\"\364\004Q|p\213\206BB\220I\310\221\343\250Hm\030\336\023Ya\314{\273\217p~\204p\366j/\005\264\222I\246\017\340?\344LR\252E6j\271!0|S\013\310\047\267\224\274\313l\256\335\321\207\205\221\275\223\036@3R\340\223?;Ya\346q8\2348\036\357\263^\325\203\323\332x\216\023\321\321=\047\212<\025u\366""\354\027\203a\177\0240\304\014aW\240\350\371\364\263J \355\364\302\t\265\047\002t8s\325\3154oM/x\323\036\032\n\002\245 \240)\265\324\327\032\244\250\211u!{;\300\023\317\014\022\271\213\206|\305\270\026\201r\216U\333o\177\225Zz=K\366\177\317\257\313\347r\035)\037\032\233*~\323\227\316 NB\253 \214\0018\034hq\3666H\034`\233$\004A\210\n\216\343r\217\306\317g\321m rd\355\244\035\333\305\373\003\311\335T$\210sK\344\347\321s\311\n#\r\250<\351T\016\354\375-+\225\321\333\3742\255\017\265V1w\245]c\240\371\263\230m\216x\205\023\362\003\207\370\325sI8\217.\340\022v\233\253X\340\316\376\240\234r\244\234\203\233\312`\306x\020M\202\372>\233\246\301 \242\"W\031\226$R\211\346\330\345\211\316\214d`P;\360\"\250]\2164kB#D\350\010\271\216\205)\016X\3349\036\3678)\014g\363\323\016\r2\253\352\3003\340\365\273/\316t\365\037\030\345\255\2300\3551\021\244\022\036?l\351\222\377Q\352\372\373,\231\251\312\243T<[(\247\215\265E\350\201\263\306\220\256C\225S\312\210gxx\351\024U,\331f\025\3439Q\273\217\256\235V8\375\004\241`\001E\266\256\024\375\216\021\021\326$~\372\354\312q\333\357\0134\017\360( \211\302\251n\347\241\301sa\030\0214z/\034(\227\201\351\344\361\013s\237D\r\027\260\200\261\301\341x\325\texL\276\047\220_\205\307]\210\030O\026\216\206\277\006\317\025\207\214\027l\355\"\371N]\004\370\226\241o\221\201t\215\235#`\332\035\004\207\301\006\233Q\017Z\226\201S\317pa\207\370s\252\321\225[\020\346\035\032+|P\263\201 \312\365\367\316\377ySz\233\3309M\245z\224\020\260\266\3251G\0102\026C\300\362\252f6X\225\302\3104\031\253\216\211(ZH\240T\031E\252\225\202\256\2753\035P\3277Y9\202 T\346\261z\"9\251n`\211D\226\334%\332\315\272D\037\201\027t#[\363\"\353\035\263z\365\027T\334\241\332\234\345(\nP\354\237}\262\356V\350\273\346\356\377cz \326r\240\233\353\316:>\333ki!\304k\r\226\275\255^cm\305K\211\037T\350\372\rN\364\007\007w\260T\213\345)\320\217\363\246R\215L\235\234\337\372\222\263\335\251\364&NR\266\365l\257Q\250\257\324\232g*lg&\206\276vB\233z8\324\375\3050\261\030\230\247O\204\304\303\217\212\327r""n\252\216A\037\037\030k\210\037 \345\370\235>\337+\355\366\235\227\007\237[\341\234U6\257\257\026\244\342q\21039}\364]\213iT\336\226nZ;\343d\341\237\200r\247&\033\2030I\023\317\342\020\047\021\n\n\014\001\017 =\363\314%\034P \017\036\274`q:E\372\321\010\306\t{\r\212M\033a\320\033\036\350BcJHo\202\312\310>xCP\204\320\005\204\227\305\207\215=\225}+\205E \300\305Q\363\"@\22322\320;\326$\210\272\234N\230h\324\2300\245\032$\264\211\272\301V\315\014\201V\356dY\241ynZ^\303ywKF$e\253u\245\372\223)\270\"\265^\232\205\240\374\316\376\307=\202\003\261\260\024\202A\004\2303\254\252U\313\245\260I\2252\004k\002$V\031\252F\320\231EI\220\244\264\"H\2701P\030W\220\351*1S\0200%\004\241`+\005\316\0130\356\352ji;\206\t\225\202#\000\210\300\021M;8\331y1\221\365\200\306\230\002\020\326(\255+\033.\205*\032\003SA\214\253\020p\266\3239F\205\0339h\335\221[\"\320\275.\313\250\010 p\231\200I\274\001M\237\374]\311\024\341BCk\036\204\\";
    PyObject *data = __Pyx_DecompressString(cstring, 4570, 2);
    #define __Pyx_DecompressString_LZSS_UNUSED
    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) == 1 /* compression: zlib (4572 bytes) */
static const char cstring[] = "x\332\305X\315w\323\326\266\257_\003\r\020J\\\222P(\245J\312GB!4\345\263\364\323\205\264\320R\210\013\375X\245<-E\226\035\025Y\262%9\304\367\261\356\3550C\r5\324PC\r=\3640C\r=\314\237\320?\341\375\3669G\262d+)}\367\256\365X\301\322\331\373\234}\366\336g\177\374\216$iQz*)\256\364\341\226\244l*\272\241\254\033\232\244\233\216\253)5i\275\353j\216d\231\222\273\241I\252\241k\246\373\211\264\251\331\216\016\232\324Rl\245)\327-\273\251\270\216\030\271\335\226\226\274o*F\007\203\365\216+I\266\326\356\3506F\206\276\336jKu\333jJk\226\3436l\355q\365\201ta\355\0330;\206{Az)=\264Lmq\321\2655\r\363\224F\023\273.--}\276\374\351\347_<\264\\\r\312@\337;]w\003J\350\216T\323 S\263\025W3\272\222\343\332\272\352j6M2\245\265\325\265\313\327n]\223\024\263\006\r~\327T\350\351t\326UCq\0342\254\016\345t\303\325a \351\275,\335\257K]\253#\231\232V\223\\\013v8\271\005p\203)9\232\313\374qA1M\313U\\\370\202\314\326\315\306\005\251\006\033UW\337\324h\365\327\212\341h\313kUG3k_\033\035g\343\0078As\\\211H\356\017\314\336\212\353\332\216T\207\343\265\332cb\233\252\366\224\273\235;\342\231x\346\231cT\335t\237\245+\330q*\265\232\014\3754q\2066L\255\327\341\030m\253\005\025\265\332%\251a\271Rv+U\201$CR-\323$#\340]\254\227\254\226fj5\301\343\212\336F,X\216&\265l\r\047\rW\245\344\374R\370\265\245\267p<\246&5\255\232\006\266\323i\302Q\340\264\020\025\303e\035\243f^p%\3050,\025\007)\255}C\242\306\351\231\rjZ]\201\003\235}\047\351f\335\032\237\2405[nWJBn\234\217\220\2264GUZ\232L\376Q(P\212gu\314\277\236\0075H#R\205\022\303\321\322)\252\2551}\271o\255u\n\320b\346\035\010\030\235\000\355\021\211CcS\006\305\233Xg\260\360\204\207;\266\2154B\202X&eI\247\325\262l\004\001)\367@7;[5\330a#\215\306\317\264\246;T\0234\223\375\3326\254\326\331\361\352\252\006\035T\r\321n\337\226\3169\302\023z\r\033\351u\035\241\226\210\330\233cZ\331\323j\331\326&&\325\304|CG\"+\306\250\230Q\362\2762\250\036 \336R\021[\232\332q\211\222\332\211\004\262\273\005\023\362t\376\244\254\206\r0 \027\327C\246\3235\325\224W\247\234g\225\217\222>""\225D\324\254Nc\004Vl31\354\360t\2535T\312X\335\341GQ3t\307}zGD\326\243\026\315}\306h,\260QX\356\302\007\317\340\035\221)\222,\303\336\216\252\311\262T\353\260\neZ\346e8hS\207;eY\325M\335\225e*z/,\273\006KU\273\313\344\246\252q\257\215\273\247\345tU\253\325\220\327uS\261\273WZ\355\345Vwk\214x%\311\203b.;2\310.\346\266\032<\244\367\344B\366^<\236\350\304\345\001K\006`RW\252)\256\222\032Ay\3038\305\305-e\357\275\2208\224|\243\214\275\263+\231\261G8&lN\2456\306Z\253\263\307\204!\325e1\254nt\314\347\020j[/\034\026\251bF\302\307\371\257\243J=\317F_\302s\360\003(\200\245\331\225,6\307\372D\032\242{\205\3568\035d\327\355\264\014\326\272.IM\255i\331\335M]{\361\254\343\326/\337\272\363\350\373\357+\017\357\312\217\276K\"<y.S\030\267lYN\t\r\315\225\223n\220\022Y\245\315g\307\252\210\257\344\271\234&\204\312\300\204,g8p\203\203\346^\300\313V\374Q\342\260\304\215rD\325\032%\363\372\224R\363\375d\025\305\3501\224\3508_3\220EM\032\010\350qR\275W\251\032?j\021\366\201y\020Nc\264Nv>\311s\334\312\014g\314\312\2247\"\244\0164\226\014\310\253\331\367\275w\020\334=w\341|\r\250\300\326\344$\301\325Q\361I\210\346\210u\024+g#G\2428`\rJnj\216\2434r\n/\267,\303\310\021X\377\314Q\240\244\355r\350\301\177\013-\333\333&\342pqrF\206\n$\332\320\322\262\232P)/d:G\305\310\223D%H\210<k\362#Y\030\223%e\224_\346@\013\341H0K\320\222\032\224\337sH\315o+j\377\250\326\254\371\311I\203\223\2510$\034\304\252\234}\347\205*G\031\331b\013\335\246HTz\264l@\335Q\274\323\001\247q\231\022Pte*\307\031\332h\024$t\336\007\004Aw\344\365\216\323\025\243\246\362\\\223\0310\314\317\"\240\203|N\014aVi\344\004\207%fB\346\341\311_\205E\204\005\022\032\267<\031u\306\265Ni\250\347\202\224\304g\372\236=uN\310\2369u\002\271 \252\262\364\374\0010NqX\214\260\n\326\261s\221\005\270\3112\362\2662\022kNc\204|\204d\351\243\333\3015\274\221\311\324\310\262\241\302\234\300\032\025\261F9\256\255 u\353\206\322Hva\024\361\3361\305\210\035q7\213\232\222\253A\362,\252\003)\247\240\022\010\236jh\212\235\216xP\"\226\214ZJ\253\363\333\363p""\014\013\206\003\023\2416\0349\372?2#\2270\340\310P\265\214\014\0057\332tT\220\024\031\016\273\250\247\224\341E>%\2213\025\334Tu\334\345\221\n\325\257\330U2y\026xg\310\031\367NUT\\v\277\301\210\225\307\265\244\316TY\250\256\361`\024\203$\036\252C\010\361#@\3057\217\037W\326\356\257UE\255JD\260\366Te\225jM\344\342\367\024\027U*8yJ\275\203\204\262-\027wD\343\047\376Yc\255\272\001d\202\3133\314KR\3711e2\273\306\337\311*7$\244\n\302\332\047\024T_\263\230k\363\266\375d\365\227\047\214\372\023\340\rw\314\360m\334y9\336\230\373\340\300\356\026\376\337\325Q\363\037j[\356\017Z]\226\305\247\010\215\370\364I\243&\213\2574D`_/\350\245Fk\350i\251\364\250wL\366l${\340\237\336l\031\364l*:[\213Z\247\244\353\021\234\035\203M\243\310dO\355\005=D\306\262WhG`&}\337\320\324\347hF|\304\343\211\277\213=\351\225\202\215\277u\314\226\256>\307&\t$\342\344M\026\337$\263\335Q\214d\367\344:3\346\302\224\240m\361\001\341E\346\314Ts\047ct\201\223\021\346.s\235\246\230\371\314\341^D\314Y\004\274\213\300\213\214\316\242Z\266E\367HM1\032\226\255\273\033M\305Qu]\241\246 \263_\335ZN\0479\224\\\364\003G\300\311\n\373\032\305/0\t\370Y\357\324\371\007\034\376+\267\\\233}\273Qi\003\261\367\020z\250|\226\212\270V\241\275*>\322\215@\021V\237\360c6\334\rGeM\013\247\316\252\342\272\242>\3176\223|\003Q\rG5y\371\306\016\235\246)\233\235\346:\366c\003\275\246Z\315&.+x\264\350\322\300\277\345\260\324\315\002\230\034r\031\246\266\214hi\302\362\344\262\230\0033*\312\274\312\334\243\362\317\213\324C\351\313\022\277\362\333#\355l\254\205q\002\273\01685\335i\301#6=\251\270j\311\241\216\202\237\002\324\243\231\233\233\220g\333M\247\301\302#S\335s\341\302\006N\026\325\217]\025\3627\204\334\305@\333R\351\217\351\3130T\006Z\3450\025\033pH2\216\253\352\242\3150\355\310Uu\234\212iq\234\305\332#\353\346\324|X\317\021\263\001\371Y\323\341\315%m1\254\263\240f<\260\0320}\210\311r`,{\047\033k>C(\226v\037]\207\343]\001\311\340\210\246\363\\\353\222\357\re]3x\210\032\364\241\312`\273\322/\3343\006\332H{\223\345E\202\333D\230\">""\255\226\353 \335r_\255\371\200\007\357\260\357e>eg\277d\217b?v\305d1Rk5>ju\0216\3743\004\377\245\024M>=P%\313\001\303\226\001\007C\007\312\203\226\325\022\307(\276]\210\307rZe\234\204\322j\017\337\210\335ifX\313M\335Q\363\237?h\001\264\310\002\316,\322\204r\014H\016\341e\006W\212Z\315=ekn\3076\tcqg\331\233\216\243\031\3651\320Y\2006\213`f1\276\034\007\226YD9D\210c\030\262\000<\346!K!\206,\000\217#\250\021\303$\210\221\007\216c0\307\260^\301C\000Y\212?\r*t\035\226\037z\215-g\261#\327\025\207*:h\335\026B8\177\271\027\360\263\323\302\241h\310\332\264\013\341\335Fq1x\320\211>\236\264s\230\007\221[\310\025iq\255\373\210}\021\226.^\222\250\216I\027\361\262\326\225\035RV\006y\3515Yt\013\305\021\005\005H\241&\023\377\217\322`\342\360\366\007^\225^\246\275\243>{9\037(\301f\210\327\335\211\367\374v,}\030\035\351}\322\177\036W\177\030L\034\367n\371\267\202\225\2402\230x\343\217\227\336M\177~0y1\234\017?\211\314>hG\266W\376(\3759\371\332\341w\210Q\366f\274\352`r\332{\303k\373\007}#\234\247U\233\333?{\253\376\214\017\316[\036f\235\360\332\273\370q\375\033\301\211\260D3\332\203\311c\361\261\245p&\254\206\215\350i\377\215>f\344(\245?*\230\263\355x\363\3365\310>\340\377\026\226\303\263\341F\324\350U{\n\230\357\236\031L\256D\357\365K\203\311#\333\327\275\327\275\225\301\324[\336\007~\325W\006\223G\343\243RP\n\312\203\243\247\375\n\351ql\273\2155\227.\017&g\274o\374\025\277\"F`CL\274R\351\227\373\027w*;\325\214\264c\333/<\325/\017\246\347\274\347A9\230\337\305\213\022\237X\014K\341\\\370\"R\242\255^{0\013\007\006%\232\243\354\356\265\355\362\225\301\344Rx:\252F\n\211\277\266\335NU\335\235\234\365~%\t\230v\355:M{\257W\352\225\367\233\366eep\350\360`\362m\277\024\237\374(\232\377\363\340k\207\026\002\266\002:\317x\225\301\321sAu0u\">q\031\276\254E\313\375\311\235\203;\331\235\347\343\343gq\276\323\313\241\022\272\361\325\325~\225\204\274\271\375#\234\27528\212\343\362KB\367\335t+\010\303\2547\317\013\331\344\205\231\360\277{7\372e:\377cP\356@\3608<\034\315\027\357\000Q\320\353\347""\260\202\325\336\377\004\363\301\265\240-t~\313[\364\347\375\253\376\357\341\353\341\307\321\235\250=(\277CG4\230:\356\255\354\322\317\037\025Rp\n\372oz?\023\343\330\266\353]\367\217bC\356z\256O\231f-\306\027nF\355\336\301\236\322ks\233\021C\302\221\203\351\333\275\371\336Ubq\213\037{\377\005f\316b0N\274=\230\275\004MO@\375\301i2\344\320\341?\247^;t\034\212.\005\267\303\247\361\255ow \363\224\1779h#\027\340\024f\330\264w\004f\324\202\345\350\r\0301}*>ERf\244\340P8\033\376\336+\rf\226\302\223\321\305\336\267}\234\006\231x/\270\037\376\03215?a\241\226\272.\250\026\234\327\325h%\272\313\366\376O\252)\005G\303\352\277\243\345\307\336\035/\247\047\225\213k\361\225\n\205\306\t\357\037\224;\211\302\177\255\353\371\240\264\217K\375+a\231t=\030h\341\ni\212\321\031DN\351\325T\275\272\255z\345b\227\356\376\247U\215O\221\000\241\353\355\370:-\372;\272\216\034\376JT\216\316\3067\356\355\240\006`\327\271\313!S\014a\374~0O\363?\365^\240\364M\235\364\337C*\274\213R35\027\317Q\002\242\264\316\247\005b\326{\026\\\002q+\262Qf\240\364\001\357Gd\337\nK#\257\343\337\213\317~\332\253\364~\333)\357w\n\027\203\n\267L\017;\321\375\036/\364\250\035\257\354\367\342\020\371\3776k\031g\2235k\367/\314\332/?\017\047\005\3531J\313\330\272\216\367}p\034k2\214\335\311\005\224\305\033hs\347\302vT\332\235<\036\037\177\037\215\370nx\000u\366:oti5K\366\\bmQ\313Tq\252i\347\375\022\264\315\327\265\303\314\245\331\r\216\374M\375\240\020!\0077\274\036\275\331\323\372+\205\n\241\"\205O\242Y\026\251\373+45,\351\253\301L\360\004\345\247I\305y_\247\034\0316\001t!\312\377\351\031\200\2153\361\205[\275\003\275_\372\325\276\262\213\016\363\317\240\032\237\277\031uz\367\372\225~uw\254\017\334B\227=\216\200\310\370l\321_\200\324\274\212o\356\341\263\375\232\320\356\324\234\267AP(\274\031-D_E\353(\251S\357\304\357P5\340\272\006\335\350@\364\013\341\230]\010a\221\227\204*\2231\230\3119q\3625(5.\321\377\002\204\217\243\325^\031\300\003\210\353+OI\323\020R\343\2119O4\375\177\372?\343d\312g|\305w\003$\313t\214\242_\022""\023\246\342)\226F38\361rp6P\342\t\270\200/\374\227\337@@\224O\372e\377,%!\026b\256\230 \026\036\245Zv\227\304\021\314\343\330#\237X\263\357rPV\220Dl\021\017\204\217\275\207\002\025\024\342\207x\342m\237g@|l\236\301\3102A\255\031\266]<\215\331|\006W\200\216\346\263\340\r\010\233M\254\206\353\037\005+l\322.`\337\375\240\032\324\302+\275\331^\243_\224\313\013\301\373T$\302_\"l}\222b\227\004\227ScAJ\001\315\234\247\003\376L\004\025\341x\034\247\260)\2369\307\366\231\337\313(\206?\217\301\321\212\277\031\237\273\021)\214$\334x\302{\311\362\2774\246\037\245\251(\233\331\005\247\375\007\014\226e\333\362q\212\207\314\334{\244&U\344\337\375\327\375\025!\222\264T\010\316\317!\372\047\003\341Fq\360f\010\337\276Kp\226\001\301\017\302\225T\277\177\261r\260R\250\337;\376m\222\312\226\212\005s^sO\203\342\2113\024$y_\000\\\247K-\341I,\375\010\t[*n\047l\ry\377d^\327\334\372\221vT\330\243H#\324\236\024\363\2165\213\305!\210\335\243\347\255g\225\214\317Q\315\231\211?{\264\323\026q\262\020\\\211N\366\200<\020\311\264\342\206w\202j\261\250\373\225\021\247\275\311o\017#b\007\323\2601\274\033\177\370U\177^\210\005\225\212=s\300\207\250YBL<\307{\205R\330\220\031\236\217/\177\321\023\002\022\017^\t\333\257\" x\022/}\322Czaj\341\374\261\323\306\234t\223\234\226\354,\303\366\036Gr.\370\225x,\022\t\374\342bT\025\321:\317\352\227\031!Z\317\007JZ+F\332X<q\001hX4\303[\360\335}v/K|m\222-\341\231\250\333?\320\257\026\372\233\325\346x\345N?\251\263\324\204\304\265\362.\335\245Q\035.R\234\315x\367p\013|\022\317\003\272\t\322\273\376/\024\205\361E\334C\270\360\006\324O\35794\353<\213/\272\014\263\346\037/\336\352\035\352\037\357\337\335)q\356T\257\222\3472\372b4\277;t\005\271\221\205\005\372t\261\367?\240\244\235\361\356\2432\327\342\005\\#\005\351\214\257R\241\300E4^\372\242\367r\207\272\005\335\221v\047\247\266W\275Y`\2516]2\037\260[\356T\331+{\013\260ru8\370\316\357\220\277\371\340\001\356\204\325d\360\255\257Q\363\341\203\373\376\217\330\245\210\363}0\033\340\276{:>\315\256\257\361G_\365\317\365;"";\225\264\267Mm\337Mn\373#\366 \215\322te`\216\335PWz\017vXz\335\364\316zJq!\346I\334\360\253,\373\350\250\336>\307\021\304K\034\363\024}\023a\047\204G<\301\302n\006Z\243\261\304\357\003\364\t\322\231\370\214\000\351_\367\225\302\323\3054\256`\361=\014\375*\234\212*\377\326E+\236 \2341\311\217h&>w\235\372\027bR\244\014V\354]\321\310c\247\243\352\253\243x\226\337\361\362\227\375\322\356p\177\370`o#O\371\227\3202^F\257\214\251\263u\ta:\314\374=\315\210O\221[>\375;\267\300B;\256\222\222\013\361\302\265\370\032\273\357\275\025\277u1\276\370Y\257X\304\260*dD\\\243\303<\343\233\361%\252\316B\302\347\275\342\340\300\344\\\021$\304\3620^@\202\217~\r\312\034\366\365(i\3138\366}\\B\352\375\306\277+\375\275\313\246\330b\314\017_\364\332\257\356\207\233QR\262\021\211\373hI\t\371\262\267\362\177\321\222\271\t\216\243P\047\025\227\343\345\325B`\0077GO\342\217\277\333\201\313Y\025\316/\372\246\337\376\213E\354\374\030\030e?\357\371/y\003\376\262\177\020w\217\344:\3724I\277\237z\374\200\t\237\357Ne\362\022\214\3014af\372\371_\027y\201S";
    PyObject *data = __Pyx_DecompressString(cstring, 4572, 1);
    #define __Pyx_DecompressString_LZSS_UNUSED
    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 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (6243 bytes) */
static const char cstring[] = "\377  ( [ at\377 0x avai\377lable in\377stead by\377tes on t\377he clien\377t; versi\376\021\000 param_\177formats\007\004\357type\004\005val\375u<\000but  r\337equirJ\000li\377bpq from\377 Postgre\177SQL \047PG\032\000\377ult\047 | N\377one((tre\335e%\000agms\000))\377)>.<>?No\363te\212\000\255\000Cyth\276\226\000is deQ\000e\377rately s\177tricter!\001\377n PEP-48\3374 and\177\000je\375c\245\000subcla\373ss\325\001f bui\347lti\336\000\264\001. I\377f you ne\337ed to\337\000ss\371 &\010\204 n set\376\213\"\047annota\365t\211 _\364\000ing\047{ d\341\000ctiv\242\000\377o False.\377PQsendFl\357ushR\202 est\275 \017\001tRes\355\000A\277ttrs f\366 e{dS\033\001nce[\361#\342\203#]\212$\017\013\005\016intz\"\005]\311Cadd_\235\000\265e\275Dr\350\000ff\226 e\373xp\205 ed, g\267ot _\tcaz\000l\037 conn\247 \337A\335\000\177 opened\025\004\372\243\003:\211`ose p\203re\201`\250 \016\006-\013\325 p\373ip\234@ne mo;deW\000sum\246 \336`\371p\223`-\007uldn\047\177t alloc\306@7 PG\202\001co\010\r\221\010\257defa\256`s\010\032i\367nfo4\017empt\363y \353eT\017for \177escape_\376\204\001\337a of \020\023un\306\006\037on\316\"\207\001\257\205\001se\316\316\006cre\351\001\361$ob\324\235\204\001\007\023C\221@ \022\014reP\206\204\001\244G\245&\354a \307Cl\232\204\002\376\255@urrentl\357y on\242\205\001upp\337orted\330\206\001Li\357nuxd\355\000ribn\301Pdis\220\207\001en\001\002\373rr\231 in no\377tice rec\377eiver: %\375s\253$identiofier\320\204\004: \000\027{no\343iprov<\000\375d\365$literaal7\r\007\r\047\032\214\207\001ng\200\007\237xecut\376a\263\204\006q\017uery\016\020\n\013\234\206\003\220\207\001\343en\333\207\001\313\204\n\023\007syn\013c \354\204\005f\360\206\001\365\210\002\361\206\001\263\205\005\302\021\002i\211\010\000\016\350\211\002\373\205\007isn\351\205\003dgc\256\206\001is\205C?dlist[\225a\341\204\001\313Op\204\210\001]\017\002\307\211\002At?tDesc]\337 \243\205\004\377 __reduc\277e__ du\235\210\002n\377on-trivi\376\343 __cinit\377__passwo\377rd encry\340S\002\301F\354\206""\003\276\206\001\251+psy\377copg_bin\377ary/pq.p\013yx\004\016/\327\207\001\217\206\001\010\023\356\205\0027ing&\023pg\232\210\003\005\026\007onn\"\025\326\213\003\220\001\253\204\003\377\207\001~\255\000y data\236\204\006d\244\212\001\025\002l\310\210\022\026\006op!\025\016\026\001endA\016\304\205\027l\005\370t\220\213\005\237\204\003\303\214\001\360\215\002s\243\016\270\204\013s\373et\340\204\002chunk\177ed rows\375\211\002\370\343\213\004\030\005\375@block\374\203\204\t4\005single\0007\001.\t\204\217\002\227\213\016\232\204\006\243\204\025\301\204\017\341 \377ttuple[i\377nt, memo\377ryview]u\377tf-8COMM?AND_OK\332\204\005\342\204\005\275.\303\204\001pr__\010\006g\347et_\206\213\005\035\006par\353se\220\205\013E\317\212\001ingj\000\005.\210\205\006c\310\217\002__\017\010\377setstate\001_\013\016\216\213\tB\006\354\210\016\n\r\306\210\004!\r\370\232\210\003\211\006\302\213\013ExecS?tatusF\340\221\002\225\221\001\257NotS\266\212\005E\212\212\001O}p\370\220\001ional\013\002\003PG\302\216\003\000\005\324\017\017\010\325\016-\006\0366\014freeR\005\211\214\001\000\t\340H\027\263\214\001\255@M\026\032\003ens\017ure_\331\206\005\374\217\001R\n\233\204\005~g\nfinishz\n\372\204ae\235\214\001_mess\373ag\244\n.poll0\251\n\273\215\002\273\n\356@rt\365\217\003\373\217\003\214\2472\344\207\001__\2461\376\207\001\277\221\003_|\276\004\r\002hange\316\211\006jS\004c\341\207\001_\202\216\001al\005\013\020\316\221\004 \005\210\222\003\000\013_\306\004l\002\251\222\003\365_\262\010.\343\221\003e_in\013pu\312\004.\332\216\005f\013\014\007i\013(\365\212\004\246\r\370\214\002_\315\222\005_\321\222\001\243$\037exec_\000\t\243\210\003\005\n\016T\014xit6\022\322F\316\212\001\300\215\002\340\207D\345\206\001\324\204\006\353\212\001\014\002opy\201_\304\212\001\032\010\366M$\005\336\227\003\325Di\277s_busy\343Dm/ake_\224\223\002_\031\n\345\220\001\317fies\212d\357\230\002et\333er\354!tu\016\006in\tg\032\005\353\224\004_\210\217\001.\005\243\225\003<\005\323ut\235`\250\013p\014\005en\001d\365d""\230\204\005\324\214\001\347\222\002\352I\013\003\350I\002\342\227\001_\303p\014\t\315k-\002\201s\014\014\214%\020\330\220\002_r\314\230\003\247\205\004~\002p \337\n\221\002\336\221\002\030\t\357\221\002_\225j\037\007#_p\227\r\254 \303\214\003_\305\214\001\352i\217set_\243\214\003\027\001\n\rt\377race_fla1g\267E\r\002\325\206\004un\007\004\336B\001y\252\221\t\206\234\005\216\234\005\260\211\021\315\217\004\365\206\022\351\217\004\237clear;\006\225\210\003f/ieldO\006f\270\235\003\006\007{mo\022\010name!\007\027siz\003\010t\245\236\001>\007\n\0027col\007\010yp3\007\210\211\020 \215\221\004\271\215\001\244\236\002\343\006\321\236\003t3\t\343!\377attribut?esPQBu\307\233\001\000\005\250\317\213\020\033\004\347\212\022Q\342\233\003C\370\230\002P\213Qc\232\211\002P\356\223\004\r\000\372\221\001P\237ortal\005\005\212\211\005Q\376\221\234\007UsedGSS\037APIPQ\241\224\004;\005\232\214\002\365Q\242\226\002P\367\233\004Mode\356%\000xit\004\013ful\277lProto\267 V\376\321\240\003PQhosta\337ddrPQ\265\234\005Sy\013nc\301\236\003C\221\t\324\236\001\013\003\230\006\257setT\361aF\357bq\336\261\216\003TEXT\021\002Vi\203ew\265#\000\007\363\217\017\017\n\366\217\016_\357_Pyx\001\000Dic\377t_NextRe\367f__\204\240\004e___\r_\317\240\001d_\237\242\004\r\001\352\240\002\026\001\271d0\001 \000doc%\001f\313un\003\002g\343\220\005;\000im{plA\001main\003\002\367eta7\006moduql_\002\226\204\001h\001newo\001x\202\237\004\006\002\233\000capi\003\006\377hecksum_\003_p\265\000\337\242\003\006\003\331\221\003\022\002\262\243\001~\033\003unpickb\000\344\245\222\0052\003v\352\204\002\332\001quaalv\005\307\230\005\267\222\016\341\230\006ex\216!Sre\254\223\001\257\216\002_\262\005s\352\010\236\3220test\312 \276\206\001n\365_\310\217\n_\301\"enco\337ding_\252\220\020_i\277s_coro\345\233\001e\377algorith\177masciia\235\233\001]_\001\002io.\034\006s\331\205\001\376\001\001typmodax\301\245\002\306\231\003\230\226\005bufb\361\205\002^\000\003_ptr\231\246\002c]\001\364\264\242\003\360\217\010c&\003ccol_cerrc\236""\246\004c\375\217\013\376\233\210\002clength_sclin\256\217\001_\261\211\002\217back\227\220\t\250\220\004\352\242\004c\357lscn\204\230\003col\377umn_numb\373er\007\003idcom\367man\003\001pile!d\306\242\003\321\243\002\326\243\004\274\220\002c\256\220\t\354\243\0077_su;\000ry\245\233\005\300\220\n_crowc\340\247\002c\331\247\003\014\276\232\001\326\243\001de\276\240\002\327\220\014\316\220\016\342\240\003\376\250\235\002sdispch\023ar\004\001\331\211\001e\315E\355\220\r\343\220\020\377envvarer\017rmsg\357\223\002\323\212\010\367\223\n\214\224\002\301s\302\243\t\227\241\016\341\240\013\362\243\004\263\240\003ex\005c\000\000e\330\236\002\335\221\002\342\221\002\376\232\003\005\003\270\374\245\004\372\221\002\255\230\001use\307\221\016f|\340\213\004\367\213\002codef\223@\343no\275\225\003\232\215\002\246\240\002fmo\243df\360\213\001\315\252\003\357\226\001f\361\213\001f\352\347\213\002f\333\213\005f\340\252\001get\007Log\370\000\212\222\007\200\222\n\210\232\t\207\226\016\370\255\232\001\351\252\003\365\213\006iidin\375t\214\222\004itemsk\373ey\202\240\001label\312\235\204\003l\245\244\001lq\002\002\001in\211g\244\222\016\256\215\001n\261\254\002\260\222\005\240\204\004n\377umoptsouAt\251\254\n\275\254\003\267\204\003\356\214\007\370\214\007s\336\254\003\360\304\254\003\354\222\r\336\233\002\251\241\002dpg2\177pyencpg\272\251\001\354\000\003\237\206\001pg\321\254\003pin{gp\215\223\tplat\266\255\001\216\222\230\001pop\303\251\004\300\241\004\307\241\004.5_\336\207\005s\n\005pq\000\007\033\001\373um\020\010.misc:\374\241\013..\000trp\345\223\t\336\223\t\007res\301\247\002\325\223\007\315\223\010\245\212\004\332\256\003\377returnro\375w\343\206\004rvssel\001f\344\223\016\333\223\020\323\223\021\312\223\023\276\224\002\314\223\n\306\223\t\210\301\223\007\240\223\t\200\260\001s\252\223\020\245\220\013\244\223\001cp\264\223\r\252\223\020\314\223\001\253\223\010set\337\253\005?izessl\235\233\002\223\237\002\376\346\205\003strstre\337amsys\215\222\002id|\360\223\002\202\261\002_f""ast\226\257\001\177dtyplen\237\253\013\376\370\223\004updateu\373se\311\233\006uservGval\271\261\003\347\261\004\307\216\005p\206@\377tyxint (\367PyO\256\253\002 *, \366\304\210\001 *\006\000Py_s\376\246\223\001_t *)\000_\356\247\213\004as_\204\251\003_an\373d_\306\223\001\200\001\330\004\n\357\210+\220Q\005\001\020\220\r\375\230\004\002&\240a\240v\250\376\021\000\340\004\037\230q\320 \3770\260\013\270;\300k\320\377QR\330\004\023\2208\230\3778\2401\240A\330\004\007\377\200|\2207\230!\330\010\377*\250!\250;\260n\300\376\021\000\013\2101\200\001\360\010\367\000\n\033\025\001\021\220\024\220\377Q\330\010\020\220\007\220q\277\230\006\230l\250!2\001v\177\210W\220E\230\024\230\027\000\373\022\220<\000\027\220q\340\010\377\027\220t\2306\240\027\250\376\216\000\007\200q\330\010\017\320\377\017)\250\024\250Q\250g\237\260[\300\007\300\037\000\005\n\001\373\200A!\000\210s\220!\220\3754Y\000\005\230\\\250\021\250\377$\250h\260g\270Q\270\375a\032\000\035\036\330\0101\260\377\037\300\001\330\010\013\2105\377\220\003\2201\330\014\022\220\377+\230Q\230a\330\010\r\377\320\r \240\001\240\021\330\357\r\034\230A\204\001\017\210q\376N\000,-\330\010\024\220G\217\2301\230A\007\004\034\000D\000\320\3771A\300\021\300*\310A\373\310QC\010\017\210w\220c\377\230\021\330\020\026\220k\240\357\021\240!\340\006\000a\320\027\377(\250\001\250\026\250w\260\177a\260x\270q\330\025\276 \333\240\001 \001a\340_\025./\377\330\010)\250\034\260Q\260\276\230\000\013\2104\210q\242\006\340\177\010\025\220Z\230q\240\353\001\37345#\001\037\270\001\270\021\374\320\001\017\025@A\330\t\n\330\377\010\030\230\001\320\0312\260\177!\360\006\000\t\"\240-\002\376\377\000\024\220A\330\r%\240\177Q\330\014\027\320\027-\333 \377d\260.\300\010\310\006\310\336n\t!\320\023$\335@\020.\377\250a\250t\3203E\300\335QA\001\016\210U\352 1\330%\r\254@\230\323 \256\"\340b\006J\000\346h\000\016&U\004\202!\024\250^w\2706\300\252\000\020\220\017\301\000\177\005\240S\250\n\260!\203A\356P\017\200A\340\225\000W\250A\376\227\000\220{\240!\2404""\240\370\202`\313`\262A(\230!\2303\377\230j\250\003\2509\260C\337\260q\330\021\033\237A\330\014o\023\2201\340\001\001\200A\342\001\275\014\267 v\220W\230@\000\017?\210t\2205\230\rn\000\365#\372\220C\021\210!(\320\0477\260\277q\270\006\270a\270\\\0024\374\300a\224d\330\020:\270!\270\3713\027\001\354\003S\220\002\220!|\344\013\315 \027\030\330\025,\247\000\355\027\236 \330\034\247!\t\n\360\377\014\000\t\023\220(\230)\377\240:\250[\3208J\310\376\345\000\032\230-\240q\360\010\271\000\222 \324\002\020\220\013\304\000d\357\240.\260\007\302\000\020\032\320\375\032B\001\024 \240\t\250\025\377\250j\270\001\330\024)\250\377\031\260*\270J\300a\330\375\010\337\001H\240I\250Z\260\272\203\";\346b\014\022\220\227C\240\371Q\370H\250E3\2601\260D\370w\002\214\"`D \240\r\250Q}\330k89\220C\220q\352I\336\253\207\0014\320/A\227a\027\220qz\270\205\001\251\005\261?&\240\001\2708\357\230/\250\021\250\001\006\240eS\2501\314!\013\000\036\267`\001\253\201#\0373\210c\220\021\225\204\t\311\047\236\210\001\306^J\320\032\273a\373@\250\001:\320\3055\257a\024\201\200(\240\207\004\245\206\0051\260\377\021\260$\3206H\310\001\377\200A\360\010\000\026-\250\334\204\207\001\372\206\001#\240!\200\211\001<\220\377w\230a\330\014\031\230\037\337\250\001\250\035\260\010\000\026\320\275\026\337\206\001q\340\010!\230\207\006\025\377\220]\240,\250a\250x\367\260r\270\207 \020\220\005\220\337U\230!\2301\275\210\002\220u\377\230H\320$<\270A\270w\\\310\021\3529*\240A\200C\277i\250u\260I\270\343\212\003\220\3011\207\212\001\264\204\022\347.\215sW}.\250\335\001\312\n\340\010\022\216\211\002\010\013\335\210\357\205.\n\000\t\253\210\003S\230\373\001\330\307\206\016u\220M\240\023\373\240A\r\t\340\010\"\240!\377\2406\250\021\250%\250q\377\260\001\340\010\023\320\023#\377\2401\240D\250\005\250^\243\2705\343\214\003\305\210\006\274\212\005)\222\215\002e|\273\212\010\320\210\001&\230\001\230\021\311\210\0142\216\000#S\013\207\214\001v\220v\047\216\000\376\266\217\001t\2505\260\016\270e\371\300\352B\200\016,\250A\250T\243\260""\025\245\204\002\333\211\007}\021\014\232%W\377\230E\240\024\240T\250\025\323\250m\231\212\001\370\032\013\373\212\007\027\320\375\027\373\000\330\020\024\220E\230\377\036\320\0478\270\005\270X\377\300Q\300a\340\014\027\220\377~\240Q\320&7\260u\377\270H\300A\300Q\340\010\356\362\215\001s\220!\377\212\0068\270\001\277\270\023\270A\270Q\376\212\007(\357\230\"\230A\375\212\014\016\000\t|\2372\351\213\031\340\014\026\220h\207\221\001\377\2507\260\"\260B\260b\235\270\375@\033\320\033\311\213\001\246\003\240\337y\260\005\260X\304\220\001\340\014?\017\210q\330\020\032\371\205\006\332\217\002{\330\024\270*\010\000\r\027?\020\377\230?\250!\2509\260E\377\270\021\340\010\r\210W\220\357B\220a\330\250\204\005\017\210q\357\320\004\026\220\350\217\004~\230W\377\240A\330\021\036\230a\230\377t\2401\330\014\020\320\020w \240\001\032\004\014\320\014\231\207\002\377\024\220M\240\021\240$\240\337a\320\004\027\220\263\215\004\177\230\377g\240Q\330\021\031\230\021s\230$\330\207\0016\000!\240\021\032\004\n2\004\r\250\216\001DK\001\343\222\001\366\217\003\373\214\013\303\025\035\217\222\003\262\205\020g\002\327\215\001\014\210\2479\220N\217\217\004\374\214\006\330\227\220\010\320\373\004\030\221\220\001\013\2104\320\017\225!\302\223\002\021\336\222\001\024\347\220\001\315\000$\343\240A\034\003\367\220\003\234\217\001=\240\007\317\240q\330\025\356\005\244`O\240\3751B\002\340\010\034\230I\240\377Q\240d\250/\270\025\270\373g\300\330\215\021\"\240#\240W\377\250A\250X\260Q\320\004\304\376\000\320\221\003\021\344\006\221 \310\220\006\026\220?i\230q\240\004\240\255\224\002\366 \234\314@\315\004\320\024%c\002\376\220\024\320\335\004\373\223\002\017\210\177\230@v\320\257%6\260a\016\002\340\274\222\004\220\205|\373\206\002\001\373\216\016\233\217\001\323\215\004%\t\034\217\230L\250\001\321\225\001\220\225\001\220\216\004\023\364\223\212\001!\010H\243\001\013\2103\210\237j\230\003\2301\246\222\004\242\001a\377\330\010\021\220\026\220q\230g\010\240\001\347\004\363Cn\250\331 \334\301@\355\223\004+\2501""\227\006\177\240\337a\240t\2501\213\022\033\230\341:\341 \314`\374@\312\004\026\220m\316\270\026\320\004\036\266\226\001\376\013\037\230\365q2\006o\303$\010\013\2102/\210S\220\001\334\217\023\320\316\230\001\251\222\001\031\031\234\225\001\242\007\026\2205\010\370\216\014\347\221\003>\004\016\320\004\"\240!\353\224\006\315\222\r\323\230(\273\224\007\335\214\024b\231\t\320%>\360\207\001\024\320=O\310\372\230\001\235\206\001\377\"\240/\260\031\270!\340w\010 \240\301\230\0026\220\027\250\213\001j\361\212\004A\246,\016\270\227\0033\210J\n\373\330\020\215@\250D\3200B\373\300!\255\231\001q\320\004$\240\337A\360\n\000\t\374\0020\260\r\001\364%\320\026\246\213\003\377\227\002\370\220\016\313\226\002\257\320-?\270:\004\014:\004/\373\250q\035!\240T\320);\177\2701\320\004%\240Q\\\022\206\301\220\n\240Q$\002\236F\231\n\271\223\002\250\034\230\227\002\200P%\240Z\030\001\371\230\002\240\226\001\257\010\025\220Q\225\206\004!\273\210\002n?\260A\320\004&\240\344\231\003\250\207\001~\330\215\014\320\004\047\240q\360\206\215\004\2378\2501\250I\223\232\002\257\231\003\026\377\220n\240A\240T\250\036\217\260y\300\005\222\207\003\337.\334\214\002\320C1C\374\214\001\343\211\002\201\214\001\320\233\004D\310\235\001\277\001\320\004*\250!\346\233\001H\377\230A\230T\320!1\260\335\021\014\004\035\230X\364\207\001\320*\373:\270\257\222\0023\210g\220Q\304\336\230\0075\001&\270\227\002\233\235\001\370\216\002\320(\3778\270\t\300\023\300D\310\336R\002&\260\014\270\225\235\001\320\017\314\025\006j\002(\260\304`\202&\014\026;\320\026\222b\260\016\270\347\232\017\372!\375+\261\206\001\024\220I\230Q\230\377d\320\"2\260!\320\004\356\016\002\036\230c\347\234\001\330\010)?\320)?\270|\310\252\213\001\240\231\001\377\340\010\014\210E\220\025\220\335a\346\226\001\024\220L\330\235\002\014\021\377\220\021\220\"\220H\230Ew\240\021\330\006\004K\230u\323\220\001\316\024\003L\240\005\207\234\001!\003J\230\371e\371\213\001.\003I\230U\240!\374,\005\r\nM\240\025\240a\340\357\010\034\320\034\272\234\002\3202B\277\300%""\300u\310A\323\214\006\014\343\210D\346\236\005\244\231\005\266\004 \240\001\356\232\234\006\032\230.\206\211\002^\2701\367\270L\310\240\237\0027\220$\220\331a\210\234\023\263\224\003g\230\210A\320\023v\272A\030%\274\217\003|\3001\204\234\001\2638\230\205\234\002\004\000\320\004\362b\024\373\220J\313\215\001\320#3\2601n\014\004\036\320\036\236\226\004F\300\336\205\004N\317L,\250A\276\235\003\233\233\021 \254\214\001\317\250\014\260A\255\225\026\305\231!\320\004z\261\234\001\010\235C\024\320%5\274\214\00170\260\001\252\237\004*\250\267\210\030\256!\347\034\260Q\234\226\047\370\223\002\320.@\373\300\001\265\231\006\320\0041\260\021\376\313\027\032\230,\240a\240|q\260\221\227\027\350\230\014\214\210\t2\260!\361\240\004N\300&Q\330\014\344\235\017\253\244\001<\274\235\030\364\365\232\016\263\0223\241\001\"\320\"4\373\3204\351\236\002\022\320\022*\320\203*=\351\230\001\273\215\001\272\233\014\214\207\007\200(4\276\311A\036\230n\320,\232\212\001\014\206<\003>\270\207s*\000\241\212\007\275\207\001\020\377\024\220N\320\"8\270\001\306\376\242\r\330\010\363\216\006\334@\204\243\004.\250\031a\223\214\026\204\240\002\250\\\322\243\003\306\237!\343\233\007\263\320\004^\002\367\016?\270\216\212\021\330\345\020\363\0227\340\240\001\254\244\0020\260\001\214\213\030\215\244\001|\270\363\202&\232\t\242\"\026\363\320\026\347\204\001\345!.\320.E\374\304\222\022\221@\260T\3209K\310\3471\320\004\201\212\002\047\013G\300q\340\347\241\020)\t\273B\210\224\002\215\224\002\037\230|\373\2501\375\215\001@\300\006\300a\376\346\227\0011\330\014\025\220[\240\233\001\240\372\205\002V\270\276\244\003\234\226\001\340\031\014\215\206\010\026\000\330\020\227\251\001\001\001";
    PyObject *data = __Pyx_DecompressString_LZSS(cstring, 6243, 12193);
    #define __Pyx_DecompressString_UNUSED
    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 (12193 bytes) */
static const char bytes[] = "  ( [ at 0x available instead bytes on the client; version  param_formats param_types param_values but  requires libpq from PostgreSQL \047PGresult\047 | None((tree fragment)))>.<>?Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the \047annotation_typing\047 directive to False.PQsendFlushRequest PQsetResultAttrs failedSequence[bytes | None] | NoneSequence[bytes] | NoneSequence[int] | None] at 0xadd_notebytes or buffer expected, got bytes | Nonecancel connection not openedcancel failed: close prepared failed: connection not in pipeline modeconsuming input failed: couldn\047t allocate PGconncouldn\047t allocate connection defaultscouldn\047t allocate connection infocouldn\047t allocate empty PGresultcouldn\047t allocate for escape_bytea of couldn\047t allocate for unescape_bytea of couldn\047t allocate on conninfo parsecouldn\047t create cancel objectcouldn\047t create cancelConn objectcouldn\047t reset connectioncouldn\047t send cancellation: currently only supported on Linuxdescribe prepared failed: disableenableerror in notice receiver: %sescape_identifier failed: escape_identifier failed: no connection providedescape_literal failed: escape_literal failed: no connection providedescape_string failed: executing prepared query failed: executing query failed: failed to enter pipeline modefailed to sync pipelineflush request failed: flushing failed: flushing failed: the connection is closedgcgot isenabledlist[ConninfoOption]list[PGresAttDesc]no default __reduce__ due to non-trivial __cinit__password encryption failed: preparing query failed: psycopg_binary/pq.pyxpsycopg_binary/pq/conninfo.pyxpsycopg_binary/pq/escaping.pyxpsycopg_binary/pq/pgcancel.pyxpsycopg_binary/pq/pgconn.pyxpsycopg_binary/pq/pgresult.pyxreceiving copy data failed: sending close prepared failed: sending copy data failed: sending copy end failed: sending describe prepared failed: sending prepared query failed: send""ing query and params failed: sending query failed: setting chunked rows mode failedsetting nonblocking failed: setting single row mode failedthe cancel connection is closedthe connection is closedthe connection is losttuple[int, memoryview]utf-8COMMAND_OKConninfoConninfo.__repr__Conninfo.get_defaultsConninfo.parseConninfoOptionEscapingEscaping.__reduce_cython__Escaping.__setstate_cython__Escaping.escape_byteaEscaping.escape_identifierEscaping.escape_literalEscaping.escape_stringEscaping.unescape_byteaExecStatusFormatNoneNotSupportedErrorOperationalErrorPGcancelPGcancel.__reduce_cython__PGcancel.__setstate_cython__PGcancel.cancelPGcancel.freePGcancelConnPGcancelConn.__reduce_cython__PGcancelConn.__setstate_cython__PGcancelConn._ensure_pgcancelconnPGcancelConn.blockingPGcancelConn.finishPGcancelConn.get_error_messagePGcancelConn.pollPGcancelConn.resetPGcancelConn.startPGconnPGconn.__reduce_cython__PGconn.__setstate_cython__PGconn.cancel_connPGconn.change_passwordPGconn.close_portalPGconn.close_preparedPGconn.connectPGconn.connect_pollPGconn.connect_startPGconn.consume_inputPGconn.describe_portalPGconn.describe_preparedPGconn.encrypt_passwordPGconn.enter_pipeline_modePGconn.exec_PGconn.exec_paramsPGconn.exec_preparedPGconn.exit_pipeline_modePGconn.finishPGconn.flushPGconn.get_cancelPGconn.get_copy_dataPGconn.get_error_messagePGconn.get_resultPGconn.is_busyPGconn.make_empty_resultPGconn.notifiesPGconn.parameter_statusPGconn.pingPGconn.pipeline_syncPGconn.preparePGconn.put_copy_dataPGconn.put_copy_endPGconn.resetPGconn.reset_pollPGconn.reset_startPGconn.send_close_portalPGconn.send_close_preparedPGconn.send_describe_portalPGconn.send_describe_preparedPGconn.send_flush_requestPGconn.send_preparePGconn.send_queryPGconn.send_query_paramsPGconn.send_query_preparedPGconn.set_chunked_rows_modePGconn.set_single_row_modePGconn.set_trace_flagsPGconn.tracePGconn.untracePGnotifyPGresAttDescPGresultPGresult.__reduce_cython__PGresult.__setstate_cython__PGresult.clearPGresult.error_fi""eldPGresult.fformatPGresult.fmodPGresult.fnamePGresult.fsizePGresult.ftablePGresult.ftablecolPGresult.ftypePGresult.get_error_messagePGresult.get_valuePGresult.param_typePGresult.set_attributesPQBufferPQBuffer.__reduce_cython__PQBuffer.__setstate_cython__PQcancelCreatePQchangePasswordPQclosePortalPQclosePreparedPQconnectionUsedGSSAPIPQencryptPasswordConnPQenterPipelineModePQexitPipelineModePQfullProtocolVersionPQhostaddrPQpipelineSyncPQsendClosePortalPQsendClosePreparedPQsetTraceFlagsPqFormatTEXTTraceViewBufferViewBuffer.__reduce_cython__ViewBuffer.__setstate_cython____Pyx_PyDict_NextRef__annotate____build_version____class____dict____doc____func____getstate____impl____main____metaclass____module____name____new____prepare____pyx_capi____pyx_checksum__pyx_result__pyx_state__pyx_type__pyx_unpickle_Escaping__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____repr____set_name____setstate____setstate_cython____test___clean_error_message_dict_encoding_ensure_pgcancelconn_is_coroutinealgorithmasciiasync_asyncio.coroutinesattrsatttypmodatypesbinaryblockingbufbufferbuffer_ptrbytescalgocancelcancel_conncbufferccolcerrcformatschange_passwordclearclengthscline_in_tracebackclose_portalclose_preparedclscnparamscolumn_numbercolumnidcommandcompiledconnconnectconnect_pollconnect_startconnection_summaryconninfoconsume_inputcrowctypescvaluesdatadecodedescrdescribe_portaldescribe_prepareddescriptionsdispchardispsizeeencodingencrypt_passwordenter_pipeline_modeenvvarerrmsgerrorerror_fielderror_messageerrorsescape_byteaescape_identifierescape_literalescape_stringexcexceptionexec_exec_paramsexec_preparedexec_statusexit_pipeline_modeffformatfieldcodefilenofinishflagsflushfmodfnameformatfreefsizeftableftablecolftypegetLoggerget_cancelget_copy_dataget_defaultsget_error_messageget_resultget_valueiidintis_busyitemskeywordlabellengthlinuxloggerloggingmake_empty_resultnamenbytesnotifiesnparamsnumoptsoutparam_formatsparam_numberparam_typeparam_typesparam_valuesparameter_statusparsepa""sswdpg2pyencpgconnpgconn_ptrpgresultpingpipeline_syncplatformpollpoppreparepsycopgpsycopg._encodingspsycopg.pqpsycopg.pq._enumspsycopg.pq.miscpsycopg_binary.pqptrput_copy_dataput_copy_endresresetreset_pollreset_startresult_formatreturnrow_numberrvsselfsend_close_portalsend_close_preparedsend_describe_portalsend_describe_preparedsend_flush_requestsend_preparesend_querysend_query_paramssend_query_preparedset_attributesset_chunked_rows_modeset_single_row_modeset_trace_flagssetdefaultsizesslstartstatestatusstrstreamsystableidtracetypes_fasttypidtyplenunescape_byteauntraceupdateuse_setstateuservvalvaluesversionversion_prettyxint (PyObject *, char **, Py_ssize_t *)\000_buffer_as_string_and_size\200\001\330\004\n\210+\220Q\200\001\330\004\020\220\r\230Q\200\001\330\004&\240a\240v\250Q\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\2208\2308\2401\240A\330\004\007\200|\2207\230!\330\010*\250!\250;\260n\300A\330\004\013\2101\200\001\360\010\000\n\033\230!\330\010\021\220\024\220Q\330\010\020\220\007\220q\230\006\230l\250!\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\2306\240\027\250\001\330\004\007\200q\330\010\017\320\017)\250\024\250Q\250g\260[\300\007\300q\340\010\017\320\017)\250\024\250Q\250g\260[\300\001\200A\330\010\017\210s\220!\2204\220q\230\005\230\\\250\021\250$\250h\260g\270Q\270a\200A\330\035\036\330\0101\260\037\300\001\330\010\013\2105\220\003\2201\330\014\022\220+\230Q\230a\330\010\r\320\r \240\001\240\021\330\r\034\230A\230Q\330\010\017\210q\200A\330,-\330\010\024\220G\2301\230A\200A\330,-\330\010\034\230A\330\0101\3201A\300\021\300*\310A\310Q\330\010\013\2105\220\003\2201\330\014\017\210w\220c\230\021\330\020\026\220k\240\021\240!\340\020\026\220a\320\027(\250\001\250\026\250w\260a\260x\270q\330\025\037\230q\240\001\330\020\026\220a\340\010\r\320\r \240\001\240\021\330\r\034\230A\230Q\330\010\017\210q\200A\330./\330\010)\250\034\260Q\260a\330\010\013\2104\210q\330\014\022\220+\230Q\230a\340""\010\025\220Z\230q\240\001\200A\33045\330\010)\250\037\270\001\270\021\330\010\013\2104\210q\330\014\022\220+\230Q\230a\340\010\025\220Z\230q\240\001\200A\330@A\330\t\n\330\010\030\230\001\320\0312\260!\360\006\000\t\"\240\021\330\010\013\2101\330\014\024\220A\330\r%\240Q\330\014\027\320\027-\250Q\250d\260.\300\010\310\006\310a\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\020.\250a\250t\3203E\300Q\360\006\000\t\016\210U\220!\2201\330\r\027\220q\230\001\330\010\017\210q\200A\340\t\n\330\010\030\230\001\320\031-\250Q\360\006\000\016&\240Q\330\014\027\320\027(\250\001\250\024\250^\2706\300\021\330\010\020\220\017\230q\240\005\240S\250\n\260!\330\014\022\220!\320\023$\240A\330\020.\250a\250t\3203E\300Q\200A\340\r%\240W\250A\330\014\027\220{\240!\2404\240q\330\010\013\2101\330\014\022\220(\230!\2303\230j\250\003\2509\260C\260q\330\021\033\2301\230A\330\014\023\2201\340\014\023\2201\200A\360\006\000\t\014\2104\210v\220W\230A\330\014\017\210t\2205\230\r\240S\250\001\330\020\026\220a\320\027(\250\001\250\021\360\006\000\t(\320\0477\260q\270\006\270a\270q\330\010\013\2104\210s\220!\330\014\022\220+\230Q\330\020:\270!\2703\270a\270q\360\006\000\t\016\210S\220\002\220!\330\r\027\220q\230\001\330\010\017\210q\200A\360\006\000\027\030\330\025,\250A\330\027.\250a\330\034$\240A\330\t\n\360\014\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230-\240q\360\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\320\032,\250A\330\024 \240\t\250\025\250j\270\001\330\024)\250\031\260*\270J\300a\330\010\033\2301\230H\240I\250Z\260q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0203\2601\260D\3208J\310!\200A\360\006\000\027\030\330\025,\250A\330\027.\250a\330\034$\240A\330\t\n\360\014\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230-\240q\360\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020 \240\r\250Q\330\024 \240\t\250\025\250j""\270\001\330\024)\250\031\260*\270J\300a\330\010\033\2301\230H\240I\250Z\260q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2109\220C\220q\330\014\022\220!\320\023$\240A\330\020*\250!\2504\320/A\300\021\330\010\027\220z\240\021\240!\200A\360\006\000\027\030\330\027.\250a\330\034$\240A\330\t\n\360\014\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230&\240\001\360\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230/\250\021\330\024 \240\006\240e\2501\330\024)\250\021\330\024\036\230j\250\001\330\010\033\2301\230H\240I\250Z\260q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\0203\2601\260D\3208J\310!\340\010\027\220z\240\021\240!\200A\360\006\000\027\030\330\027.\250a\330\034$\240A\330\t\n\360\014\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230&\240\001\360\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\320\032.\250a\330\024 \240\006\240e\250:\3205J\310!\330\024\036\230j\250\001\330\010\033\2301\230H\240I\250Z\260q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0201\260\021\260$\3206H\310\001\200A\360\010\000\026-\250A\330\t\n\360\006\000\t#\240!\330\010\013\210<\220w\230a\330\014\031\230\037\250\001\250\035\260a\330\014\026\320\026.\250a\250q\340\010!\240\021\330\010\013\2101\330\014\025\220]\240,\250a\250x\260r\270\021\330\014\020\220\005\220U\230!\2301\330\020\026\220a\220u\230H\320$<\270A\270\\\310\021\360\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230*\240A\330\024 \240\006\240i\250u\260I\270Q\330\010\022\220!\2201\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020*\250!\2504\320/A\300\021\330\010\027\220z\240\021\240!\200A\360\010\000\026-\250A\330\t\n\360\006\000""\t#\240!\330\010\013\210<\220w\230a\330\014\031\230\037\250\001\250\035\260a\330\014\026\320\026.\250a\250q\340\010!\240\021\330\010\013\2101\330\014\025\220]\240,\250a\250x\260r\270\021\330\014\020\220\005\220U\230!\2301\330\020\026\220a\220u\230H\320$<\270A\270\\\310\021\360\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230.\250\001\330\024 \240\006\240i\250u\260I\270Q\340\010\022\220!\2201\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0203\2601\260D\3208J\310!\200A\360\n\000\t\014\2104\210v\220S\230\001\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210u\220M\240\023\240A\330\014\022\220!\320\023$\240A\240Q\340\010\"\240!\2406\250\021\250%\250q\260\001\340\010\023\320\023#\2401\240D\250\005\250^\2705\300\001\330\010\013\2104\210s\220!\330\014\022\220!\320\023$\240A\330\020)\250\021\250$\250e\3203E\300Q\360\006\000\t\016\210S\220\002\220&\230\001\230\021\330\r\027\220q\230\001\330\010\017\210q\200A\360\n\000\t#\240!\2406\250\021\250%\250q\260\001\340\010\013\2104\210v\220S\230\001\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210u\220M\240\023\240A\330\014\022\220!\320\023$\240A\240Q\340\010\023\320\023&\240a\240t\2505\260\016\270e\3001\330\010\013\2104\210s\220!\330\014\022\220!\320\023$\240A\330\020,\250A\250T\260\025\3206H\310\001\360\006\000\t\016\210S\220\002\220&\230\001\230\021\330\r\027\220q\230\001\330\010\017\210q\200A\360\014\000\t\014\2104\210v\220W\230E\240\024\240T\250\025\250m\2703\270a\330\014\022\220!\320\023$\240A\240Q\340\010\"\240!\2406\250\021\250%\250q\260\001\340\010\013\2104\210v\220W\230A\330\014\027\320\027)\250\021\330\020\024\220E\230\036\320\0478\270\005\270X\300Q\300a\340\014\027\220~\240Q\320&7\260u\270H\300A\300Q\340\010\013\2104\210s\220!\330\014\022\220+\230Q\330\0208\270\001\270\023\270A\270Q\360\006\000\t\016\210S\220\002\220(\230\"\230A\330\r\027\220q\230\001\330\010\017\210q\200A\360\016\000\t#\240!""\2406\250\021\250%\250q\260\001\340\010\013\2104\210v\220W\230A\330\014\017\210t\2205\230\r\240S\250\001\330\020\026\220a\320\027(\250\001\250\021\340\014\026\220h\230l\250!\2507\260\"\260B\260b\270\001\330\014\033\320\033.\250a\330\020\024\220E\230\036\240y\260\005\260X\270Q\270a\340\014\017\210q\330\020\032\230!\2301\330\020\026\220a\320\027(\250\001\330\024,\250A\250T\260\025\3206H\310\001\360\010\000\r\027\220h\230l\250!\2507\260\"\260B\260b\270\001\330\014\033\230?\250!\2509\260E\270\021\340\010\r\210W\220B\220a\330\010\022\220!\2201\330\010\017\210q\320\004\026\220a\330\010\013\2104\210~\230W\240A\330\021\036\230a\230t\2401\330\014\020\320\020 \240\001\320\004\026\220a\330\010\014\320\014!\240\021\330\010\024\220M\240\021\240$\240a\320\004\027\220q\330\010\013\2104\210\177\230g\240Q\330\021\031\230\021\230$\230a\330\014\020\320\020!\240\021\320\004\027\220q\330\010\014\320\014!\240\021\330\r\033\2301\230D\240\001\320\004\027\220q\340\r%\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\025\035\230Q\230a\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\320\004\027\220q\360\014\000\t\014\2109\220N\240!\2404\240q\330\014\022\220!\320\023$\240A\330\020.\250a\250t\3203E\300Q\320\004\030\230\001\330\010\013\2104\320\017!\240\027\250\001\330\021 \240\001\240\024\240Q\330\014\020\320\020$\240A\320\004\030\230\001\330\r%\240Q\330\014\017\210t\220=\240\007\240q\330\025\036\230a\230t\2401\330\020\024\220O\2401\320\004\030\230\001\340\010\034\230I\240Q\240d\250/\270\025\270g\300Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\020\"\240#\240W\250A\250X\260Q\320\004\031\230\021\330\r%\240Q\330\021\033\2301\230D\240\001\320\004\031\230\021\340\r%\240W\250A\330\014\026\220i\230q\240\004\240A\330\010\017\210q\320\004\032\230!\360\014\000\t\014\2109\320\024%\240Q\240d\250!\330\014\022\220!\320\023$\240A\330\020.\250a\250t\3203E\300Q\320\004\034\230A\330\010\017\210\177\230a\230v\320%6\260a\320\004\034\230A\340\r%\240Q\330\014\027\220|\2401\240D""\250\001\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\330\010\027\220z\240\021\240!\320\004\034\230A\340\r%\240Q\330\014\034\230L\250\001\250\024\250Q\330\010\013\2109\220C\220q\330\014\023\2201\330\010\027\220z\240\021\240!\320\004\034\230H\240A\330\010\013\2103\210j\230\003\2301\330\014\022\220!\320\023%\240Q\240a\330\010\021\220\026\220q\230\010\240\001\330\r%\240Q\330\021\031\230\021\230$\230n\250A\320\004\035\230Q\330\010\030\230\001\320\031+\2501\340\r%\240Q\330\014\027\220\177\240a\240t\2501\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\330\010\033\230:\240Q\240a\320\004\035\230Q\340\r%\240Q\330\014\026\220m\2401\240D\250\001\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\320\004\036\230a\330\010\017\210\177\230a\230v\320%6\260a\320\004\037\230q\340\r%\240Q\330\014\026\220o\240Q\240d\250!\330\010\013\2102\210S\220\001\330\014\022\220!\320\023$\240A\330\020*\250!\2504\320/A\300\021\320\004\037\230q\360\014\000\t\031\230\001\320\031+\2501\340\r%\240Q\330\014\026\220o\240Q\240d\250!\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\240Q\320\004\"\240!\360\006\000\016&\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230(\240!\2404\240q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2103\210b\220\001\330\014\022\220!\320\023$\240A\320%8\270\001\270\024\320=O\310q\330\010\017\210q\320\004\"\240/\260\031\270!\340\010 \240\001\330\010\013\2106\220\027\230\001\330\014\023\320\023#\2401\240A\340\r%\240Q\330\014\026\220m\2401\240D\250\016\260a\330\010\013\2103\210b\220\001\330\014\022\220!\320\023$\240A\330\020+\2501\250D\3200B\300!\330\010\017\210q\320\004$\240A\360\n\000\t\031\230\001\320\0310\260\001\340\r%\240Q\330\014\026\320\026)\250\021\250$\250a\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020(\250\001\250\024\320-?\270q\320\004$\240A\360\014\000\t\031\230\001\320\031/\250q\340\r%""\240Q\330\014\026\320\026)\250\021\250$\250a\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\240T\320);\2701\320\004%\240Q\340\r%\240Q\330\014\026\320\026)\250\021\250$\250a\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\320\004%\240Q\360\014\000\t\031\230\001\320\0310\260\001\340\r%\240Q\330\014\026\320\026*\250!\2504\250q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\240Q\320\004%\240Z\250q\330\010\030\230\001\320\031,\250A\330\010\025\220Q\330\r%\240Q\330\021!\240\021\240$\240n\260A\320\004&\240a\330\010\013\2104\320\017!\240\023\240A\330\014\022\220!\320\023$\240A\240Q\320\004\047\240q\360\n\000\t#\240!\2408\2501\250I\260Q\260a\330\r%\240Q\330\014\026\220n\240A\240T\250\036\260y\300\005\300Q\330\010\013\2103\210b\220\001\330\014\022\220!\320\023$\240A\330\020,\250A\250T\3201C\3001\330\010\017\210q\320\004)\250\021\330\010\024\220G\2301\230D\320 0\260\001\320\004*\250!\330\010\024\220H\230A\230T\320!1\260\021\320\004*\250!\330\010\035\230X\240Q\240d\320*:\270!\330\010\013\2103\210g\220Q\330\014\023\2201\340\014\023\2201\320\004*\250&\260\007\260q\330\010\017\320\017#\2401\240D\320(8\270\t\300\023\300D\310\001\320\004*\250&\260\014\270A\330\010\017\320\017#\2401\240D\320(8\270\001\320\004*\250(\260!\340\010\025\220Q\330\r%\240Q\330\014\026\320\026+\2501\250D\260\016\270a\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\320\004+\2501\330\010\024\220I\230Q\230d\320\"2\260!\320\004+\2501\330\010\036\230c\240\021\240!\330\010)\320)?\270|\3101\330\014\020\220\002\220!\340\010\014\210E\220\025\220a\220q\330\014\024\220L\240\001\240\021\330\014\021\220\021\220\"\220H\230E\240\021\330\014\021\220\021\220\"\220K\230u\240A\330\014\021\220\021\220\"\220L\240\005\240Q\330\014\021\220\021\220\"\220J\230e\2401\330\014\021\220\021\220\"\220I\230U\240!\330\014\021\220\021\220\"\220J\230e\2401\330\014\021\220\021\220\"\220M\240\025\240a\340\010\034\320\034-\250Q\250d\3202B\300%\300u\310A\330\010\022\220!\2201\330\010\014\210D\220""\003\2201\330\014\022\220!\320\023$\240A\240Q\320\004+\2501\330\010 \240\001\360\006\000\016&\240Q\330\014\032\230.\250\001\250\024\250^\2701\270L\310\001\330\010\013\2107\220$\220a\330\014\022\220!\320\023$\240A\330\020.\250a\250t\3203E\300Q\330\010\013\210;\220g\230Q\330\014\023\320\023*\250!\330\030%\240Q\320&7\260|\3001\330\014\023\2208\2301\340\014\023\2208\2301\320\004,\250A\330\010\024\220J\230a\230t\320#3\2601\320\004,\250A\330\010\036\320\0361\260\021\260$\3206F\300a\330\010\013\2103\210g\220Q\330\014\023\2201\340\014\023\2201\320\004,\250A\360\006\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020 \240\007\240q\250\014\260A\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2109\220C\220q\330\014\022\220!\320\023$\240A\330\020*\250!\2504\320/A\300\021\330\010\027\220z\240\021\240!\320\004.\250a\330\010\024\220L\240\001\240\024\320%5\260Q\320\0040\260\001\330\010\030\230\001\320\031*\250!\360\006\000\016&\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230.\250\001\250\034\260Q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020)\250\021\250$\320.@\300\001\340\010\027\220z\240\021\240!\320\0041\260\021\360\006\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230,\240a\240|\2601\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\020(\250\001\250\024\320-?\270q\320\0042\260!\330\010\030\230\001\320\031,\250A\360\006\000\016&\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\320\032*\250!\250<\260q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020)\250\021\250$\320.@\300\001\340\010\027\220z\240\021\240!\320\0043\2601\330\010\"\320\"4\3204J\310!\330\014\022\320\022*\320*=\270Q\330\010\013\2103\210c\220\021\330""\014\022\220!\320\023$\240A\330\020,\250A\250T\3201C\3001\340\010\027\220z\240\021\240!\320\0044\260A\330\010\036\230n\320,B\300!\330\014\022\320\022*\320*>\270a\330\010\013\2103\210g\220Q\330\014\023\2201\340\014\023\2201\320\0044\260A\340\r%\240Q\330\014\026\320\026*\250!\330\020\024\220N\320\"8\270\001\330\010\013\2104\210q\330\014\022\220+\230Q\230a\330\010\027\220z\240\021\240!\320\0045\260Q\330\010\030\230\001\320\031.\250a\360\006\000\016&\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\320\032,\250A\250\\\270\021\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0201\260\021\260$\3206H\310\001\320\0045\260Q\330\010\"\320\"4\3204J\310!\330\014\022\320\022*\320*?\270q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020,\250A\250T\3201C\3001\340\010\027\220z\240\021\240!\320\0047\260q\330\010\030\230\001\320\0310\260\001\360\006\000\016&\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\320\032.\250a\250|\2701\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0201\260\021\260$\3206H\310\001\320\0048\270\001\330\010\026\320\0260\260\001\330\014\022\320\022.\320.E\300Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0204\260A\260T\3209K\3101\320\004:\270!\330\010\026\320\0260\260\001\330\014\022\320\022.\320.G\300q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0204\260A\260T\3209K\3101\320\004>\270a\330\010\030\230\001\330\010\030\230\001\330\010\037\230|\2501\250D\3200@\300\006\300a\340\010\013\2101\330\014\025\220[\240\001\240\024\320%5\260V\2701\340\014\023\2201\220B\220a\340\014\024\220L\240\001\240\024\320%5\260V\2701\330\020\027\220q\340\020\027\220q";
    PyObject *data = NULL;
    #define __Pyx_DecompressString_UNUSED
    #define __Pyx_DecompressString_LZSS_UNUSED
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 443; i++) {
      Py_ssize_t bytes_length = str_length_index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 94) 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 = 443; i < 525; i++) {
      Py_ssize_t bytes_length = bytes_length_index[i-443].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 < 525; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 443;
      for (Py_ssize_t i=0; i<82; ++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;
    int32_t const cint_constants_4[] = {8405287L};
    for (int i = 0; i < 1; i++) {
      numbertab[i] = PyLong_FromLong(cint_constants_4[i - 0]);
      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<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
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
#ifdef __cplusplus
namespace {
#endif
typedef struct {
    unsigned int argcount : 3;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 1;
    unsigned int nlocals : 4;
    unsigned int flags : 10;
    unsigned int first_line : 10;
} __Pyx_PyCode_New_function_description;
#ifdef __cplusplus
} /* anonymous namespace */
#endif
/* 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, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 19};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pyx, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 73};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_pgconn};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_connect, __pyx_mstate->__pyx_kp_b_iso88591_A_Qa_4q_Qa_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 81};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_pgconn};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_connect_start, __pyx_mstate->__pyx_kp_b_iso88591_A45_4q_Qa_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 89};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_connect_poll, __pyx_mstate->__pyx_kp_b_iso88591_a_av_6a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) 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[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_finish, __pyx_mstate->__pyx_kp_b_iso88591_Q_t_q_at1_O1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 121};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pgconn_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_3d_q_Qa_c_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 129};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_reset_start, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_m1D_4q_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 136};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_reset_poll, __pyx_mstate->__pyx_kp_b_iso88591_A_av_6a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 139};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_conninfo};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_ping, __pyx_mstate->__pyx_kp_b_iso88591_A_G1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 198};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_parameter_status, __pyx_mstate->__pyx_kp_b_iso88591_4A_n_B_a_3gQ_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 213};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_encoding};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_get_error_message, __pyx_mstate->__pyx_kp_b_iso88591_q_1D_8_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 288};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_pgresult, __pyx_mstate->__pyx_n_u_pgconn_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_exec, __pyx_mstate->__pyx_kp_b_iso88591_A_WA_3d_q_q_A_c_AQ_9Cq_A_4_A_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 301};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_pgconn_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_query, __pyx_mstate->__pyx_kp_b_iso88591_1_WA_3d_q_a_1_c_AQ_4q_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 313};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_param_values, __pyx_mstate->__pyx_n_u_param_types, __pyx_mstate->__pyx_n_u_param_formats, __pyx_mstate->__pyx_n_u_result_format, __pyx_mstate->__pyx_n_u_cnparams, __pyx_mstate->__pyx_n_u_ctypes, __pyx_mstate->__pyx_n_u_cvalues, __pyx_mstate->__pyx_n_u_clengths, __pyx_mstate->__pyx_n_u_cformats, __pyx_mstate->__pyx_n_u_pgconn_ptr, __pyx_mstate->__pyx_n_u_pgresult};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_exec_params, __pyx_mstate->__pyx_kp_b_iso88591_A_A_a_A_8J_q_WA_3d_q_Q_j_Ja_1HIZ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 344};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_param_values, __pyx_mstate->__pyx_n_u_param_types, __pyx_mstate->__pyx_n_u_param_formats, __pyx_mstate->__pyx_n_u_result_format, __pyx_mstate->__pyx_n_u_cnparams, __pyx_mstate->__pyx_n_u_ctypes, __pyx_mstate->__pyx_n_u_cvalues, __pyx_mstate->__pyx_n_u_clengths, __pyx_mstate->__pyx_n_u_cformats, __pyx_mstate->__pyx_n_u_pgconn_ptr, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_query_params, __pyx_mstate->__pyx_kp_b_iso88591_A_A_a_A_8J_q_WA_3d_q_A_j_Ja_1HIZ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 375};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_param_types, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_types_fast, __pyx_mstate->__pyx_n_u_nparams, __pyx_mstate->__pyx_n_u_atypes, __pyx_mstate->__pyx_n_u_pgconn_ptr, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_prepare, __pyx_mstate->__pyx_kp_b_iso88591_A_A_wa_a_aq_1_axr_U_1_auH_A_WA_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 409};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_param_values, __pyx_mstate->__pyx_n_u_param_formats, __pyx_mstate->__pyx_n_u_result_format, __pyx_mstate->__pyx_n_u_cnparams, __pyx_mstate->__pyx_n_u_ctypes, __pyx_mstate->__pyx_n_u_cvalues, __pyx_mstate->__pyx_n_u_clengths, __pyx_mstate->__pyx_n_u_cformats, __pyx_mstate->__pyx_n_u_pgconn_ptr, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_query_prepared, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_8J_WA_3d_q_a_e_5J_j_1HIZq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 439};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_param_types, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_types_fast, __pyx_mstate->__pyx_n_u_nparams, __pyx_mstate->__pyx_n_u_atypes, __pyx_mstate->__pyx_n_u_pgconn_ptr, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_prepare, __pyx_mstate->__pyx_kp_b_iso88591_A_A_wa_a_aq_1_axr_U_1_auH_A_WA_3_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 472};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_param_values, __pyx_mstate->__pyx_n_u_param_formats, __pyx_mstate->__pyx_n_u_result_format, __pyx_mstate->__pyx_n_u_cnparams, __pyx_mstate->__pyx_n_u_ctypes, __pyx_mstate->__pyx_n_u_cvalues, __pyx_mstate->__pyx_n_u_clengths, __pyx_mstate->__pyx_n_u_cformats, __pyx_mstate->__pyx_n_u_pgconn_ptr, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_exec_prepared, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_8J_WA_3d_q_e1_j_1HIZq_c_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 504};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_describe_prepared, __pyx_mstate->__pyx_kp_b_iso88591_5Q_44J_q_3c_A_AT1C1_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 513};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_describe_prepared, __pyx_mstate->__pyx_kp_b_iso88591_0_Gq_4q_A_4AT9K1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 521};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_describe_portal, __pyx_mstate->__pyx_kp_b_iso88591_31_44J_Q_3c_A_AT1C1_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 530};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_describe_portal, __pyx_mstate->__pyx_kp_b_iso88591_8_0_EQ_4q_A_4AT9K1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 538};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_pgconn_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_close_prepared, __pyx_mstate->__pyx_kp_b_iso88591_2_A_Q_3d_q_q_c_AQ_3c_A_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 553};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_pgconn_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_close_prepared, __pyx_mstate->__pyx_kp_b_iso88591_7q_0_Q_3d_q_a_1_c_AQ_4q_A_1_6H, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 567};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_pgconn_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_close_portal, __pyx_mstate->__pyx_kp_b_iso88591_0_Q_3d_q_Q_c_AQ_3c_A_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 582};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_pgconn_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_close_portal, __pyx_mstate->__pyx_kp_b_iso88591_5Q_a_Q_3d_q_A_c_AQ_4q_A_1_6H, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 596};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pgresult};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_get_result, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_L_Q_9Cq_1_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 604};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_consume_input, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_oQd_2S_A_4_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 612};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_is_busy, __pyx_mstate->__pyx_kp_b_iso88591_WA_iq_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 634};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_flush, __pyx_mstate->__pyx_kp_b_iso88591_Q_3d_q_4q_c_AQ_3b_A_8_Oq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 646};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_set_single_row_mode, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_a_4q_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 653};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_s};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_set_chunked_rows_mode, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_1D_a_4q_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 661};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_cancel_conn, __pyx_mstate->__pyx_kp_b_iso88591_Q_1_Q_at1_4q_AQ_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 670};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_get_cancel, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_1D_4q_AQ_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 678};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_notifies, __pyx_mstate->__pyx_kp_b_iso88591_A_WA_4q_1_3j_9Cq_1A_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 689};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_cbuffer, __pyx_mstate->__pyx_n_u_length};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_put_copy_data, __pyx_mstate->__pyx_kp_b_iso88591_q_81IQa_Q_nAT_y_Q_3b_A_AT1C1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 702};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_error, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_cerr};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_put_copy_end, __pyx_mstate->__pyx_kp_b_iso88591_6_1A_Q_m1D_a_3b_A_1D0B_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 715};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_async, __pyx_mstate->__pyx_n_u_async, __pyx_mstate->__pyx_n_u_buffer_ptr, __pyx_mstate->__pyx_n_u_nbytes, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_get_copy_data, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_1L_7_a_A_at3EQ_gQ_Q_7_1_81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 731};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fileno, __pyx_mstate->__pyx_n_u_stream};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_trace, __pyx_mstate->__pyx_kp_b_iso88591_HA_3j_1_Qa_q_Q_nA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 738};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flags, __pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_set_trace_flags, __pyx_mstate->__pyx_kp_b_iso88591_Zq_A_Q_Q_nA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 744};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_untrace, __pyx_mstate->__pyx_kp_b_iso88591_Q_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 748};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_passwd, __pyx_mstate->__pyx_n_u_user, __pyx_mstate->__pyx_n_u_algorithm, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_calgo, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_encrypt_password, __pyx_mstate->__pyx_kp_b_iso88591_A_A_2_1_A_Q_Qd_a_4q_A_at3EQ_U_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 768};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_user, __pyx_mstate->__pyx_n_u_passwd, __pyx_mstate->__pyx_n_u_res};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_change_password, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_Q_6_q_S_A_at3EQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 781};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exec_status, __pyx_mstate->__pyx_n_u_exec_status, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_make_empty_result, __pyx_mstate->__pyx_kp_b_iso88591_4A_Q_N_8_4q_Qa_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 803};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_enter_pipeline_mode, __pyx_mstate->__pyx_kp_b_iso88591_Q_0_Q_4q_3c_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 816};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_exit_pipeline_mode, __pyx_mstate->__pyx_kp_b_iso88591_A_q_Q_a_3c_AT_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 829};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_pipeline_sync, __pyx_mstate->__pyx_kp_b_iso88591_q_1_Q_oQd_3c_AQ_3c_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 844};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_flush_request, __pyx_mstate->__pyx_kp_b_iso88591_A_0_Q_a_3c_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) 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[49] = __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[49])) 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[50] = __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[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 33};
    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_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_clear, __pyx_mstate->__pyx_kp_b_iso88591_q_4_gQ_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_encoding};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_get_error_message, __pyx_mstate->__pyx_kp_b_iso88591_A_1D_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 56};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldcode, __pyx_mstate->__pyx_n_u_fieldcode, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_error_field, __pyx_mstate->__pyx_kp_b_iso88591_A_1_6Fa_3gQ_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 71};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_fname, __pyx_mstate->__pyx_kp_b_iso88591_XQd_3gQ_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 78};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_ftable, __pyx_mstate->__pyx_kp_b_iso88591_1_IQd_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, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 81};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_ftablecol, __pyx_mstate->__pyx_kp_b_iso88591_a_L_5Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 84};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_fformat, __pyx_mstate->__pyx_kp_b_iso88591_A_Jat_31, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 87};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_ftype, __pyx_mstate->__pyx_kp_b_iso88591_HAT_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 90};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_fmod, __pyx_mstate->__pyx_kp_b_iso88591_G1D_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 93};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_fsize, __pyx_mstate->__pyx_kp_b_iso88591_HAT_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 100};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row_number, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_crow, __pyx_mstate->__pyx_n_u_ccol, __pyx_mstate->__pyx_n_u_length, __pyx_mstate->__pyx_n_u_v};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_get_value, __pyx_mstate->__pyx_kp_b_iso88591_a_1D0_a_1_5V1_1Ba_L_5V1_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 119};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_param_number, __pyx_mstate->__pyx_n_u_param_number};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_param_type, __pyx_mstate->__pyx_kp_b_iso88591_a_L_5Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 142};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_descriptions, __pyx_mstate->__pyx_n_u_num, __pyx_mstate->__pyx_n_u_attrs, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_descr, __pyx_mstate->__pyx_n_u_res};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_set_attributes, __pyx_mstate->__pyx_kp_b_iso88591_1_c_1_E_aq_L_HE_KuA_L_Q_Je1_IU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) 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[64] = __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[64])) 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[65] = __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[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_kp_b_iso88591_q_9N_4q_A_at3EQ, 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), 32};
    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_psycopg_binary_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_blocking, __pyx_mstate->__pyx_kp_b_iso88591_9_Qd_A_at3EQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 43};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_poll, __pyx_mstate->__pyx_kp_b_iso88591_a_M_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 62};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_encoding};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_get_error_message, __pyx_mstate->__pyx_kp_b_iso88591_A_1D_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 65};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 69};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_finish, __pyx_mstate->__pyx_kp_b_iso88591_4_Q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 74};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_ensure_pgcancelconn, __pyx_mstate->__pyx_kp_b_iso88591_a_4_A_AQ, 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), 1};
    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_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[73])) 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[74] = __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[74])) 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[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_free, __pyx_mstate->__pyx_kp_b_iso88591_a_4_WA_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 97};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_res};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_cancel, __pyx_mstate->__pyx_kp_b_iso88591_IQd_gQ_4q_A_WAXQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) 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[77] = __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[77])) 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[78] = __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[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_opts, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_conninfo_pyx, __pyx_mstate->__pyx_n_u_get_defaults, __pyx_mstate->__pyx_kp_b_iso88591_A_1_5_1_Qa_AQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_errmsg, __pyx_mstate->__pyx_n_u_opts, __pyx_mstate->__pyx_n_u_exc, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_conninfo_pyx, __pyx_mstate->__pyx_n_u_parse, __pyx_mstate->__pyx_kp_b_iso88591_A_A_11A_AQ_5_1_wc_k_a_waxq_q_a_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_conninfo_pyx, __pyx_mstate->__pyx_n_u_repr, __pyx_mstate->__pyx_kp_b_iso88591_A_s_4q_hgQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_escaping_pyx, __pyx_mstate->__pyx_n_u_escape_literal, __pyx_mstate->__pyx_kp_b_iso88591_A_4vS_AQ_4uM_A_AQ_6_q_1D_5_4s_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 37};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_escaping_pyx, __pyx_mstate->__pyx_n_u_escape_identifier, __pyx_mstate->__pyx_kp_b_iso88591_A_6_q_4vS_AQ_4uM_A_AQ_at5_e1_4s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_escaping_pyx, __pyx_mstate->__pyx_n_u_escape_string, __pyx_mstate->__pyx_kp_b_iso88591_A_6_q_4vWA_t5_S_a_hl_7_Bb_a_E_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 90};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_escaping_pyx, __pyx_mstate->__pyx_n_u_escape_bytea, __pyx_mstate->__pyx_kp_b_iso88591_A_4vWE_T_m3a_AQ_6_q_4vWA_E_8_XQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[86] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_binary_pq_escaping_pyx, __pyx_mstate->__pyx_n_u_unescape_bytea, __pyx_mstate->__pyx_kp_b_iso88591_A_4vWA_t5_S_a_7q_aq_4s_Q_3aq_S_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[86])) 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[87] = __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_q_l_vWE_Q_q_t6_q_Qg_q_Qg, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[87])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 17};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[88] = __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_avQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[88])) 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[89] = __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[89])) 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[90] = __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[90])) 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[91] = __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[91])) 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[92] = __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[92])) 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[93] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_Escaping, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_881A_7_nA_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[93])) 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) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 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)

  /* PyFrozenDict.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *builtins = PyEval_GetBuiltins(); // borrowed
      if (likely(builtins)) {
          PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
          if (likely(type_name)) {
              PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
              Py_DECREF(type_name);
              if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
                  PyErr_Clear();
                  frozendict_type = (PyObject*) &PyDict_Type;
                  Py_INCREF(frozendict_type);
              }
              __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
          }
      }
  } // error handling follows
  #endif
  
  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)

  /* 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)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_after_shared_utility ### */

static int __Pyx_InitAfterSharedUtility(void) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  /* CythonFunctionPerModule.init */
  if (likely(__pyx_CyFunction_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

/* FastTypeChecks (used by GivenExceptionMatches) */
#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);
}
#endif

/* PyErrFetchRestore (used by GivenExceptionMatches) */
#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

/* GivenExceptionMatches (used by PyErrExceptionMatches) */
#if CYTHON_COMPILING_IN_CPYTHON
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

/* 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

/* 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;
}

/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
#if 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);
    }
}
#endif

/* TupleOrListFromArrayImpl (used by TupleFromArray) */
#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
CYTHON_UNUSED static PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) {
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    PyObject *res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    #if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    #else
    Py_ssize_t i;
    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;
        }
    }
    #endif
    return res;
}
#endif

/* PyObjectCompare (used by UnicodeEquals) */
#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
    #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
    int result = PyUnicode_Equal(s1, s2);
    #if !CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(result == -1)) return -1;
    #endif
    if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
    #else
    int result = PyUnicode_Compare(s1, s2);
    if (unlikely((result == -1) && PyErr_Occurred())) return -1;
    if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
    #endif
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop) {
    CYTHON_UNUSED_VAR(pyop);
    if (unlikely(op1 == Py_None)) {
        if (op2 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
    }
    if (unlikely(op2 == Py_None)) {
        if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
    }
    
    if (likely(op1 != Py_None)) {
        if (op1 == op2) goto __pyx_return_true;
        if (likely(op2 != Py_None)) {
            return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
        }
        goto __pyx_richcmp;
    }
    
    if ((0)) goto __pyx_richcmp;
    if ((0)) goto __pyx_return_true;
    if ((0)) goto __pyx_return_false;
__pyx_richcmp:
    return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}

/* fastcall */
#if CYTHON_VECTORCALL
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);
        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_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
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

/* IgnoreException (used by GetModuleGlobalName) */
static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
    if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
        PyErr_Clear();
        return 1;
    }
    return 0;
}

/* 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;
    }
    if (!__Pyx_IgnoreException(PyExc_Exception)) {
        return NULL; // BaseException
    }
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
        if (!__Pyx_IgnoreException(PyExc_Exception)) {
            return NULL; // BaseException
        }
    }
    __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);
    }
    PyObject *exc = PyErr_Occurred();
    if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
        return NULL; // BaseException
    }
#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 PyObjectCallOneArg) */
#if 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 || CYTHON_COMPILING_IN_PYPY)
  #if 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 nargsf, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
#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 || CYTHON_COMPILING_IN_PYPY
            return PyObject_Vectorcall(func, args, nargsf, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, nargsf, NULL);
            }
          #endif
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #elif CYTHON_COMPILING_IN_PYPY
    return PyObject_VectorcallDict(func, args, (size_t) nargs, kwargs);
    #else
    return PyObject_VectorcallDict(func, args, nargsf, kwargs);
    #endif
}

/* PyObjectCallOneArg */
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);
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind) {
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH && CYTHON_USE_UNICODE_INTERNALS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    static const Py_UCS4 max_char[5] = {0x7fU, 0xffU, 0xffffU, 0xffffU, 0x10ffffU};
    assert (kind >= 0);
    if (kind > PyUnicode_4BYTE_KIND) kind = PyUnicode_4BYTE_KIND;
    result_uval = PyUnicode_New(result_ulength, max_char[kind]);
    if (unlikely(!result_uval)) return NULL;
    kind_shift = kind >> 1;  // 0, 1, 2
    result_ukind = 1 << kind_shift;  // 1, 2, 4
    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 (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        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(kind);
    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
}

/* 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;
}

/* 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);
}

/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
#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;
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return PyObject_Vectorcall(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);
    } 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 && !__Pyx_IgnoreException(PyExc_AttributeError)) {
            return -1;
        }
#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_VECTORCALL && 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);
    }
}

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
        case 1:
            return PyObject_CallMethodObjArgs(args[0], name, NULL);
        case 2:
            return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
        case 3:
            return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
        case 4:
            return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
        case 5:
            return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
    }
    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

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)0;
    CYTHON_UNUSED_VAR(clineno);
    CYTHON_UNUSED_VAR(lineno);
    CYTHON_UNUSED_VAR(filename);
    CYTHON_MAYBE_UNUSED_VAR(nogil);
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(0);
    }
    ctx = PyUnicode_FromString(name);
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
    if (nogil)
        PyGILState_Release(state);
}

/* PyObjectFormat */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
    int ret;
    _PyUnicodeWriter writer;
    if (likely(PyFloat_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyLong_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else {
        return PyObject_Format(obj, format_spec);
    }
    if (unlikely(ret == -1)) {
        _PyUnicodeWriter_Dealloc(&writer);
        return NULL;
    }
    return _PyUnicodeWriter_Finish(&writer);
}
#endif

/* FormatTypeName (used by pybuiltin_invalid) */
#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__5);
    }
    goto done;
}
#endif

/* pybuiltin_invalid (used by pyint_simplify) */
static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *builtin_type_name, const char *argname) {
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!obj_type_name)) return;
    #endif
    if (argname) {
        PyErr_Format(PyExc_TypeError,
            "Argument '%.200s' has incorrect type (expected %.5s, got " __Pyx_FMT_TYPENAME ")",
            argname, builtin_type_name, obj_type_name
        );
    } else {
        PyErr_Format(PyExc_TypeError,
            "Expected %.5s, got " __Pyx_FMT_TYPENAME,
            builtin_type_name, obj_type_name
        );
    }
    __Pyx_DECREF_TypeName(obj_type_name);
}

/* pyint_simplify */
static int __Pyx__PyInt_FromNumber(PyObject **number_var, const char *argname);
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;
    }
    return __Pyx__PyInt_FromNumber(number_var, argname);
}
static int __Pyx__PyInt_FromNumber(PyObject **number_var, const char *argname) {
    PyObject *number = *number_var;
    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;
}

/* 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);
    #if CYTHON_AVOID_BORROWED_REFS
    while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
    #else
    (void) __Pyx_PyDict_NextRef;
    while (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_VECTORCALL && 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);
}

/* ArgTypeTestError (used by ArgTypeTest) */
static void __Pyx_ArgTypeError(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;
    } 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);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!type_name)) return;
    #endif
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!obj_type_name)) goto obj_type_name_failed;
    #endif
    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(obj_type_name);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
obj_type_name_failed:
#endif
    __Pyx_DECREF_TypeName(type_name);
    return;
}

/* ArgTypeTest */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) {
    if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
        return 1;
    if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    __Pyx_ArgTypeError(obj, type, name, exact);
    return 0;
}

/* RaiseErrorWithObjectType1 (used by RaiseUnexpectedTypeError) */
static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!type_name)) return;
    #endif
    PyErr_Format(exc_type, message, arg, type_name);
    __Pyx_DECREF_TypeName(type_name);
}

/* RaiseUnexpectedTypeError */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) {
    __Pyx_RaiseTypeErrorWithObjectType1(
        "Expected %.42s, got " __Pyx_FMT_TYPENAME,
        expected, obj);
    return 0;
}

/* RaiseUnboundLocalError */
static void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* PyObjectCompare */
#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolNe
#define __Pyx_DEFINED_PyObject_CompareStrStrBoolNe
static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolNe(PyObject* s1, PyObject* s2) {
    #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
    int result = PyUnicode_Equal(s1, s2);
    #if !CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(result == -1)) return -1;
    #endif
    if (result != 0) goto __pyx_return_false; else goto __pyx_return_true;
    #else
    int result = PyUnicode_Compare(s1, s2);
    if (unlikely((result == -1) && PyErr_Occurred())) return -1;
    if (result != 0) goto __pyx_return_true; else goto __pyx_return_false;
    #endif
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
static CYTHON_INLINE int __Pyx_PyObject_CompareBoolNe_object_str(PyObject *op1, PyObject *op2, int pyop) {
    CYTHON_UNUSED_VAR(pyop);
    if (unlikely(op2 == Py_None)) {
        if (op1 == Py_None) goto __pyx_return_false; else goto __pyx_richcmp;
    }
    if (PyFloat_CheckExact(op1)) {
        goto __pyx_richcmp;
    }
    if (PyLong_CheckExact(op1)) {
        if (op1 == op2) goto __pyx_return_false;
        goto __pyx_richcmp;
    }
    
    if (likely(PyUnicode_CheckExact(op1))) {
        if (op1 == op2) goto __pyx_return_false;
        if (likely(op2 != Py_None)) {
            return __Pyx_PyObject_CompareStrStrBoolNe(op1, op2);
        }
        goto __pyx_richcmp;
    }
    
    if ((0)) goto __pyx_richcmp;
    if ((0)) goto __pyx_return_true;
    if ((0)) goto __pyx_return_false;
__pyx_richcmp:
    return __Pyx_PyObject_RichCompareBool(op1, op2, Py_NE);
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}

/* PyObjectCompare */
#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolNe
#define __Pyx_DEFINED_PyObject_CompareStrStrBoolNe
static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolNe(PyObject* s1, PyObject* s2) {
    #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
    int result = PyUnicode_Equal(s1, s2);
    #if !CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(result == -1)) return -1;
    #endif
    if (result != 0) goto __pyx_return_false; else goto __pyx_return_true;
    #else
    int result = PyUnicode_Compare(s1, s2);
    if (unlikely((result == -1) && PyErr_Occurred())) return -1;
    if (result != 0) goto __pyx_return_true; else goto __pyx_return_false;
    #endif
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolNe
#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolNe
static CYTHON_INLINE int __Pyx_PyObject_ComparePyBytesPyBytesBoolNe(PyObject* s1, PyObject* s2) {
    #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
    const char *ps1, *ps2;
    Py_ssize_t length = PyBytes_GET_SIZE(s1);
    if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_true;
    ps1 = PyBytes_AS_STRING(s1);
    ps2 = PyBytes_AS_STRING(s2);
    #else
    char *ps1, *ps2;
    Py_ssize_t length, length2;
    if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length) == -1)) return -1;
    if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return -1;
    if (length != length2) goto __pyx_return_true;
    #endif
    if (ps1[0] != ps2[0]) goto __pyx_return_true;
    if (length == 1) goto __pyx_return_false;
    {
        int cmp;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
        Py_hash_t hash1 = ((PyBytesObject*)s1)->ob_shash;
        Py_hash_t hash2 = ((PyBytesObject*)s2)->ob_shash;
        if (hash1 != hash2 && hash1 != -1 && hash2 != -1) goto __pyx_return_true;
#endif
        cmp = memcmp(ps1, ps2, (size_t)length);
        if (cmp != 0) goto __pyx_return_true; else goto __pyx_return_false;
    }
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
#endif
#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolNe
#define __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolNe
static CYTHON_INLINE int __Pyx_PyObject_ComparePyBytesPyByteArrayBoolNe(PyObject* s1, PyObject* s2) {
    #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
    const char *ps1, *ps2;
    Py_ssize_t length = PyBytes_GET_SIZE(s1);
    if (length != PyByteArray_GET_SIZE(s2)) goto __pyx_return_true;
    ps1 = PyBytes_AS_STRING(s1);
    ps2 = PyByteArray_AS_STRING(s2);
    #else
    char *ps1, *ps2;
    Py_ssize_t length, length2;
    if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length) == -1)) return -1;
    ps2 = __Pyx_PyByteArray_AsString(s2); if (unlikely(!ps2)) return -1;
    length2 = __Pyx_PyByteArray_GET_SIZE(s2); if (unlikely(length2 == -1)) return -1;
    if (length != length2) goto __pyx_return_true;
    #endif
    if (ps1[0] != ps2[0]) goto __pyx_return_true;
    if (length == 1) goto __pyx_return_false;
    {
        int cmp;
        cmp = memcmp(ps1, ps2, (size_t)length);
        if (cmp != 0) goto __pyx_return_true; else goto __pyx_return_false;
    }
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
#endif
#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolNe
#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolNe
static CYTHON_INLINE int __Pyx_PyObject_ComparePyByteArrayPyBytesBoolNe(PyObject* s1, PyObject* s2) {
    #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
    const char *ps1, *ps2;
    Py_ssize_t length = PyByteArray_GET_SIZE(s1);
    if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_true;
    ps1 = PyByteArray_AS_STRING(s1);
    ps2 = PyBytes_AS_STRING(s2);
    #else
    char *ps1, *ps2;
    Py_ssize_t length, length2;
    ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return -1;
    length = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length == -1)) return -1;
    if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return -1;
    if (length != length2) goto __pyx_return_true;
    #endif
    if (length == 0) goto __pyx_return_false;
    if (ps1[0] != ps2[0]) goto __pyx_return_true;
    if (length == 1) goto __pyx_return_false;
    {
        int cmp;
        cmp = memcmp(ps1, ps2, (size_t)length);
        if (cmp != 0) goto __pyx_return_true; else goto __pyx_return_false;
    }
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
#endif
#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolNe
#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolNe
static CYTHON_INLINE int __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolNe(PyObject* s1, PyObject* s2) {
    #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
    const char *ps1, *ps2;
    Py_ssize_t length = PyByteArray_GET_SIZE(s1);
    if (length != PyByteArray_GET_SIZE(s2)) goto __pyx_return_true;
    ps1 = PyByteArray_AS_STRING(s1);
    ps2 = PyByteArray_AS_STRING(s2);
    #else
    char *ps1, *ps2;
    Py_ssize_t length, length2;
    ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return -1;
    length = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length == -1)) return -1;
    ps2 = __Pyx_PyByteArray_AsString(s2); if (unlikely(!ps2)) return -1;
    length2 = __Pyx_PyByteArray_GET_SIZE(s2); if (unlikely(length2 == -1)) return -1;
    if (length != length2) goto __pyx_return_true;
    #endif
    if (length == 0) goto __pyx_return_false;
    if (ps1[0] != ps2[0]) goto __pyx_return_true;
    if (length == 1) goto __pyx_return_false;
    {
        int cmp;
        cmp = memcmp(ps1, ps2, (size_t)length);
        if (cmp != 0) goto __pyx_return_true; else goto __pyx_return_false;
    }
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
#endif
#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolNe
#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolNe
static int __Pyx_PyObject_CompareFloatIntBoolNe(PyObject *op1, PyObject *op2) {
    double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsCompact(op2)) {
        Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
        if (float_op1 != ((double)iop2)) goto __pyx_return_true; else goto __pyx_return_false;
    }
    if (unlikely(!isfinite(float_op1))) {
        if (float_op1 != 0.0) goto __pyx_return_true; else goto __pyx_return_false;
    } else {
        int sign2 = __Pyx_PyLong_Sign(op2);
        if (float_op1 >= 0.) {
            if (sign2 < 0) goto __pyx_return_true;
            if (float_op1 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
        } else {
            if (sign2 > 0) goto __pyx_return_true;
            if (float_op1 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
        }
    }
    #else
    if (unlikely(!isfinite(float_op1))) {
        if (float_op1 != 0.0) goto __pyx_return_true; else goto __pyx_return_false;
    } else {
        int overflow2;
        long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
        if (likely(!overflow2)) {
            if ((long long) iop2 >= (1LL << 53)) {
                overflow2 = 1;
            } else if ((long long) iop2 <= - (1LL << 53)) {
                overflow2 = -1;
            } else {
                if (float_op1 != ((double) iop2)) goto __pyx_return_true; else goto __pyx_return_false;
            }
        }
        if (overflow2 > 0) {
            if (float_op1 < ((double) (1LL << 53))) goto __pyx_return_true;
        } else {
            if (float_op1 > - ((double) (1LL << 53))) goto __pyx_return_true;
        }
    }
    #endif
    return __Pyx_PyObject_RichCompareBool(op1, op2, Py_NE);
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
#ifndef __Pyx_DEFINED_PyObject_CompareIntFloatBoolNe
#define __Pyx_DEFINED_PyObject_CompareIntFloatBoolNe
static int __Pyx_PyObject_CompareIntFloatBoolNe(PyObject *op1, PyObject *op2) {
    double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsCompact(op1)) {
        Py_ssize_t iop1 = __Pyx_PyLong_CompactValue(op1);
        if (((double)iop1) != float_op2) goto __pyx_return_true; else goto __pyx_return_false;
    }
    if (unlikely(!isfinite(float_op2))) {
        if (0.0 != float_op2) goto __pyx_return_true; else goto __pyx_return_false;
    } else {
        int sign1 = __Pyx_PyLong_Sign(op1);
        if (float_op2 >= 0.) {
            if (sign1 < 0) goto __pyx_return_true;
            if (float_op2 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
        } else {
            if (sign1 > 0) goto __pyx_return_true;
            if (float_op2 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
        }
    }
    #else
    if (unlikely(!isfinite(float_op2))) {
        if (0.0 != float_op2) goto __pyx_return_true; else goto __pyx_return_false;
    } else {
        int overflow1;
        long iop1 = PyLong_AsLongAndOverflow(op1, &overflow1);
        if (likely(!overflow1)) {
            if ((long long) iop1 >= (1LL << 53)) {
                overflow1 = 1;
            } else if ((long long) iop1 <= - (1LL << 53)) {
                overflow1 = -1;
            } else {
                if (((double) iop1) != float_op2) goto __pyx_return_true; else goto __pyx_return_false;
            }
        }
        if (overflow1 < 0) {
            if (float_op2 > ((double) (1LL << 53))) goto __pyx_return_true;
        } else {
            if (float_op2 < - ((double) (1LL << 53))) goto __pyx_return_true;
        }
    }
    #endif
    return __Pyx_PyObject_RichCompareBool(op1, op2, Py_NE);
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolNe
#define __Pyx_DEFINED_PyObject_CompareIntIntBoolNe
static int __Pyx_PyObject_CompareIntIntBoolNe(PyObject *op1, PyObject *op2) {
#if CYTHON_USE_PYLONG_INTERNALS
    Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
    if (cmp == 0) {
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        if (size > 0) {
            const digit* digits1 = __Pyx_PyLong_Digits(op1);
            const digit* digits2 = __Pyx_PyLong_Digits(op2);
            if (size == 1) {
                cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
            } else if ((size == 2) && (8 * sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
                cmp = (Py_ssize_t) (((((size_t)digits1[1]) << PyLong_SHIFT) | (size_t)digits1[0])) - (Py_ssize_t) (((((size_t)digits2[1]) << PyLong_SHIFT) | (size_t)digits2[0]));
            } else {
                for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
                    cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
                }
            }
        }
        if (cmp == 0) goto __pyx_return_false;
        if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
    }
    goto __pyx_return_true;
#else
    int overflow1, overflow2;
    long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
    long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
    if (likely(!(overflow1 | overflow2))) {
        if (iop1 != iop2) goto __pyx_return_true; else goto __pyx_return_false;
    } else if (overflow1 != overflow2) {
        if (overflow1 != overflow2) goto __pyx_return_true; else goto __pyx_return_false;
    } else {
        return __Pyx_PyObject_RichCompareBool(op1, op2, Py_NE);
    }
#endif
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}
#endif
static CYTHON_INLINE int __Pyx_PyObject_CompareBoolNe_object_object(PyObject *op1, PyObject *op2, int pyop) {
    CYTHON_UNUSED_VAR(pyop);
    if (PyFloat_CheckExact(op1)) {
        if (PyFloat_CheckExact(op2)) {
            double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
            #endif
            double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
            #endif
            if (float_op1 != float_op2) goto __pyx_return_true; else goto __pyx_return_false;
        }
        if (PyLong_CheckExact(op2)) {
            return __Pyx_PyObject_CompareFloatIntBoolNe(op1, op2);
        }
        goto __pyx_richcmp;
    }
    if (PyLong_CheckExact(op1)) {
        if (op1 == op2) goto __pyx_return_false;
        if (PyLong_CheckExact(op2)) {
            return __Pyx_PyObject_CompareIntIntBoolNe(op1, op2);
        }
        if (PyFloat_CheckExact(op2)) {
            return __Pyx_PyObject_CompareIntFloatBoolNe(op1, op2);
        }
        goto __pyx_richcmp;
    }
    
    if (PyUnicode_CheckExact(op1)) {
        if (op1 == op2) goto __pyx_return_false;
        if (PyUnicode_CheckExact(op2)) {
            return __Pyx_PyObject_CompareStrStrBoolNe(op1, op2);
        }
        goto __pyx_richcmp;
    }
    
    #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
    if (PyBytes_CheckExact(op1)) {
        if (op1 == op2) goto __pyx_return_false;
        if (PyBytes_CheckExact(op2)) {
            return __Pyx_PyObject_ComparePyBytesPyBytesBoolNe(op1, op2);
        }
        if (PyByteArray_CheckExact(op2)) {
            return __Pyx_PyObject_ComparePyBytesPyByteArrayBoolNe(op1, op2);
        }
        goto __pyx_richcmp;
    }
    #endif
    #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
    if (PyByteArray_CheckExact(op1)) {
        if (op1 == op2) goto __pyx_return_false;
        if (PyByteArray_CheckExact(op2)) {
            return __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolNe(op1, op2);
        }
        if (PyBytes_CheckExact(op2)) {
            return __Pyx_PyObject_ComparePyByteArrayPyBytesBoolNe(op1, op2);
        }
        goto __pyx_richcmp;
    }
    #endif
    if ((0)) goto __pyx_richcmp;
    if ((0)) goto __pyx_return_true;
    if ((0)) goto __pyx_return_false;
__pyx_richcmp:
    return __Pyx_PyObject_RichCompareBool(op1, op2, Py_NE);
__pyx_return_true:
    return 1;
__pyx_return_false:
    return 0;
}

/* RaiseErrorWithObjectTypes (used by ExtTypeTest) */
static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
    __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!type_name1)) return;
    #endif
    __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!type_name2)) goto type2_failed;
    #endif
    PyErr_Format(exc_type, message, arg, type_name1, type_name2);
    __Pyx_DECREF_TypeName(type_name2);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
type2_failed:
#endif
    __Pyx_DECREF_TypeName(type_name1);
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    __Pyx_RaiseTypeErrorWithTypes(
        "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
        Py_TYPE(obj), type);
    return 0;
}

/* 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
}

/* 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

/* 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_Py_ssize_t(Py_ssize_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 Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_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 & ~ (Py_ssize_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_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(Py_ssize_t)*3+2];
    char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    Py_ssize_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_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 = (Py_ssize_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 = (Py_ssize_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 = (Py_ssize_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);
}

/* PyFrozenDict (used by GetItemInt) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
    return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
}
#endif

/* GettItemInt_wraparound (used by GetItemInt) */
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
    assert(*i < 0);
    if (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 -1;
            PyErr_Clear();
        }
    }
    return 0;
}
#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 PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}
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_AVOID_BORROWED_REFS
    CYTHON_UNUSED_VAR(boundscheck);
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(size < 0)) return NULL;
        #endif
        wrapped_i += size;
    }
    return __Pyx_PyList_GetItemRef(o, wrapped_i);
#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
    Py_ssize_t wrapped_i = i;
    Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += size;
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
        return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
    }
    return __Pyx_GetItemInt_Generic_size(o, 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_AVOID_BORROWED_REFS
    CYTHON_UNUSED_VAR(boundscheck);
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(size < 0)) return NULL;
        #endif
        wrapped_i += size;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
    return PySequence_ITEM(o, wrapped_i);
    #else
    if (unlikely(wrapped_i < 0)) {
        PyErr_SetString(PyExc_IndexError, "tuple index out of range");
        return NULL;
    }
    return PySequence_GetItem(o, wrapped_i);
    #endif
#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
    Py_ssize_t wrapped_i = i;
    Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += size;
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
        return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic_size(o, i);
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
    PyObject *r, *key = PyLong_FromSsize_t(i);
    if (unlikely(!key)) return NULL;
    r = getitem(o, key);
    Py_DECREF(key);
    return r;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_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
    if (PyList_CheckExact(o)) {
        return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
    } else
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (PyTuple_CheckExact(o)) {
        return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
    } else
    #endif
#else
    if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
        return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
    } else
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    if (PyDict_CheckExact(o)) {
        return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
    #if defined(PyFrozenDict_CheckExact)
    } else if (PyFrozenDict_CheckExact(o)) {
        return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
    #endif
    } else
    {
        PyTypeObject *obj_type = Py_TYPE(o);
        int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
        if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
            PyMappingMethods *mm = obj_type->tp_as_mapping;
            if (mm && mm->mp_subscript)
                return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
        }
        PySequenceMethods *sm = obj_type->tp_as_sequence;
        if (likely(sm && sm->sq_item)) {
            if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
                return NULL;
            return sm->sq_item(o, i);
        }
        if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
            PyMappingMethods *mm = obj_type->tp_as_mapping;
            if (likely(mm && mm->mp_subscript))
                return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
        }
    }
#else
    if (!PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_GetItemInt_Generic_size(o, i);
}

/* decode_c_string */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, 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)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        size_t slen = strlen(cstring);
        if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
            PyErr_SetString(PyExc_OverflowError,
                            "c-string too long to convert to Python");
            return NULL;
        }
        length = (Py_ssize_t) slen;
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            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);
    }
}

/* ListAppendAndDecrefInternal (used by ListAppend) */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
static CYTHON_INLINE void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
    PyList_SET_ITEM(list, len, x);
    Py_SET_SIZE(list, len + 1);
}
#endif

/* ListAppend */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
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);
        __Pyx__ListComp_AppendAndDecref(list, len, x);
        return 0;
    }
    return PyList_Append(list, x);
}
#endif

/* PyObjectVectorcallKwds */
#if CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
    PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
#if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!key)) return -1;
#endif
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return 0;
}
#else
CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n) {
    PyObject *out = PyDict_New();
    if (unlikely(!out)) return NULL;
    for (Py_ssize_t i=0; i<n; ++i) {
        if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
            Py_DECREF(out);
            return NULL;
        }
    }
    return out;
}
CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
    PyObject *key = kwnames[i];
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return 0;
}
#endif

/* 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
}

/* 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);
    }
}

/* CallSlotAsVectorcallUnpackDict (used by CallSlotAsVectorcall) */
static CYTHON_INLINE int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
    Py_ssize_t pos = 0, i = 0;
    PyObject *key, *value;
    while (PyDict_Next(keys_dict, &pos, &key, &value)) {
        Py_INCREF(value);
        args[args_size+i] = value;
        Py_INCREF(key);
        if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
            return -1;
        }
        ++i;
    }
    return 0;
}

/* CallSlotAsVectorcall */
#if CYTHON_VECTORCALL_TPNEW
static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k) {
    Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
#if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(k_size < 0)) return NULL;
#endif
    Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
#if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(a_size < 0)) return NULL;
#endif
#if CYTHON_ASSUME_SAFE_MACROS
    if (k_size == 0) {
        return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
    }
#else
    if (k_size == 0 && a_size == 0) {
        return f(o, NULL, 0, NULL);
    }
#endif
    PyObject *stack_args[5];
    PyObject **args = stack_args;
    Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
    if (a_size > maxnargs - k_size) {
        PyErr_NoMemory();
        return NULL;
    }
    Py_ssize_t total_size = a_size + k_size;
    if (total_size > 5) {
        args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
        if (unlikely(!args)) {
            PyErr_NoMemory();
            return NULL;
        }
    }
    PyObject * result = NULL;
    PyObject *kwnames = NULL;
    int unpack_dict_result;
    Py_ssize_t i = 0;
    for (; i < a_size; ++i) {
        args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!args[i])) goto cleanup;
#endif
    }
#if !CYTHON_ASSUME_SAFE_MACROS
    if (k)  // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
#endif
    {
        kwnames = PyTuple_New(k_size);
        if (unlikely(!kwnames)) goto cleanup;
        __Pyx_BEGIN_CRITICAL_SECTION(k);
        unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
        __Pyx_END_CRITICAL_SECTION();
        if (unlikely(unpack_dict_result == -1)) goto cleanup;
    }
    result = f(o, args, a_size, kwnames);
  cleanup:
    Py_XDECREF(kwnames);
    for (i=a_size; i<total_size; ++i) {
        Py_XDECREF(args[i]);
    }
    if (args != stack_args) {
        PyMem_Free(args);
    }
    return result;
}
#endif

/* RaiseErrorWithObjectType (used by CallNewInitFromVectorcall) */
static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!type_name)) return;
    #endif
    PyErr_Format(exc_type, message, type_name);
    __Pyx_DECREF_TypeName(type_name);
}

/* CallNewInitFromVectorcall */
#if CYTHON_VECTORCALL_TPNEW
static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
    if (unlikely(!tp_new)) {
        __Pyx_RaiseErrorWithType(PyExc_TypeError, "cannot create " __Pyx_FMT_TYPENAME " instances", t);
        return NULL;
    }
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
    PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
    Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
#if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    if (kw_size) {
        kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
        if (unlikely(!kwds_dict)) {
            return NULL;
        }
        for (Py_ssize_t i=0; i<kw_size; ++i) {
            PyObject *v = args[nargs + i];
            PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
#if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely(!k)) {
                goto end;
            }
#endif
            if (unlikely(PyDict_SetItem(kwds_dict, k, v) < 0)) {
                goto end;
            }
        }
    }
    if (nargs) {
        args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
        if (unlikely(!args_tuple)) {
            goto end;
        }
    } else {
        args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    result = tp_new(t, args_tuple, kwds_dict);
    if (unlikely(!result)) {
        goto end;
    }
    if (PyObject_TypeCheck(result, t)) {
        initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
        if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
            Py_CLEAR(result);
        }
    }
  end:
    Py_XDECREF(args_tuple);
    Py_XDECREF(kwds_dict);
    return result;
}
#endif

/* CallTypeTraverse */
#if !CYTHON_USE_TYPE_SPECS
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    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

/* CallSlotAsVectorcall */
#if CYTHON_VECTORCALL_TPNEW
static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k) {
    Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
#if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(k_size < 0)) return -1;
#endif
    Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
#if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(a_size < 0)) return -1;
#endif
#if CYTHON_ASSUME_SAFE_MACROS
    if (k_size == 0) {
        return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
    }
#else
    if (k_size == 0 && a_size == 0) {
        return f(o, NULL, 0, NULL);
    }
#endif
    PyObject *stack_args[5];
    PyObject **args = stack_args;
    Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
    if (a_size > maxnargs - k_size) {
        PyErr_NoMemory();
        return -1;
    }
    Py_ssize_t total_size = a_size + k_size;
    if (total_size > 5) {
        args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
        if (unlikely(!args)) {
            PyErr_NoMemory();
            return -1;
        }
    }
    int result = -1;
    PyObject *kwnames = NULL;
    int unpack_dict_result;
    Py_ssize_t i = 0;
    for (; i < a_size; ++i) {
        args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!args[i])) goto cleanup;
#endif
    }
#if !CYTHON_ASSUME_SAFE_MACROS
    if (k)  // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
#endif
    {
        kwnames = PyTuple_New(k_size);
        if (unlikely(!kwnames)) goto cleanup;
        __Pyx_BEGIN_CRITICAL_SECTION(k);
        unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
        __Pyx_END_CRITICAL_SECTION();
        if (unlikely(unpack_dict_result == -1)) goto cleanup;
    }
    result = f(o, args, a_size, kwnames);
  cleanup:
    Py_XDECREF(kwnames);
    for (i=a_size; i<total_size; ++i) {
        Py_XDECREF(args[i]);
    }
    if (args != stack_args) {
        PyMem_Free(args);
    }
    return result;
}
#endif

/* FunctionExport */
static int __Pyx_ExportFunction(PyObject *api_dict, const char *name, void (*f)(void), const char *sig) {
    PyObject *cobj;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    tmp.fp = f;
    cobj = PyCapsule_New(tmp.p, sig, 0);
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(api_dict, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    return 0;
bad:
    Py_XDECREF(cobj);
    return -1;
}

/* GetApiDict */
static PyObject *__Pyx_ApiExport_GetApiDict(void) {
    PyObject *d;
    if (__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_capi, &d) == -1)
        return NULL;
    if (!d) {
        d = PyDict_New();
        if (!d)
            goto bad;
        if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_pyx_capi, d) < 0)
            goto bad;
    }
    return d;
bad:
    Py_XDECREF(d);
    return NULL;
}

/* PyObjectCallMethod0 (used by PyType_Ready) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
    return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_CallMethodObjArgs(obj, method_name, NULL);
#else
    return PyObject_CallMethodNoArgs(obj, method_name);
#endif
}

/* GetTypeDictOffset (used by ValidateBasesTuple) */
#if !CYTHON_USE_TYPE_SLOTS
CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString(tp, "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
#endif

/* 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, int has_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
    if (!has_dictoffset) {
        PyObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        b = PySequence_GetItem(bases, 0);
        if (!b) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        b = PyTuple_GET_ITEM(bases, 0);
#else
        b = PyTuple_GetItem(bases, 0);
        if (!b) return -1;
#endif
#if CYTHON_USE_TYPE_SLOTS
        has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
#else
        Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
        has_dictoffset = dictoffset != 0;
#endif
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b);
#endif
#if !CYTHON_USE_TYPE_SLOTS
        if (dictoffset == -1 && PyErr_Occurred()) 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_RaiseErrorWithType(
                PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (!has_dictoffset)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                __Pyx_RaiseErrorWithType1(
                    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);
#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
    (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 != 0, bases) == -1))
        return -1;
    {
        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
        r = PyType_Ready(t);
        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
    }
    return r;
#endif
}

/* GetVTable (used by MergeVTables) */
static int __Pyx_GetVtable(PyTypeObject *type, void** table) {
    void* ptr;
    *table = NULL;
#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 no_attr;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    *table = ptr;
    return 1;
no_attr:
    if (PyErr_ExceptionMatches(CYTHON_COMPILING_IN_LIMITED_API ? PyExc_AttributeError : PyExc_KeyError)) {
        return 0;
    }
    Py_XDECREF(ob);
    return -1;
}

/* MergeVTables (used by SetVTable) */
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i=0;
    Py_ssize_t size;
    void** base_vtables;
    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_TryGetSlot(base, tp_base, PyTypeObject*);
        }
    }
    base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
    if (unlikely(!base_vtables)) {
        PyErr_NoMemory();
        return -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
        int get_vtable_result = __Pyx_GetVtable((PyTypeObject*)basei, &base_vtable);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
        if (get_vtable_result != 1) {
            if (get_vtable_result == -1) {
                goto other_failure;
            }
            PyErr_Clear(); // Class doesn't have a vtable.
        } else {
            assert(base_vtable != NULL);
            int j;
            PyTypeObject* base = __Pyx_PyType_TryGetSlot(type, tp_base, PyTypeObject*);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
            if (!base) goto bad;
#endif
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    switch (__Pyx_GetVtable(base, &base_vtables[j])) {
                        case 1:
                            assert(base_vtables[j] == NULL);
                            break;
                        case 0:
                            goto bad;
                        case -1:
                        default:
                            goto other_failure;
                    }
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                }
                base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
                if (!base) goto bad;
#endif
            }
        }
    }
    PyMem_Free(base_vtables);
    return 0;
bad:
    {
        PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        PyTypeObject* basei;
#if CYTHON_AVOID_BORROWED_REFS
        basei = (PyTypeObject*)PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#else
        basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
#endif
    __Pyx_RaiseTypeErrorWithTypes(
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base, basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
    }
other_failure:
    PyMem_Free(base_vtables);
    return -1;
}

/* 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 __Pyx_MergeVtables(type);
bad:
    Py_XDECREF(ob);
    return -1;
}

/* LimitedApiGetTypeTypeDict (used by DelItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)(&PyType_Type), 1);
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* 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_GetTypeTypeDict(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;
}

/* SetItemOnTypeDict (used by SetupReduce) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeTypeDict(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;
}

/* 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) && __Pyx_IgnoreException(PyExc_Exception)) {
      ret = 0;  // But BaseException is still propagated.
  }
  Py_XDECREF(name_attr);
  return ret;
}
static PyObject *__Pyx_setup_reduce_get_reduce_attribute(PyObject *type_obj, PyObject *name, int allow_not_present) {
#if CYTHON_USE_PYTYPE_LOOKUP
    CYTHON_UNUSED_VAR(allow_not_present);
    return _PyType_Lookup((PyTypeObject*)type_obj, name);
#else
    if (allow_not_present) {
        return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
    } else {
        return __Pyx_PyObject_GetAttrStr(type_obj, name);
    }
#endif
}
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;
    getstate = __Pyx_setup_reduce_get_reduce_attribute(type_obj, __pyx_mstate_global->__pyx_n_u_getstate, 1);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
    if (getstate) {
        object_getstate = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate, 1);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
    object_reduce_ex = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex, 0);
    if (unlikely(!object_reduce_ex)) goto __PYX_BAD;
    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) {
        object_reduce = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce, 0);
        if (!object_reduce) goto __PYX_BAD;
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        int try_to_replace_reduce = (reduce == object_reduce);
        if (!try_to_replace_reduce) {
            try_to_replace_reduce = __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (unlikely(try_to_replace_reduce < 0)) {
                goto __PYX_BAD;
            }
        }
        if (try_to_replace_reduce) {
            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);
            int try_to_replace_setstate;
            if (!setstate) {
                PyObject *exc = PyErr_Occurred();
                if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
                    goto __PYX_BAD;
                }
                try_to_replace_setstate = 1;
            } else {
                try_to_replace_setstate = __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (unlikely(try_to_replace_setstate < 0)) {
                    goto __PYX_BAD;
                }
            }
            if (try_to_replace_setstate) {
                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_RaiseErrorWithType(
            PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
            (PyTypeObject*)type_obj);
    }
    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_3_0
#define __PYX_HAVE_RT_ImportType_3_3_0
static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 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_3_0 &&
            ((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_3_0 && (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

/* 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

/* TupleOrListFromArrayImpl (used by ListFromArray) */
CYTHON_UNUSED static PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) {
    PyObject *res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    #if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    #else
    Py_ssize_t i;
    for (i = 0; i < n; i++) {
        Py_INCREF(src[i]);
        if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
    }
    #endif
    return res;
}

/* 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;
    }
    #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
    empty_dict = PyFrozenDict_New(NULL);
    #else
    empty_dict = PyDict_New();
    #endif
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
    }
    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);
}

/* 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_);
        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;
}

/* 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;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
  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) {
      if ((PY_VERSION_HEX >= 0x030E0000) &&  Py_Version >= 0x030E0100) {
          return PyImport_AddModuleRef(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
  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);
}

/* VerifyCachedType (used by FetchCommonType) */
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 && CYTHON_OPAQUE_OBJECTS
    if (expected_basicsize < 0) {
        basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
    } else
#endif
    {
    #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 ((expected_basicsize >= 0) ?
            (basicsize != expected_basicsize) :
            (basicsize < -expected_basicsize)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}

/* 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);
        Py_SET_TYPE(result, metaclass);
        Py_DECREF(old_tp);
        PyType_Modified((PyTypeObject*)result);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
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;
    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 CythonFunctionShared) */
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;
}

/* CythonFunctionPerModule (used by CythonFunctionShared) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    if (__Pyx_CyFunction_Check(func)) {
        return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (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 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 CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = __Pyx_as_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_as_CyFunctionObject(func);
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* 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_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) */
static PyObject *
__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        const char *doc = op->func_methoddef->ml_doc;
#else
        const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
#endif
        if (doc) {
            op->func_doc = PyUnicode_FromString(doc);
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static PyObject *
__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
    PyObject *result;
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
{
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __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
        const char *name = op->func_methoddef->ml_name;
#else
        const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
#endif
        op->func_name = PyUnicode_InternFromString(name);
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static PyObject *
__Pyx_CyFunction_get_name(PyObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(PyObject *op_in, 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;
    }
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
{
    CYTHON_UNUSED_VAR(context);
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(PyObject *op_in, 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;
    }
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __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(PyObject *op_in, void *context)
{
    CYTHON_UNUSED_VAR(context);
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(PyObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
{
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    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, PyObject *op_obj) {
    int result = 0;
    PyObject *res = op->defaults_getter(op_obj);
    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(PyObject *op_in, PyObject* value, void *context) {
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    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_in);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(PyObject *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(PyObject *op_in, PyObject* value, void *context) {
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    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_in);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(PyObject *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(PyObject *op_in, 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;
    }
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    Py_XINCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, 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_as_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;
    if (value) {
        return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
    } else {
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
        return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
#else
        int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
        if (result == 1) {
            result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
        }
        return result;
#endif
    }
}
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_as_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_as_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)) {
        if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
            result = __Pyx_PyObject_CallOneArg(annotate, format);
            Py_LeaveRecursiveCall();
            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 *arg) {
    CYTHON_UNUSED_VAR(arg);
    if (unlikely(!self)) {
        PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
        return NULL;
    }
    PyObject *result;
    if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
        return NULL;
    }
    result = __Pyx_CyFunction_get_annotations(self, NULL);
    Py_LeaveRecursiveCall();
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
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 (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
        PyCFunction cfunction = PyCFunction_GetFunction(value);
        if (unlikely(!cfunction)) return -1;
        PyObject *value_self = PyCFunction_GetSelf(value);
        if (unlikely(!value_self && PyErr_Occurred())) return -1;
#else
        PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
        PyObject *value_self = PyCFunction_GET_SELF(value);
#endif
        if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
            return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
        }
    }
    if (value != Py_None) {
        __pyx_CyFunctionObject *op = __Pyx_as_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);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
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_or_error;
        }
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore_or_error:
        if (!__Pyx_IgnoreException(PyExc_Exception)) {
            return NULL;
        }
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    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_in);
    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;
}
#endif
static void __Pyx_CyFunction_raise_argument_count_error(PyObject *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(PyObject *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(PyObject *op_in, void *context) {
    CYTHON_UNUSED_VAR(context);
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    Py_INCREF(op->func_module);
    return op->func_module;
}
static int
__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    PyObject *old = op->func_module;
    op->func_module = value;
    Py_DECREF(old);
    return 0;
}
#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},
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
    {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#endif
#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),
        __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
#endif
#if CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
        __PYX_SHARED_RELATIVE_OFFSET | 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),
        __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
#else
    {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
{
    PyObject *result = NULL;
    __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m_in);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
        "Placeholder __annotate__ function to allow 'functools.wraps' to work "
        "on Cython functions."},
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
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 *method = PyCFunction_New(
        &__pyx_CyFunction_methods[0],
        op_in);
    return method;
}
#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(PyObject *op_in,
                                       PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
#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_methoddef = ml;
    Py_INCREF(module);
    op->func_module = module;
#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 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;
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
    op->func_is_coroutine = NULL;
#endif
#if CYTHON_VECTORCALL
    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_in);
        return NULL;
    }
#endif
    return op_in;
}
static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_module);
#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 CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_classobj);
#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);
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
    Py_CLEAR(m->func_is_coroutine);
#endif
    Py_CLEAR(m->defaults);
    return 0;
}
static int
__Pyx_CyFunction_clear(PyObject *m)
{
    return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
}
static void __Pyx__CyFunction_dealloc(PyObject *m)
{
    __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
    if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
        PyObject_ClearWeakRefs(m);
    __Pyx__CyFunction_clear(cyfunc);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(PyObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
{
    __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
    {
        int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func_module);
#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);
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
    Py_VISIT(m->func_is_coroutine);
#endif
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(PyObject *op_in)
{
    __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    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
    __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
    PyCFunction meth = cyfunc->func_methoddef->ml_meth;
    int flags = cyfunc->func_methoddef->ml_flags;
#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(
                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(
                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(
        func, "takes no keyword arguments");
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
#if 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_VECTORCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __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(
                func, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            func, "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_as_CyFunctionObject(func);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = cyfunc->func_methoddef->ml_meth;
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = func;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            func, "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_as_CyFunctionObject(func);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = cyfunc->func_methoddef->ml_meth;
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = func;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            func, "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_as_CyFunctionObject(func);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = cyfunc->func_methoddef->ml_meth;
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = func;
        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_as_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 = cyfunc->func_methoddef->ml_meth;
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = func;
        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",
    __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if CYTHON_VECTORCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_VECTORCALL
#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;
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    (void)&__Pyx_Get_CyFunction_Type;
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}
static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
    PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
    Py_INCREF((PyObject*)tp);
    return tp;
}

/* ClassMethod */
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    if (__Pyx_TypeCheck(method, &PyMethodDescr_Type))
#endif
    {
#if CYTHON_COMPILING_IN_LIMITED_API
        return PyErr_Format(
            PyExc_SystemError,
            "Cython cannot yet handle classmethod on a MethodDescriptorType (%S) in limited API mode. "
            "This is most likely a classmethod in a cdef class method with binding=False. "
            "Try setting 'binding' to True.",
            method);
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
        PyTypeObject *d_type = GraalPyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, GraalPyMethodDescrObject_GetMethod(method));
#elif CYTHON_COMPILING_IN_GRAAL
        PyTypeObject *d_type = PyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, PyMethodDescrObject_GetMethod(method));
#else
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        PyTypeObject *d_type = descr->d_common.d_type;
        return PyDescr_NewClassMethod(d_type, descr->d_method);
#endif
    }
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
#else
    {
        PyObject *func=NULL;
        PyObject *builtins, *classmethod, *classmethod_str, *result=NULL;
        if (__Pyx_TypeCheck(method, __pyx_mstate_global->__Pyx_CachedMethodType)) {
            func = PyObject_GetAttrString(method, "__func__");
            if (!func) goto bad;
        } else {
            func = method;
            Py_INCREF(func);
        }
        builtins = PyEval_GetBuiltins(); // borrowed
        if (unlikely(!builtins)) goto bad;
        classmethod_str = PyUnicode_FromString("classmethod");
        if (unlikely(!classmethod_str)) goto bad;
        classmethod = PyObject_GetItem(builtins, classmethod_str);
        Py_DECREF(classmethod_str);
        if (unlikely(!classmethod)) goto bad;
        result = PyObject_CallFunctionObjArgs(classmethod, func, NULL);
        Py_DECREF(classmethod);
        bad:
        Py_XDECREF(func);
        return result;
    }
#endif
}

/* GetNameInClass */
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_mstate_global->__pyx_n_u_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    if (!__Pyx_IgnoreException(PyExc_Exception)) {
        return NULL; // BaseException
    }
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

/* 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;
}

/* PyObjectCall2Args (used by Py3ClassCreate) */
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);
}

/* PyObjectLookupSpecial (used by Py3ClassCreate) */
#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

/* 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;
}

/* 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;
    }
    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);
    }
    __Pyx_PyErr_FetchException(&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:
    __Pyx_PyErr_RestoreException(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

/* PyObjectCallMethod1 */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
    PyObject *args[2] = {obj, arg};
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
#else
    return PyObject_CallMethodOneArg(obj, method_name, arg);
#endif
}

/* CheckUnpickleChecksumError */
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);
}

/* 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;\
    }

/* 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);
}

/* CheckUnpickleChecksum */
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;
}

/* PyObjectVectorcallMethodKwds (used by CIntToPy) */
#if !CYTHON_VECTORCALL
static PyObject *__Pyx_Object_VectorcallMethodKwds(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_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    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 *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntFromPy */
static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(void) {
    const char* type_name = "int";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (int) -1;
}
static int __Pyx_raise_overflow___Pyx_PyLong_As_int(void) {
    const char* type_name = "int";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (int) -1;
}
static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (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]));
            }
        } else
        if (size == 3 && (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]));
            }
        } else
        if (size == 4 && (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]));
            }
        } else
        {}
    }
#elif 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))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_int();
}
static CYTHON_INLINE int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(int, long, ival)
            } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                return (int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(int, long, ival)
            } 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])));
            }
        } else
        if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(int, long, ival)
            } 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])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(int, int, PyLong_AsInt(x))
    } else
    #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))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_int();
}
static int __Pyx_LargePyLong___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;
    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);
    if ((0)) goto raise_overflow;
#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);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to int");
        return (int) -1;
    } 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:
    return __Pyx_raise_overflow___Pyx_PyLong_As_int();
}
static CYTHON_INLINE int __Pyx_PyLong___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 (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
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_int(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
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_int(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_int();
#endif
}
static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *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;
}
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_int(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
    }
}

/* CIntFromPy */
static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(void) {
    const char* type_name = "long";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (long) -1;
}
static long __Pyx_raise_overflow___Pyx_PyLong_As_long(void) {
    const char* type_name = "long";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (long) -1;
}
static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (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]));
            }
        } else
        if (size == 3 && (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]));
            }
        } else
        if (size == 4 && (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]));
            }
        } else
        {}
    }
#elif 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))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_long();
}
static CYTHON_INLINE long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(long, long, ival)
            } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                return (long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(long, long, ival)
            } 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])));
            }
        } else
        if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(long, long, ival)
            } 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])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(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]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(long) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(long, int, PyLong_AsInt(x))
    } else
    #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))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_long();
}
static long __Pyx_LargePyLong___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;
    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);
    if ((0)) goto raise_overflow;
#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);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to long");
        return (long) -1;
    } 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:
    return __Pyx_raise_overflow___Pyx_PyLong_As_long();
}
static CYTHON_INLINE long __Pyx_PyLong___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 (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
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_long(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
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_long(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_long();
#endif
}
static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *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;
}
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_long(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PY_LONG_LONG(PY_LONG_LONG value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_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(PY_LONG_LONG) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PY_LONG_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(PY_LONG_LONG),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PY_LONG_LONG));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PGPing(PGPing value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PGPing neg_one = (PGPing) -1, const_zero = (PGPing) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PGPing) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PGPing) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(PGPing) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PGPing) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PGPing) <= 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(PGPing),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PGPing));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_ConnStatusType(ConnStatusType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const ConnStatusType neg_one = (ConnStatusType) -1, const_zero = (ConnStatusType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(ConnStatusType) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(ConnStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(ConnStatusType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(ConnStatusType) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(ConnStatusType) <= 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(ConnStatusType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ConnStatusType));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PGTransactionStatusType(PGTransactionStatusType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PGTransactionStatusType neg_one = (PGTransactionStatusType) -1, const_zero = (PGTransactionStatusType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PGTransactionStatusType) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PGTransactionStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(PGTransactionStatusType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PGTransactionStatusType) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PGTransactionStatusType) <= 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(PGTransactionStatusType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PGTransactionStatusType));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntFromPy */
static Oid __Pyx_LargePyLong___Pyx_PyLong_As_Oid(PyObject *x);
static Oid __Pyx_raise_neg_overflow___Pyx_PyLong_As_Oid(void) {
    const char* type_name = "Oid";
    PyErr_Format(PyExc_OverflowError,
        "can't convert negative value to %.200s", type_name);
    return (Oid) -1;
}
static Oid __Pyx_raise_overflow___Pyx_PyLong_As_Oid(void) {
    const char* type_name = "Oid";
    PyErr_Format(PyExc_OverflowError,
        "value too large to convert to %.200s", type_name);
    return (Oid) -1;
}
static CYTHON_INLINE Oid __Pyx_PyULong___Pyx_PyLong_As_Oid(PyObject *x) {
    const int is_unsigned = 1;
#if CYTHON_USE_PYLONG_INTERNALS
    {
        const digit* digits = __Pyx_PyLong_Digits(x);
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        if (size == 2 && (8 * sizeof(Oid) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(Oid, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(Oid) >= 2 * PyLong_SHIFT)) {
                return (Oid) (((((Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(Oid) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(Oid, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(Oid) >= 3 * PyLong_SHIFT)) {
                return (Oid) (((((((Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(Oid) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(Oid, 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(Oid) >= 4 * PyLong_SHIFT)) {
                return (Oid) (((((((((Oid)digits[3]) << PyLong_SHIFT) | (Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0]));
            }
        } else
        {}
    }
#elif 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 (Oid) -1;
        if (unlikely(result == 1))
            goto raise_neg_overflow;
    }
#endif
    if ((sizeof(Oid) <= sizeof(unsigned long))) {
        __PYX_VERIFY_RETURN_INT_EXC(Oid, unsigned long, PyLong_AsUnsignedLong(x))
    } else if ((sizeof(Oid) <= sizeof(unsigned PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(Oid, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_Oid(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_Oid();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_Oid();
}
static CYTHON_INLINE Oid __Pyx_PySLong___Pyx_PyLong_As_Oid(PyObject *x) {
    const int is_unsigned = 0;
#if CYTHON_USE_PYLONG_INTERNALS
    if (__Pyx_PyLong_IsNeg(x)) {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(Oid) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(Oid, long, ival)
            } else if ((8 * sizeof(Oid) - 1 > 2 * PyLong_SHIFT)) {
                return (Oid) (((Oid) -1) * (((((Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0])));
            }
        } else
        if (size == 3 && (8 * sizeof(Oid) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(Oid, long, ival)
            } else if ((8 * sizeof(Oid) - 1 > 3 * PyLong_SHIFT)) {
                return (Oid) (((Oid) -1) * (((((((Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0])));
            }
        } else
        if (size == 4 && (8 * sizeof(Oid) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                __PYX_VERIFY_RETURN_INT(Oid, long, ival)
            } else if ((8 * sizeof(Oid) - 1 > 4 * PyLong_SHIFT)) {
                return (Oid) (((Oid) -1) * (((((((((Oid)digits[3]) << PyLong_SHIFT) | (Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0])));
            }
        } else
        {}
    } else {
        const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
        const digit* digits = __Pyx_PyLong_Digits(x);
        if (size == 2 && (8 * sizeof(Oid) > 1 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(Oid, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(Oid) - 1 > 2 * PyLong_SHIFT)) {
                return (Oid) (((((Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0]));
            }
        } else
        if (size == 3 && (8 * sizeof(Oid) > 2 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(Oid, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
            } else if ((8 * sizeof(Oid) - 1 > 3 * PyLong_SHIFT)) {
                return (Oid) (((((((Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0]));
            }
        } else
        if (size == 4 && (8 * sizeof(Oid) > 3 * PyLong_SHIFT)) {
            if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
                __PYX_VERIFY_RETURN_INT(Oid, 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(Oid) - 1 > 4 * PyLong_SHIFT)) {
                return (Oid) (((((((((Oid)digits[3]) << PyLong_SHIFT) | (Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0]));
            }
        } else
        {}
    }
#endif
    #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    if ((sizeof(Oid) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(Oid, int, PyLong_AsInt(x))
    } else
    #endif
    if ((sizeof(Oid) <= sizeof(long))) {
        __PYX_VERIFY_RETURN_INT_EXC(Oid, long, PyLong_AsLong(x))
    } else if ((sizeof(Oid) <= sizeof(PY_LONG_LONG))) {
        __PYX_VERIFY_RETURN_INT_EXC(Oid, PY_LONG_LONG, PyLong_AsLongLong(x))
    }
    return __Pyx_LargePyLong___Pyx_PyLong_As_Oid(x);
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_Oid();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_Oid();
}
static Oid __Pyx_LargePyLong___Pyx_PyLong_As_Oid(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Oid neg_one = (Oid) -1, const_zero = (Oid) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    Oid 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);
    if ((0)) goto raise_overflow;
#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 (Oid) -1;
        assert(PyLong_CheckExact(v));
    }
    {
        int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
        if (unlikely(result < 0)) {
            Py_DECREF(v);
            return (Oid) -1;
        }
        is_negative = result == 1;
    }
    if (is_unsigned && unlikely(is_negative)) {
        Py_DECREF(v);
        PyErr_SetString(PyExc_OverflowError,
            "can't convert negative value to Oid");
        return (Oid) -1;
    } else if (is_negative) {
        stepval = PyNumber_Invert(v);
        Py_DECREF(v);
        if (unlikely(!stepval))
            return (Oid) -1;
    } else {
        stepval = v;
    }
    v = NULL;
    val = (Oid) 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(Oid) * 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 |= ((Oid) 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(Oid) * 8) - bits - (is_unsigned ? 0 : 1);
        if (unlikely(idigit >= (1L << remaining_bits)))
            goto raise_overflow;
        val |= ((Oid) idigit) << bits;
    }
    if (!is_unsigned) {
        if (unlikely(val & (((Oid) 1) << (sizeof(Oid) * 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 (Oid) -1;
    return val;
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_Oid();
}
static CYTHON_INLINE Oid __Pyx_PyLong___Pyx_PyLong_As_Oid(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Oid neg_one = (Oid) -1, const_zero = (Oid) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    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(Oid, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else
        #endif
        {
            return __Pyx_PyULong___Pyx_PyLong_As_Oid(x);
        }
    } else {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Oid, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else
        #endif
        {
            return __Pyx_PySLong___Pyx_PyLong_As_Oid(x);
        }
    }
#if CYTHON_USE_PYLONG_INTERNALS
raise_neg_overflow:
    return __Pyx_raise_neg_overflow___Pyx_PyLong_As_Oid();
raise_overflow:
    return __Pyx_raise_overflow___Pyx_PyLong_As_Oid();
#endif
}
static Oid __Pyx_NonPyLong___Pyx_PyLong_As_Oid(PyObject *x) {
    Oid val;
    PyObject *tmp = __Pyx_PyNumber_Long(x);
    if (!tmp) return (Oid) -1;
    val = __Pyx_PyLong_As_Oid(tmp);
    Py_DECREF(tmp);
    return val;
}
static CYTHON_INLINE Oid __Pyx_PyLong_As_Oid(PyObject *x) {
    if (likely(PyLong_Check(x))) {
        return __Pyx_PyLong___Pyx_PyLong_As_Oid(x);
    } else {
        return __Pyx_NonPyLong___Pyx_PyLong_As_Oid(x);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_ExecStatusType(ExecStatusType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const ExecStatusType neg_one = (ExecStatusType) -1, const_zero = (ExecStatusType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(ExecStatusType) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(ExecStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(ExecStatusType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(ExecStatusType) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(ExecStatusType) <= 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(ExecStatusType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ExecStatusType));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PGpipelineStatus(PGpipelineStatus value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PGpipelineStatus neg_one = (PGpipelineStatus) -1, const_zero = (PGpipelineStatus) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PGpipelineStatus) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PGpipelineStatus) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(PGpipelineStatus) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PGpipelineStatus) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PGpipelineStatus) <= 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(PGpipelineStatus),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PGpipelineStatus));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Oid(Oid value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Oid neg_one = (Oid) -1, const_zero = (Oid) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Oid) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(Oid) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(Oid) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Oid) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(Oid) <= 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(Oid),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(Oid));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PostgresPollingStatusType(PostgresPollingStatusType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PostgresPollingStatusType neg_one = (PostgresPollingStatusType) -1, const_zero = (PostgresPollingStatusType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PostgresPollingStatusType) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PostgresPollingStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(PostgresPollingStatusType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PostgresPollingStatusType) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PostgresPollingStatusType) <= 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(PostgresPollingStatusType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PostgresPollingStatusType));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        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 *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
        if (!from_bytes_str) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
            if (!is_unsigned) {
                PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
                if (!signed_str) goto limited_bad;
#if CYTHON_VECTORCALL
                kwds = PyTuple_Pack(1, signed_str);
#else
                {
                    PyObject *keys[] = {signed_str};
                    PyObject *values[] = {Py_True};
                    kwds = __Pyx_MakeKwargDict(keys, values, 1);
                }
#endif
                Py_DECREF(signed_str);
                if (unlikely(!kwds)) goto limited_bad;
            }
            result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes_str);
        return result;
#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
}

/* 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;
        #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 <= 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 (!result) {
            PyObject *exc_type, *exc_value, *exc_tb;
            PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
            if (PyErr_WarnFormat(
                    PyExc_RuntimeWarning, 1,
                    "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
                    exc_value ? exc_value : exc_type) == 0) {
                result = Py_None;
                Py_INCREF(result);
            }
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
        }
        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 */
CYTHON_UNUSED
static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
#ifdef __Pyx_DecompressString_UNUSED
    CYTHON_UNUSED_VAR(s);
    CYTHON_UNUSED_VAR(length);
    CYTHON_UNUSED_VAR(algo);
    return NULL;
#else
    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;
#endif
}

/* DecompressString_LZSS */
#ifndef __Pyx_DecompressString_LZSS_UNUSED
CYTHON_UNUSED
static CYTHON_SMALL_CODE size_t __pyx_lzss_decompress(const uint8_t* src, uint8_t* dst, size_t dst_len) {
    size_t pos = 0, out_pos = 0;
    while (1) {
        uint32_t flags = src[pos++] | 0xFF00;
        while (flags & 0x100) {
            if (flags & 1) {
                dst[out_pos++] = src[pos++];
            } else {
                uint32_t lo = src[pos++], hi = src[pos++];
                uint32_t end_offset_of_last_occurrence, match_length;
                if (!(lo & 0x80)) {
                    end_offset_of_last_occurrence = lo;
                    match_length = hi;
                } else if (!(hi & 0x80)) {
                    end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
                    match_length = hi & 0x1F;
                } else {
                    end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
                    match_length = src[pos++];
                }
                match_length += 3;
                size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
                memcpy(dst + out_pos, dst + ref_pos, match_length);
                out_pos += match_length;
            }
            if (out_pos >= dst_len) return pos;
            flags >>= 1;
        }
    }
}
#endif
static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length) {
#ifdef __Pyx_DecompressString_LZSS_UNUSED
    CYTHON_UNUSED_VAR(s);
    CYTHON_UNUSED_VAR(compressed_length);
    CYTHON_UNUSED_VAR(uncompressed_length);
    return NULL;
#else
    PyObject *result;
    unsigned char *result_data;
    size_t src_length;
    result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
    if (unlikely(!result)) return NULL;
    result_data = __Pyx_PyBytes_AsWritableUString(result);
    if (unlikely(!result_data)) goto bad;
    src_length = __pyx_lzss_decompress((const uint8_t*) s, result_data, uncompressed_length);
    if (unlikely(src_length != compressed_length)) goto decompression_failed;
    return result;
decompression_failed:
    PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
bad:
    Py_DECREF(result);
    return NULL;
#endif
}

#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 CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
    if (unlikely(!result_type_name)) goto bad;
    #endif
    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);
            goto bad;
        }
        __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);
bad:
    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_PyLong_AsSsize_t(PyObject* b) {
    #if CYTHON_USE_PYLONG_INTERNALS
    Py_ssize_t ival;
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
    const int is_neg = __Pyx_PyLong_IsNeg(b);
    const digit* digits = __Pyx_PyLong_Digits(b);
    if (size == 0) return 0;
    #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
    if (size == 1) {
        ival = (Py_ssize_t) (((size_t)digits[0]));
    } else
    #endif
    #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
    if (size == 2) {
        ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
    } else
    #endif
    #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
    if (size == 3) {
        ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
    } else
    #endif
    #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
    if (size == 4) {
        ival = (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]));
    } else
    #endif
        return PyLong_AsSsize_t(b);
    return is_neg ? -ival : ival;
    #else
    return PyLong_AsSsize_t(b);
    #endif
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
    if (likely(PyLong_Check(b))) {
        return __Pyx_PyLong_AsSsize_t(b);
    } else {
        Py_ssize_t ival;
        PyObject *x = PyNumber_Index(b);
        if (unlikely(!x)) return -1;
        ival = __Pyx_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(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(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(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 */
