/* Generated by Cython 3.2.5 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "define_macros": [
            [
                "NPY_NO_DEPRECATED_API",
                "NPY_1_7_API_VERSION"
            ],
            [
                "CYTHON_LIMITED_API",
                "1"
            ],
            [
                "Py_LIMITED_API",
                "0x030b0000"
            ]
        ],
        "depends": [
            "/usr/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayobject.h",
            "/usr/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayscalars.h",
            "/usr/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
            "/usr/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
            "/usr/lib/python3.14/site-packages/numpy/_core/include/numpy/ufuncobject.h",
            "indexed_gzip/zran.h",
            "indexed_gzip/zran_file_util.h"
        ],
        "extra_compile_args": [
            "-Wall",
            "-Wno-unused-function"
        ],
        "include_dirs": [
            "indexed_gzip",
            "/usr/lib/python3.14/site-packages/numpy/_core/include"
        ],
        "libraries": [
            "z"
        ],
        "name": "indexed_gzip.tests.ctest_zran",
        "sources": [
            "indexed_gzip/tests/ctest_zran.pyx",
            "indexed_gzip/zran.c",
            "indexed_gzip/zran_file_util.c"
        ]
    },
    "module_name": "indexed_gzip.tests.ctest_zran"
}
END: Cython Metadata */

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

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

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

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

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

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

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

#define __PYX_HAVE__indexed_gzip__tests__ctest_zran
#define __PYX_HAVE_API__indexed_gzip__tests__ctest_zran
/* Early includes */
#include <string.h>
#include <stdio.h>

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


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


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

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif

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

static const char* const __pyx_f[] = {
  "indexed_gzip/tests/ctest_zran.pyx",
  "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
  "(tree fragment)",
  "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 (used by ParseKeywordsImpl) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
#else
#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

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

/* #### Code section: numeric_typedefs ### */

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":744
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
*/
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":745
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
*/
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":746
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * 
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":747
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_uint8      uint8_t
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":749
 * ctypedef npy_int64      int64_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":750
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
*/
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":751
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * 
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":752
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_float32    float32_t
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":754
 * ctypedef npy_uint64     uint64_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":755
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
*/
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
 * ctypedef double complex complex128_t
 * 
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":763
 * 
 * ctypedef npy_longlong   longlong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":765
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
*/
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":768
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
*/
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":769
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
*/
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":770
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef float complex       cfloat_t
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
/* #### Code section: complex_type_declarations ### */
/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< long double > __pyx_t_long_double_complex;
  #else
    typedef long double _Complex __pyx_t_long_double_complex;
  #endif
#else
    typedef struct { long double real, imag; } __pyx_t_long_double_complex;
#endif
static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);

/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer;
struct __pyx_defaults;
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__;
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn;
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation;
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding;
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream;
struct __pyx_opt_args_12indexed_gzip_5tests_10ctest_zran_read_element;

/* "indexed_gzip/tests/ctest_zran.pyx":77
 * np.import_array()
 * 
 * cdef read_element(zran.zran_index_t *index, element, nelems, seek=True):             # <<<<<<<<<<<<<<
 * 
 *     cdef void *buffer
*/
struct __pyx_opt_args_12indexed_gzip_5tests_10ctest_zran_read_element {
  int __pyx_n;
  PyObject *seek;
};

/* "indexed_gzip/tests/ctest_zran.pyx":134
 * 
 * 
 * cdef class ReadBuffer:             # <<<<<<<<<<<<<<
 *     """Wrapper around a chunk of memory.
 * 
*/
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer {
  PyObject_HEAD
  void *buffer;
  int use_mmap;
  size_t size;
  PyObject *mmap_fd;
  PyObject *mmap_path;
};


/* "indexed_gzip/tests/ctest_zran.pyx":1264
 *         return f
 * 
 *     def _run_crc_tests(data, shouldpass, flags=zran.ZRAN_AUTO_BUILD):             # <<<<<<<<<<<<<<
 *         if shouldpass:
 *             expect_build = zran.ZRAN_BUILD_INDEX_OK
*/
struct __pyx_defaults {
  PyObject_HEAD
  PyObject *arg0;
};


/* "indexed_gzip/tests/ctest_zran.pyx":155
 * 
 * 
 *     def __cinit__(self, size_t size, use_mmap=False):             # <<<<<<<<<<<<<<
 *         """Allocate ``size`` bytes of memory. """
 * 
*/
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ {
  PyObject_HEAD
  PyObject *__pyx_v_fd;
  size_t __pyx_v_size;
  PyObject *__pyx_v_th;
};


/* "indexed_gzip/tests/ctest_zran.pyx":236
 * 
 * 
 * def return_fn(return_value):             # <<<<<<<<<<<<<<
 *     return lambda *args, **kwargs: return_value
 * 
*/
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn {
  PyObject_HEAD
  PyObject *__pyx_v_return_value;
};


/* "indexed_gzip/tests/ctest_zran.pyx":1240
 * 
 * 
 * def test_crc_validation(concat, seed):             # <<<<<<<<<<<<<<
 *     """Basic test of CRC validation. """
 * 
*/
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation {
  PyObject_HEAD
  PyObject *__pyx_v__zran_init;
  PyObject *__pyx_v_dsize;
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_rawdata;
};


/* "indexed_gzip/tests/ctest_zran.pyx":1348
 * 
 * 
 * def test_standard_usage_with_null_padding(concat):             # <<<<<<<<<<<<<<
 *     """Make sure standard usage works with files that have null-padding after
 *     the GZIP footer.
*/
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding {
  PyObject_HEAD
  PyObject *__pyx_v_f;
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_paddedcmpdata;
};


/* "indexed_gzip/tests/ctest_zran.pyx":1510
 * 
 * # pauldmccarthy/indexed_gzip#169
 * def test_skip_crc_with_footer_that_looks_like_new_stream(seed):             # <<<<<<<<<<<<<<
 *     """Test the code with a file where the 8 byte GZIP footer (the CRC and
 *     uncompressed size modulo 2**32) contains bytes which look like a new
*/
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream {
  PyObject_HEAD
  zran_index_t __pyx_v_index;
};

/* #### Code section: utility_code_proto ### */

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

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

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

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

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

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

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

/* 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

/* PyImportError_Check.proto */
#define __Pyx_PyExc_ImportError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ImportError)

/* 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 */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs);

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

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

/* 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)

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

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

/* 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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
#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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PyRuntimeError_Check.proto */
#define __Pyx_PyExc_RuntimeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_RuntimeError)

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

/* PyMemoryError_Check.proto */
#define __Pyx_PyExc_MemoryError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_MemoryError)

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

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

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

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

/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

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

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

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

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

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

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

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

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

/* PyRange_Check.proto */
#if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check)
  #define PyRange_Check(obj)  __Pyx_TypeCheck((obj), &PyRange_Type)
#endif

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

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

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

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

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

/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck, unsafe_shared) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck, int unsafe_shared);

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

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

/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
    __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

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

/* 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

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

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

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

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

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

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

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_2_5
#define __PYX_HAVE_RT_ImportType_proto_3_2_5
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_5(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_5(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_5 {
   __Pyx_ImportType_CheckSize_Error_3_2_5 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_2_5 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_2_5 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_5(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_5 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

/* 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.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

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

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

/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_float(a, b)   ((a)==(b))
    #define __Pyx_c_sum_float(a, b)  ((a)+(b))
    #define __Pyx_c_diff_float(a, b) ((a)-(b))
    #define __Pyx_c_prod_float(a, b) ((a)*(b))
    #define __Pyx_c_quot_float(a, b) ((a)/(b))
    #define __Pyx_c_neg_float(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
    #define __Pyx_c_conj_float(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (::std::abs(z))
        #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_float(z) ((z)==0)
    #define __Pyx_c_conj_float(z)    (conjf(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (cabsf(z))
        #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_long__double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_long__double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
    #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
    #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
    #define __Pyx_c_neg_long__double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
    #define __Pyx_c_conj_long__double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_long__double(z)     (::std::abs(z))
        #define __Pyx_c_pow_long__double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_long__double(z) ((z)==0)
    #define __Pyx_c_conj_long__double(z)    (conjl(z))
    #if 1
        #define __Pyx_c_abs_long__double(z)     (cabsl(z))
        #define __Pyx_c_pow_long__double(a, b)  (cpowl(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
    #if 1
        static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
        static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    #endif
#endif

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

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

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

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

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

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

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

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE uint16_t __Pyx_PyLong_As_uint16_t(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE npy_intp __Pyx_PyLong_As_npy_intp(PyObject *);

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

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

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

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

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

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

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

static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/

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

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

/* Module declarations from "__builtin__" */

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

/* Module declarations from "cpython" */

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

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

/* Module declarations from "numpy" */

/* Module declarations from "numpy" */
static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/

/* Module declarations from "posix.types" */

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

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

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

/* Module declarations from "posix.mman" */

/* Module declarations from "indexed_gzip.zran" */

/* Module declarations from "indexed_gzip.zran_file_util" */

/* Module declarations from "indexed_gzip.tests.ctest_zran" */
static PyObject *__pyx_f_12indexed_gzip_5tests_10ctest_zran_read_element(zran_index_t *, PyObject *, PyObject *, struct __pyx_opt_args_12indexed_gzip_5tests_10ctest_zran_read_element *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_12indexed_gzip_5tests_10ctest_zran__compare_indexes(zran_index_t *, zran_index_t *); /*proto*/
static PyObject *__pyx_f_12indexed_gzip_5tests_10ctest_zran__write_index_file_v0(zran_index_t *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "indexed_gzip.tests.ctest_zran"
extern int __pyx_module_is_main_indexed_gzip__tests__ctest_zran;
int __pyx_module_is_main_indexed_gzip__tests__ctest_zran = 0;

/* Implementation of "indexed_gzip.tests.ctest_zran" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_enumerate;
/* #### Code section: string_decls ### */
static const char __pyx_k_ab[] = "ab";
static const char __pyx_k_rb[] = "rb";
static const char __pyx_k_wb[] = "wb";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___initmem(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self); /* proto */
static int __pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer___cinit__(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_self, size_t __pyx_v_size, PyObject *__pyx_v_use_mmap); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_2resize(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_self, size_t __pyx_v_size); /* proto */
static void __pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_4__dealloc__(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_error_fn(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_2return_fn(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_return_value); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_4test_fread(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_6test_ftell(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_8test_fseek(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_10test_feof(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_12test_ferror(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_14test_fflush(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_16test_fwrite(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_18test_getc(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_20test_seekable(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_22test_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_24test_init_file_modes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_26test_no_auto_build(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_28test_seek_to_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_30test_seek_cur(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_32test_seek_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_34test_seek_beyond_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_36test_sequential_seek_to_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_niters); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_38test_random_seek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_niters, CYTHON_UNUSED PyObject *__pyx_v_seed); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_40test_read_all(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_use_mmap); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_42test_seek_then_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_niters, CYTHON_UNUSED PyObject *__pyx_v_seed, PyObject *__pyx_v_use_mmap); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_44test_random_seek_and_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_niters, CYTHON_UNUSED PyObject *__pyx_v_seed); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_46test_read_all_sequential(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_48test_build_then_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, CYTHON_UNUSED PyObject *__pyx_v_seed, PyObject *__pyx_v_use_mmap); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_50test_readbuf_spacing_sizes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_niters, CYTHON_UNUSED PyObject *__pyx_v_seed); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_52test_export_then_import(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_54test_export_import_no_points(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_no_fds); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_56test_export_import_format_v0(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation__zran_init(PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_flags); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_68__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_2_run_crc_tests(PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_shouldpass, PyObject *__pyx_v_flags); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_4wrap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_58test_crc_validation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_concat, CYTHON_UNUSED PyObject *__pyx_v_seed); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding__zran_init(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_60test_standard_usage_with_null_padding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_concat); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_62test_inflateInit_leak_on_error(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_64test_read_eof_memmove_rotate_bug(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_seed); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream__zran_init(PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_flags); /* proto */
static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_66test_skip_crc_with_footer_that_looks_like_new_stream(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_seed); /* proto */
static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran_ReadBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_defaults(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  PyTypeObject *__pyx_ptype_5numpy_dtype;
  PyTypeObject *__pyx_ptype_5numpy_flatiter;
  PyTypeObject *__pyx_ptype_5numpy_broadcast;
  PyTypeObject *__pyx_ptype_5numpy_ndarray;
  PyTypeObject *__pyx_ptype_5numpy_generic;
  PyTypeObject *__pyx_ptype_5numpy_number;
  PyTypeObject *__pyx_ptype_5numpy_integer;
  PyTypeObject *__pyx_ptype_5numpy_signedinteger;
  PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
  PyTypeObject *__pyx_ptype_5numpy_inexact;
  PyTypeObject *__pyx_ptype_5numpy_floating;
  PyTypeObject *__pyx_ptype_5numpy_complexfloating;
  PyTypeObject *__pyx_ptype_5numpy_flexible;
  PyTypeObject *__pyx_ptype_5numpy_character;
  PyTypeObject *__pyx_ptype_5numpy_ufunc;
  PyObject *__pyx_type_12indexed_gzip_5tests_10ctest_zran_ReadBuffer;
  PyObject *__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_defaults;
  PyObject *__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__;
  PyObject *__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn;
  PyObject *__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation;
  PyObject *__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding;
  PyObject *__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream;
  PyTypeObject *__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer;
  PyTypeObject *__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults;
  PyTypeObject *__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__;
  PyTypeObject *__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn;
  PyTypeObject *__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation;
  PyTypeObject *__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding;
  PyTypeObject *__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  PyObject *__pyx_slice[2];
  PyObject *__pyx_tuple[12];
  PyObject *__pyx_codeobj_tab[46];
  PyObject *__pyx_string_tab[370];
  PyObject *__pyx_number_tab[34];
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

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

/* CythonFunctionShared.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;


#if CYTHON_USE_FREELISTS
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__[8];
int __pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn[8];
int __pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation[8];
int __pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding[8];
int __pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream *__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream[8];
int __pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

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

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

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

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_kp_u_0_2f_seconds __pyx_string_tab[1]
#define __pyx_kp_u_Cannot_resize_a_memmapped_array __pyx_string_tab[2]
#define __pyx_kp_u_Copied_stream_from_to_padding_b __pyx_string_tab[3]
#define __pyx_kp_u_Error_at_point_d __pyx_string_tab[4]
#define __pyx_kp_u_Memory_mapping_0_2f_GB __pyx_string_tab[5]
#define __pyx_kp_u_Padding_streams_orig_size __pyx_string_tab[6]
#define __pyx_kp_u_PyMem_Realloc_fail __pyx_string_tab[7]
#define __pyx_kp_u_ReadBuffer_init_fail __pyx_string_tab[8]
#define __pyx_kp_u__2 __pyx_string_tab[9]
#define __pyx_kp_u__3 __pyx_string_tab[10]
#define __pyx_kp_u__4 __pyx_string_tab[11]
#define __pyx_kp_u_a_2 __pyx_string_tab[12]
#define __pyx_kp_u_data_gz __pyx_string_tab[13]
#define __pyx_kp_u_data_gz_index __pyx_string_tab[14]
#define __pyx_kp_u_disable __pyx_string_tab[15]
#define __pyx_kp_u_dummy_gz __pyx_string_tab[16]
#define __pyx_kp_u_element __pyx_string_tab[17]
#define __pyx_kp_u_enable __pyx_string_tab[18]
#define __pyx_kp_u_expread __pyx_string_tab[19]
#define __pyx_kp_u_expseek __pyx_string_tab[20]
#define __pyx_kp_u_exptell __pyx_string_tab[21]
#define __pyx_kp_u_ftell __pyx_string_tab[22]
#define __pyx_kp_u_gc __pyx_string_tab[23]
#define __pyx_kp_u_gotread __pyx_string_tab[24]
#define __pyx_kp_u_gotseek __pyx_string_tab[25]
#define __pyx_kp_u_gottell __pyx_string_tab[26]
#define __pyx_kp_u_idx_tmp __pyx_string_tab[27]
#define __pyx_kp_u_indexed_gzip_tests __pyx_string_tab[28]
#define __pyx_kp_u_indexed_gzip_tests_contextlib __pyx_string_tab[29]
#define __pyx_kp_u_indexed_gzip_tests_ctest_zran_py __pyx_string_tab[30]
#define __pyx_kp_u_indexed_gzip_tests_gzip __pyx_string_tab[31]
#define __pyx_kp_u_indexed_gzip_tests_hashlib __pyx_string_tab[32]
#define __pyx_kp_u_indexed_gzip_tests_io __pyx_string_tab[33]
#define __pyx_kp_u_indexed_gzip_tests_itertools __pyx_string_tab[34]
#define __pyx_kp_u_indexed_gzip_tests_numpy __pyx_string_tab[35]
#define __pyx_kp_u_indexed_gzip_tests_os __pyx_string_tab[36]
#define __pyx_kp_u_indexed_gzip_tests_os_path __pyx_string_tab[37]
#define __pyx_kp_u_indexed_gzip_tests_random __pyx_string_tab[38]
#define __pyx_kp_u_indexed_gzip_tests_resource __pyx_string_tab[39]
#define __pyx_kp_u_indexed_gzip_tests_shutil __pyx_string_tab[40]
#define __pyx_kp_u_indexed_gzip_tests_subprocess __pyx_string_tab[41]
#define __pyx_kp_u_indexed_gzip_tests_sys __pyx_string_tab[42]
#define __pyx_kp_u_indexed_gzip_tests_tempfile __pyx_string_tab[43]
#define __pyx_kp_u_indexed_gzip_tests_threading __pyx_string_tab[44]
#define __pyx_kp_u_indexed_gzip_tests_time __pyx_string_tab[45]
#define __pyx_kp_u_isenabled __pyx_string_tab[46]
#define __pyx_kp_u_mmap_fail __pyx_string_tab[47]
#define __pyx_kp_u_nbytes __pyx_string_tab[48]
#define __pyx_kp_u_nelems __pyx_string_tab[49]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[50]
#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[51]
#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[52]
#define __pyx_kp_u_r_2 __pyx_string_tab[53]
#define __pyx_kp_u_readbuf_mmap __pyx_string_tab[54]
#define __pyx_kp_u_readelems __pyx_string_tab[55]
#define __pyx_kp_u_reading_elements_from __pyx_string_tab[56]
#define __pyx_kp_u_seek_2 __pyx_string_tab[57]
#define __pyx_kp_u_seekelem __pyx_string_tab[58]
#define __pyx_kp_u_should_be __pyx_string_tab[59]
#define __pyx_kp_u_sp_size __pyx_string_tab[60]
#define __pyx_kp_u_spacing_bufsize __pyx_string_tab[61]
#define __pyx_kp_u_tell_2 __pyx_string_tab[62]
#define __pyx_kp_u_test_gz __pyx_string_tab[63]
#define __pyx_kp_u_tree_fragment __pyx_string_tab[64]
#define __pyx_kp_u_w_2 __pyx_string_tab[65]
#define __pyx_kp_u_x_x __pyx_string_tab[66]
#define __pyx_n_u_BytesIO __pyx_string_tab[67]
#define __pyx_n_u_Error __pyx_string_tab[68]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[69]
#define __pyx_n_u_RUSAGE_SELF __pyx_string_tab[70]
#define __pyx_n_u_ReadBuffer __pyx_string_tab[71]
#define __pyx_n_u_ReadBuffer___reduce_cython __pyx_string_tab[72]
#define __pyx_n_u_ReadBuffer___setstate_cython __pyx_string_tab[73]
#define __pyx_n_u_ReadBuffer_resize __pyx_string_tab[74]
#define __pyx_n_u_Thread __pyx_string_tab[75]
#define __pyx_n_u__2 __pyx_string_tab[76]
#define __pyx_n_u_a __pyx_string_tab[77]
#define __pyx_n_u_all __pyx_string_tab[78]
#define __pyx_n_u_arange __pyx_string_tab[79]
#define __pyx_n_u_args __pyx_string_tab[80]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[81]
#define __pyx_n_u_bmode __pyx_string_tab[82]
#define __pyx_n_u_buf __pyx_string_tab[83]
#define __pyx_n_u_bufSize __pyx_string_tab[84]
#define __pyx_n_u_buffer __pyx_string_tab[85]
#define __pyx_n_u_bufsize __pyx_string_tab[86]
#define __pyx_n_u_bufsizes __pyx_string_tab[87]
#define __pyx_n_u_cfid __pyx_string_tab[88]
#define __pyx_n_u_check_data_valid __pyx_string_tab[89]
#define __pyx_n_u_cidxfid __pyx_string_tab[90]
#define __pyx_n_u_cinit___locals_initmem __pyx_string_tab[91]
#define __pyx_n_u_cinit___locals_lambda __pyx_string_tab[92]
#define __pyx_n_u_class_getitem __pyx_string_tab[93]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[94]
#define __pyx_n_u_close __pyx_string_tab[95]
#define __pyx_n_u_cmode __pyx_string_tab[96]
#define __pyx_n_u_cmpdata __pyx_string_tab[97]
#define __pyx_n_u_compress_inmem __pyx_string_tab[98]
#define __pyx_n_u_concat __pyx_string_tab[99]
#define __pyx_n_u_concatenate __pyx_string_tab[100]
#define __pyx_n_u_contextlib __pyx_string_tab[101]
#define __pyx_n_u_copy __pyx_string_tab[102]
#define __pyx_n_u_curelem __pyx_string_tab[103]
#define __pyx_n_u_data __pyx_string_tab[104]
#define __pyx_n_u_dsize __pyx_string_tab[105]
#define __pyx_n_u_dtype __pyx_string_tab[106]
#define __pyx_n_u_elems_read __pyx_string_tab[107]
#define __pyx_n_u_elems_written __pyx_string_tab[108]
#define __pyx_n_u_encode __pyx_string_tab[109]
#define __pyx_n_u_end __pyx_string_tab[110]
#define __pyx_n_u_enter __pyx_string_tab[111]
#define __pyx_n_u_enumerate __pyx_string_tab[112]
#define __pyx_n_u_eof __pyx_string_tab[113]
#define __pyx_n_u_error_fn __pyx_string_tab[114]
#define __pyx_n_u_exists __pyx_string_tab[115]
#define __pyx_n_u_exit __pyx_string_tab[116]
#define __pyx_n_u_exp __pyx_string_tab[117]
#define __pyx_n_u_expect_build __pyx_string_tab[118]
#define __pyx_n_u_expect_read __pyx_string_tab[119]
#define __pyx_n_u_expect_seek __pyx_string_tab[120]
#define __pyx_n_u_expected __pyx_string_tab[121]
#define __pyx_n_u_expread_2 __pyx_string_tab[122]
#define __pyx_n_u_expseek_2 __pyx_string_tab[123]
#define __pyx_n_u_exptell_2 __pyx_string_tab[124]
#define __pyx_n_u_expval __pyx_string_tab[125]
#define __pyx_n_u_f __pyx_string_tab[126]
#define __pyx_n_u_filename __pyx_string_tab[127]
#define __pyx_n_u_fileno __pyx_string_tab[128]
#define __pyx_n_u_files __pyx_string_tab[129]
#define __pyx_n_u_filesize __pyx_string_tab[130]
#define __pyx_n_u_flag __pyx_string_tab[131]
#define __pyx_n_u_flags __pyx_string_tab[132]
#define __pyx_n_u_flush __pyx_string_tab[133]
#define __pyx_n_u_fn __pyx_string_tab[134]
#define __pyx_n_u_format __pyx_string_tab[135]
#define __pyx_n_u_frombuffer __pyx_string_tab[136]
#define __pyx_n_u_fsize __pyx_string_tab[137]
#define __pyx_n_u_func __pyx_string_tab[138]
#define __pyx_n_u_getrusage __pyx_string_tab[139]
#define __pyx_n_u_getstate __pyx_string_tab[140]
#define __pyx_n_u_got __pyx_string_tab[141]
#define __pyx_n_u_gotread_2 __pyx_string_tab[142]
#define __pyx_n_u_gottell_2 __pyx_string_tab[143]
#define __pyx_n_u_gzip __pyx_string_tab[144]
#define __pyx_n_u_hashlib __pyx_string_tab[145]
#define __pyx_n_u_i __pyx_string_tab[146]
#define __pyx_n_u_id __pyx_string_tab[147]
#define __pyx_n_u_index __pyx_string_tab[148]
#define __pyx_n_u_index1 __pyx_string_tab[149]
#define __pyx_n_u_index2 __pyx_string_tab[150]
#define __pyx_n_u_indexSpacing __pyx_string_tab[151]
#define __pyx_n_u_indexed_gzip_tests_ctest_zran __pyx_string_tab[152]
#define __pyx_n_u_initmem __pyx_string_tab[153]
#define __pyx_n_u_inp __pyx_string_tab[154]
#define __pyx_n_u_io __pyx_string_tab[155]
#define __pyx_n_u_is_alive __pyx_string_tab[156]
#define __pyx_n_u_is_coroutine __pyx_string_tab[157]
#define __pyx_n_u_it __pyx_string_tab[158]
#define __pyx_n_u_items __pyx_string_tab[159]
#define __pyx_n_u_iters __pyx_string_tab[160]
#define __pyx_n_u_itertools __pyx_string_tab[161]
#define __pyx_n_u_kwargs __pyx_string_tab[162]
#define __pyx_n_u_lambda __pyx_string_tab[163]
#define __pyx_n_u_last __pyx_string_tab[164]
#define __pyx_n_u_main __pyx_string_tab[165]
#define __pyx_n_u_mem __pyx_string_tab[166]
#define __pyx_n_u_mkstemp __pyx_string_tab[167]
#define __pyx_n_u_mode __pyx_string_tab[168]
#define __pyx_n_u_modes __pyx_string_tab[169]
#define __pyx_n_u_module __pyx_string_tab[170]
#define __pyx_n_u_name __pyx_string_tab[171]
#define __pyx_n_u_nbytes_2 __pyx_string_tab[172]
#define __pyx_n_u_nelems_2 __pyx_string_tab[173]
#define __pyx_n_u_nelemsp __pyx_string_tab[174]
#define __pyx_n_u_niters __pyx_string_tab[175]
#define __pyx_n_u_no_fds __pyx_string_tab[176]
#define __pyx_n_u_np __pyx_string_tab[177]
#define __pyx_n_u_numpy __pyx_string_tab[178]
#define __pyx_n_u_off __pyx_string_tab[179]
#define __pyx_n_u_op __pyx_string_tab[180]
#define __pyx_n_u_open __pyx_string_tab[181]
#define __pyx_n_u_os __pyx_string_tab[182]
#define __pyx_n_u_os_path __pyx_string_tab[183]
#define __pyx_n_u_out __pyx_string_tab[184]
#define __pyx_n_u_output __pyx_string_tab[185]
#define __pyx_n_u_pad __pyx_string_tab[186]
#define __pyx_n_u_paddedcmpdata __pyx_string_tab[187]
#define __pyx_n_u_padding __pyx_string_tab[188]
#define __pyx_n_u_padoff __pyx_string_tab[189]
#define __pyx_n_u_path __pyx_string_tab[190]
#define __pyx_n_u_poll __pyx_string_tab[191]
#define __pyx_n_u_pop __pyx_string_tab[192]
#define __pyx_n_u_print __pyx_string_tab[193]
#define __pyx_n_u_product __pyx_string_tab[194]
#define __pyx_n_u_pybuf __pyx_string_tab[195]
#define __pyx_n_u_pyexportfid __pyx_string_tab[196]
#define __pyx_n_u_pyfid __pyx_string_tab[197]
#define __pyx_n_u_pyidxfid __pyx_string_tab[198]
#define __pyx_n_u_pyx_state __pyx_string_tab[199]
#define __pyx_n_u_qualname __pyx_string_tab[200]
#define __pyx_n_u_r __pyx_string_tab[201]
#define __pyx_n_u_randint __pyx_string_tab[202]
#define __pyx_n_u_random __pyx_string_tab[203]
#define __pyx_n_u_rawdata __pyx_string_tab[204]
#define __pyx_n_u_rb __pyx_string_tab[205]
#define __pyx_n_u_read __pyx_string_tab[206]
#define __pyx_n_u_readbufSize __pyx_string_tab[207]
#define __pyx_n_u_readbuf_size __pyx_string_tab[208]
#define __pyx_n_u_readbuf_sizes __pyx_string_tab[209]
#define __pyx_n_u_readelems_2 __pyx_string_tab[210]
#define __pyx_n_u_reduce __pyx_string_tab[211]
#define __pyx_n_u_reduce_cython __pyx_string_tab[212]
#define __pyx_n_u_reduce_ex __pyx_string_tab[213]
#define __pyx_n_u_remove __pyx_string_tab[214]
#define __pyx_n_u_resize __pyx_string_tab[215]
#define __pyx_n_u_resource __pyx_string_tab[216]
#define __pyx_n_u_result __pyx_string_tab[217]
#define __pyx_n_u_ret __pyx_string_tab[218]
#define __pyx_n_u_return_fn __pyx_string_tab[219]
#define __pyx_n_u_return_fn_locals_lambda __pyx_string_tab[220]
#define __pyx_n_u_return_value __pyx_string_tab[221]
#define __pyx_n_u_ru_maxrss __pyx_string_tab[222]
#define __pyx_n_u_run_crc_tests __pyx_string_tab[223]
#define __pyx_n_u_s __pyx_string_tab[224]
#define __pyx_n_u_sbi __pyx_string_tab[225]
#define __pyx_n_u_se __pyx_string_tab[226]
#define __pyx_n_u_seed __pyx_string_tab[227]
#define __pyx_n_u_seek __pyx_string_tab[228]
#define __pyx_n_u_seek_point __pyx_string_tab[229]
#define __pyx_n_u_seek_points __pyx_string_tab[230]
#define __pyx_n_u_seekable __pyx_string_tab[231]
#define __pyx_n_u_seekelems __pyx_string_tab[232]
#define __pyx_n_u_seekloc __pyx_string_tab[233]
#define __pyx_n_u_seekpoints __pyx_string_tab[234]
#define __pyx_n_u_seekstep __pyx_string_tab[235]
#define __pyx_n_u_self __pyx_string_tab[236]
#define __pyx_n_u_set_name __pyx_string_tab[237]
#define __pyx_n_u_setdefault __pyx_string_tab[238]
#define __pyx_n_u_setstate __pyx_string_tab[239]
#define __pyx_n_u_setstate_cython __pyx_string_tab[240]
#define __pyx_n_u_shouldpass __pyx_string_tab[241]
#define __pyx_n_u_shutil __pyx_string_tab[242]
#define __pyx_n_u_size __pyx_string_tab[243]
#define __pyx_n_u_sort __pyx_string_tab[244]
#define __pyx_n_u_sp __pyx_string_tab[245]
#define __pyx_n_u_spacing __pyx_string_tab[246]
#define __pyx_n_u_spacings __pyx_string_tab[247]
#define __pyx_n_u_st_size __pyx_string_tab[248]
#define __pyx_n_u_start __pyx_string_tab[249]
#define __pyx_n_u_stat __pyx_string_tab[250]
#define __pyx_n_u_strm __pyx_string_tab[251]
#define __pyx_n_u_strmoffs __pyx_string_tab[252]
#define __pyx_n_u_subprocess __pyx_string_tab[253]
#define __pyx_n_u_sum __pyx_string_tab[254]
#define __pyx_n_u_sys __pyx_string_tab[255]
#define __pyx_n_u_target __pyx_string_tab[256]
#define __pyx_n_u_tell __pyx_string_tab[257]
#define __pyx_n_u_tempdir __pyx_string_tab[258]
#define __pyx_n_u_tempfile __pyx_string_tab[259]
#define __pyx_n_u_test __pyx_string_tab[260]
#define __pyx_n_u_test_build_then_read __pyx_string_tab[261]
#define __pyx_n_u_test_crc_validation __pyx_string_tab[262]
#define __pyx_n_u_test_crc_validation_locals__run __pyx_string_tab[263]
#define __pyx_n_u_test_crc_validation_locals__zran __pyx_string_tab[264]
#define __pyx_n_u_test_crc_validation_locals_wrap __pyx_string_tab[265]
#define __pyx_n_u_test_export_import_format_v0 __pyx_string_tab[266]
#define __pyx_n_u_test_export_import_no_points __pyx_string_tab[267]
#define __pyx_n_u_test_export_then_import __pyx_string_tab[268]
#define __pyx_n_u_test_feof __pyx_string_tab[269]
#define __pyx_n_u_test_ferror __pyx_string_tab[270]
#define __pyx_n_u_test_fflush __pyx_string_tab[271]
#define __pyx_n_u_test_fread __pyx_string_tab[272]
#define __pyx_n_u_test_fseek __pyx_string_tab[273]
#define __pyx_n_u_test_ftell __pyx_string_tab[274]
#define __pyx_n_u_test_fwrite __pyx_string_tab[275]
#define __pyx_n_u_test_getc __pyx_string_tab[276]
#define __pyx_n_u_test_inflateInit_leak_on_error __pyx_string_tab[277]
#define __pyx_n_u_test_init __pyx_string_tab[278]
#define __pyx_n_u_test_init_file_modes __pyx_string_tab[279]
#define __pyx_n_u_test_no_auto_build __pyx_string_tab[280]
#define __pyx_n_u_test_random_seek __pyx_string_tab[281]
#define __pyx_n_u_test_random_seek_and_read __pyx_string_tab[282]
#define __pyx_n_u_test_read_all __pyx_string_tab[283]
#define __pyx_n_u_test_read_all_sequential __pyx_string_tab[284]
#define __pyx_n_u_test_read_eof_memmove_rotate_bug __pyx_string_tab[285]
#define __pyx_n_u_test_readbuf_spacing_sizes __pyx_string_tab[286]
#define __pyx_n_u_test_seek_beyond_end __pyx_string_tab[287]
#define __pyx_n_u_test_seek_cur __pyx_string_tab[288]
#define __pyx_n_u_test_seek_end __pyx_string_tab[289]
#define __pyx_n_u_test_seek_then_read_block __pyx_string_tab[290]
#define __pyx_n_u_test_seek_to_end __pyx_string_tab[291]
#define __pyx_n_u_test_seekable __pyx_string_tab[292]
#define __pyx_n_u_test_seekable_locals_lambda __pyx_string_tab[293]
#define __pyx_n_u_test_sequential_seek_to_end __pyx_string_tab[294]
#define __pyx_n_u_test_skip_crc_with_footer_that_l __pyx_string_tab[295]
#define __pyx_n_u_test_skip_crc_with_footer_that_l_2 __pyx_string_tab[296]
#define __pyx_n_u_test_standard_usage_with_null_pa __pyx_string_tab[297]
#define __pyx_n_u_test_standard_usage_with_null_pa_2 __pyx_string_tab[298]
#define __pyx_n_u_testfile __pyx_string_tab[299]
#define __pyx_n_u_threading __pyx_string_tab[300]
#define __pyx_n_u_time __pyx_string_tab[301]
#define __pyx_n_u_tobytes __pyx_string_tab[302]
#define __pyx_n_u_towrite __pyx_string_tab[303]
#define __pyx_n_u_uint32 __pyx_string_tab[304]
#define __pyx_n_u_uint64 __pyx_string_tab[305]
#define __pyx_n_u_uint8 __pyx_string_tab[306]
#define __pyx_n_u_use_mmap __pyx_string_tab[307]
#define __pyx_n_u_val __pyx_string_tab[308]
#define __pyx_n_u_values __pyx_string_tab[309]
#define __pyx_n_u_version_info __pyx_string_tab[310]
#define __pyx_n_u_w __pyx_string_tab[311]
#define __pyx_n_u_wb __pyx_string_tab[312]
#define __pyx_n_u_windowSize __pyx_string_tab[313]
#define __pyx_n_u_window_sizes __pyx_string_tab[314]
#define __pyx_n_u_wrap __pyx_string_tab[315]
#define __pyx_n_u_write __pyx_string_tab[316]
#define __pyx_n_u_zeros __pyx_string_tab[317]
#define __pyx_n_u_zip __pyx_string_tab[318]
#define __pyx_n_u_zran_init __pyx_string_tab[319]
#define __pyx_n_u_zs __pyx_string_tab[320]
#define __pyx_n_u_zt __pyx_string_tab[321]
#define __pyx_kp_b_GZIDX __pyx_string_tab[322]
#define __pyx_kp_b_iso88591_1 __pyx_string_tab[323]
#define __pyx_kp_b_iso88591_1A __pyx_string_tab[324]
#define __pyx_kp_b_iso88591_1_1_1_1_Qj_vQe7_a_xz_1_a_Yl_x_Q __pyx_string_tab[325]
#define __pyx_kp_b_iso88591_1_2 __pyx_string_tab[326]
#define __pyx_kp_b_iso88591_2WHAS_YfBa_a_1_V1D_Zq_6_wd_8_Q __pyx_string_tab[327]
#define __pyx_kp_b_iso88591_31_1_q_q_1_q_q_q_j_q_1AWCq_t3nA __pyx_string_tab[328]
#define __pyx_kp_b_iso88591_7_882Qa_7_a_1_V1D_r_az_vRq_Ya_6 __pyx_string_tab[329]
#define __pyx_kp_b_iso88591_7_A_axy_1_1IRq_Rq_Rq_Rq_Rq_Rq_Q __pyx_string_tab[330]
#define __pyx_kp_b_iso88591_7_A_axy_1_at7_Cs_1_Qj_vQe7_a_xz __pyx_string_tab[331]
#define __pyx_kp_b_iso88591_7_A_axy_1_at7_Cs_1_Qj_vQe7_a_xz_2 __pyx_string_tab[332]
#define __pyx_kp_b_iso88591_7_A_ay_A_1_Qa_3a_Qj_vQe7_a_xz_1 __pyx_string_tab[333]
#define __pyx_kp_b_iso88591_AS_wgXYiq_AS_gWG1_AS_gWG7_AWA_Q __pyx_string_tab[334]
#define __pyx_kp_b_iso88591_AU_V5_AZq_QgQ_IQ_t7_q_vQe7_a_uL __pyx_string_tab[335]
#define __pyx_kp_b_iso88591_A_4q_Qa_m1D_4q_Qa_Ja_Ja __pyx_string_tab[336]
#define __pyx_kp_b_iso88591_A_G1A_xz_1_Q_q __pyx_string_tab[337]
#define __pyx_kp_b_iso88591_A_hb_r_uI_r_s_1_fAT_ha __pyx_string_tab[338]
#define __pyx_kp_b_iso88591_A_t2Q __pyx_string_tab[339]
#define __pyx_kp_b_iso88591_A_waq_xz_1_Qaq __pyx_string_tab[340]
#define __pyx_kp_b_iso88591_G81Cz_r_E_axy_1_Qj_vQe7_a_xz_1 __pyx_string_tab[341]
#define __pyx_kp_b_iso88591_Q __pyx_string_tab[342]
#define __pyx_kp_b_iso88591_Rwhas_uF_A_Zq_S_a_1_V1D_Zq_6_wd __pyx_string_tab[343]
#define __pyx_kp_b_iso88591_U_3fBa_at84q_1_1_b_xq_5_1A_IQc __pyx_string_tab[344]
#define __pyx_kp_b_iso88591_U_3fBa_awhd_9A_we1_t1D_Rq_6_we1 __pyx_string_tab[345]
#define __pyx_kp_b_iso88591__5 __pyx_string_tab[346]
#define __pyx_kp_b_iso88591_b __pyx_string_tab[347]
#define __pyx_kp_b_iso88591_b_xq_5_b_nAWHD_Qa_a_vQ_j_1AWCq __pyx_string_tab[348]
#define __pyx_kp_b_iso88591_q_Cs_1E_Cq_D_1_1E_Cq_CuA_1E_Cq __pyx_string_tab[349]
#define __pyx_kp_b_iso88591_q_Cs_1L_Cs_q_Cs __pyx_string_tab[350]
#define __pyx_kp_b_iso88591_q_Q_Cs_aq__A_4q__A_3a_1 __pyx_string_tab[351]
#define __pyx_kp_b_iso88591_q_Q_s_A_1E_Cq_Cs_U_1_1E_Cq_az_S __pyx_string_tab[352]
#define __pyx_kp_b_iso88591_q_Qe3c_A_c_1E_Cq_3ar_Cq_Cs_az_1 __pyx_string_tab[353]
#define __pyx_kp_b_iso88591_q_T_BgQc_BfAWF_A_Q_xz_1_Q_Qawd __pyx_string_tab[354]
#define __pyx_kp_b_iso88591_q_U_1_a_S_1_a_S_1_Cs __pyx_string_tab[355]
#define __pyx_kp_b_iso88591_q_a_WA_Cs_a_WA_Cs_a_WA_Cs_a_T_C __pyx_string_tab[356]
#define __pyx_kp_b_iso88591_q_c_A_c_A __pyx_string_tab[357]
#define __pyx_kp_b_iso88591_q_q_1_1_XWCq_b_A_i_9ARxq_IQ_8_q __pyx_string_tab[358]
#define __pyx_kp_b_iso88591_q_q_3c_U_1_q_3c_Cs_az_1_1Ks_a __pyx_string_tab[359]
#define __pyx_kp_b_iso88591_r_axy_1_Qj_2WHAS_r_HF_A_Cq_Qj_v __pyx_string_tab[360]
#define __pyx_kp_b_iso88591_wb_1F_3j_E_aq_axy_1_Qj_vQe7_a_x __pyx_string_tab[361]
#define __pyx_kp_b_iso88591_wb_2WHAS_axy_1_Qj_vQe7_a_xz_1_a __pyx_string_tab[362]
#define __pyx_kp_b_iso88591_wb_9Ba_axy_1_Qj_vQe7_a_xz_1_a_Y __pyx_string_tab[363]
#define __pyx_kp_b_iso88591_wb_axy_1_Qj_2WHAS_r_F_Cq_Qj_vQe __pyx_string_tab[364]
#define __pyx_kp_b_iso88591_wb_axy_1_WBc_b_q_Qj_vQe7_a_xz_1 __pyx_string_tab[365]
#define __pyx_kp_b_iso88591_wb_axy_1_Zq_1_S_Qj_vQe7_a_xz_1 __pyx_string_tab[366]
#define __pyx_n_b_abc __pyx_string_tab[367]
#define __pyx_n_b_dbc __pyx_string_tab[368]
#define __pyx_n_b_dec __pyx_string_tab[369]
#define __pyx_int_0 __pyx_number_tab[0]
#define __pyx_int_1 __pyx_number_tab[1]
#define __pyx_int_2 __pyx_number_tab[2]
#define __pyx_int_3 __pyx_number_tab[3]
#define __pyx_int_4 __pyx_number_tab[4]
#define __pyx_int_5 __pyx_number_tab[5]
#define __pyx_int_8 __pyx_number_tab[6]
#define __pyx_int_10 __pyx_number_tab[7]
#define __pyx_int_100 __pyx_number_tab[8]
#define __pyx_int_255 __pyx_number_tab[9]
#define __pyx_int_500 __pyx_number_tab[10]
#define __pyx_int_1000 __pyx_number_tab[11]
#define __pyx_int_1500 __pyx_number_tab[12]
#define __pyx_int_2000 __pyx_number_tab[13]
#define __pyx_int_5000 __pyx_number_tab[14]
#define __pyx_int_8192 __pyx_number_tab[15]
#define __pyx_int_10000 __pyx_number_tab[16]
#define __pyx_int_16384 __pyx_number_tab[17]
#define __pyx_int_24576 __pyx_number_tab[18]
#define __pyx_int_32768 __pyx_number_tab[19]
#define __pyx_int_65536 __pyx_number_tab[20]
#define __pyx_int_131072 __pyx_number_tab[21]
#define __pyx_int_262144 __pyx_number_tab[22]
#define __pyx_int_524288 __pyx_number_tab[23]
#define __pyx_int_525000 __pyx_number_tab[24]
#define __pyx_int_1000000 __pyx_number_tab[25]
#define __pyx_int_1048575 __pyx_number_tab[26]
#define __pyx_int_1048576 __pyx_number_tab[27]
#define __pyx_int_1048577 __pyx_number_tab[28]
#define __pyx_int_2097152 __pyx_number_tab[29]
#define __pyx_int_4194304 __pyx_number_tab[30]
#define __pyx_int_8388608 __pyx_number_tab[31]
#define __pyx_int_10485760 __pyx_number_tab[32]
#define __pyx_int_12152630 __pyx_number_tab[33]
/* #### 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_5numpy_dtype);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
  Py_CLEAR(clear_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer);
  Py_CLEAR(clear_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran_ReadBuffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults);
  Py_CLEAR(clear_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_defaults);
  Py_CLEAR(clear_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__);
  Py_CLEAR(clear_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__);
  Py_CLEAR(clear_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn);
  Py_CLEAR(clear_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn);
  Py_CLEAR(clear_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation);
  Py_CLEAR(clear_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation);
  Py_CLEAR(clear_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding);
  Py_CLEAR(clear_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding);
  Py_CLEAR(clear_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream);
  Py_CLEAR(clear_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream);
  for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
  for (int i=0; i<12; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<46; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<370; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<34; ++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);

/* CythonFunctionShared.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_5numpy_dtype);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
  Py_VISIT(traverse_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer);
  Py_VISIT(traverse_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran_ReadBuffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults);
  Py_VISIT(traverse_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_defaults);
  Py_VISIT(traverse_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__);
  Py_VISIT(traverse_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__);
  Py_VISIT(traverse_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn);
  Py_VISIT(traverse_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn);
  Py_VISIT(traverse_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation);
  Py_VISIT(traverse_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation);
  Py_VISIT(traverse_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding);
  Py_VISIT(traverse_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding);
  Py_VISIT(traverse_module_state->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream);
  Py_VISIT(traverse_module_state->__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream);
  for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
  for (int i=0; i<12; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<46; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<370; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<34; ++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);

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

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":243
 *         cdef int type_num
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp itemsize(self) noexcept nogil:
 *             return PyDataType_ELSIZE(self)
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":245
 *         @property
 *         cdef inline npy_intp itemsize(self) noexcept nogil:
 *             return PyDataType_ELSIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":243
 *         cdef int type_num
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp itemsize(self) noexcept nogil:
 *             return PyDataType_ELSIZE(self)
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
 *             return PyDataType_ELSIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp alignment(self) noexcept nogil:
 *             return PyDataType_ALIGNMENT(self)
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":249
 *         @property
 *         cdef inline npy_intp alignment(self) noexcept nogil:
 *             return PyDataType_ALIGNMENT(self)             # <<<<<<<<<<<<<<
 * 
 *         # Use fields/names with care as they may be NULL.  You must check
*/
  __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
 *             return PyDataType_ELSIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp alignment(self) noexcept nogil:
 *             return PyDataType_ALIGNMENT(self)
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
 *         # Use fields/names with care as they may be NULL.  You must check
 *         # for this using PyDataType_HASFIELDS.
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object fields(self):
 *             return <object>PyDataType_FIELDS(self)
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("fields", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
 *         @property
 *         cdef inline object fields(self):
 *             return <object>PyDataType_FIELDS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
 *         # Use fields/names with care as they may be NULL.  You must check
 *         # for this using PyDataType_HASFIELDS.
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object fields(self):
 *             return <object>PyDataType_FIELDS(self)
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
 *             return <object>PyDataType_FIELDS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline tuple names(self):
 *             return <tuple>PyDataType_NAMES(self)
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("names", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
 *         @property
 *         cdef inline tuple names(self):
 *             return <tuple>PyDataType_NAMES(self)             # <<<<<<<<<<<<<<
 * 
 *         # Use PyDataType_HASSUBARRAY to test whether this field is
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
  __Pyx_INCREF(((PyObject*)__pyx_t_1));
  __pyx_r = ((PyObject*)__pyx_t_1);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
 *             return <object>PyDataType_FIELDS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline tuple names(self):
 *             return <tuple>PyDataType_NAMES(self)
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":264
 *         # valid (the pointer can be NULL). Most users should access
 *         # this field via the inline helper method PyDataType_SHAPE.
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
 *             return PyDataType_SUBARRAY(self)
*/

static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
  PyArray_ArrayDescr *__pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":266
 *         @property
 *         cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
 *             return PyDataType_SUBARRAY(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":264
 *         # valid (the pointer can be NULL). Most users should access
 *         # this field via the inline helper method PyDataType_SHAPE.
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
 *             return PyDataType_SUBARRAY(self)
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":268
 *             return PyDataType_SUBARRAY(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_uint64 flags(self) noexcept nogil:
 *             """The data types flags."""
*/

static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
  npy_uint64 __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":271
 *         cdef inline npy_uint64 flags(self) noexcept nogil:
 *             """The data types flags."""
 *             return PyDataType_FLAGS(self)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyDataType_FLAGS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":268
 *             return PyDataType_SUBARRAY(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_uint64 flags(self) noexcept nogil:
 *             """The data types flags."""
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
 *     ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int numiter(self) noexcept nogil:
 *             """The number of arrays that need to be broadcast to the same shape."""
*/

static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":283
 *         cdef inline int numiter(self) noexcept nogil:
 *             """The number of arrays that need to be broadcast to the same shape."""
 *             return PyArray_MultiIter_NUMITER(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
 *     ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int numiter(self) noexcept nogil:
 *             """The number of arrays that need to be broadcast to the same shape."""
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":285
 *             return PyArray_MultiIter_NUMITER(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """The total broadcasted size."""
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":288
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """The total broadcasted size."""
 *             return PyArray_MultiIter_SIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":285
 *             return PyArray_MultiIter_NUMITER(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """The total broadcasted size."""
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":290
 *             return PyArray_MultiIter_SIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp index(self) noexcept nogil:
 *             """The current (1-d) index into the broadcasted result."""
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":293
 *         cdef inline npy_intp index(self) noexcept nogil:
 *             """The current (1-d) index into the broadcasted result."""
 *             return PyArray_MultiIter_INDEX(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":290
 *             return PyArray_MultiIter_SIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp index(self) noexcept nogil:
 *             """The current (1-d) index into the broadcasted result."""
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
 *             return PyArray_MultiIter_INDEX(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int nd(self) noexcept nogil:
 *             """The number of dimensions in the broadcasted result."""
*/

static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":298
 *         cdef inline int nd(self) noexcept nogil:
 *             """The number of dimensions in the broadcasted result."""
 *             return PyArray_MultiIter_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
 *             return PyArray_MultiIter_INDEX(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int nd(self) noexcept nogil:
 *             """The number of dimensions in the broadcasted result."""
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
 *             return PyArray_MultiIter_NDIM(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp* dimensions(self) noexcept nogil:
 *             """The shape of the broadcasted result."""
*/

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":303
 *         cdef inline npy_intp* dimensions(self) noexcept nogil:
 *             """The shape of the broadcasted result."""
 *             return PyArray_MultiIter_DIMS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
 *             return PyArray_MultiIter_NDIM(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp* dimensions(self) noexcept nogil:
 *             """The shape of the broadcasted result."""
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
 *             return PyArray_MultiIter_DIMS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline void** iters(self) noexcept nogil:
 *             """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
*/

static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
  void **__pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":309
 *             """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
 *             On return, the iterators are adjusted for broadcasting."""
 *             return PyArray_MultiIter_ITERS(self)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
 *             return PyArray_MultiIter_DIMS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline void** iters(self) noexcept nogil:
 *             """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":323
 *         # Instead, we use properties that map to the corresponding C-API functions.
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline PyObject* base(self) noexcept nogil:
 *             """Returns a borrowed reference to the object owning the data/memory.
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
  PyObject *__pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":327
 *             """Returns a borrowed reference to the object owning the data/memory.
 *             """
 *             return PyArray_BASE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_BASE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":323
 *         # Instead, we use properties that map to the corresponding C-API functions.
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline PyObject* base(self) noexcept nogil:
 *             """Returns a borrowed reference to the object owning the data/memory.
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":329
 *             return PyArray_BASE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline dtype descr(self):
 *             """Returns an owned reference to the dtype of the array.
*/

static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
  PyArray_Descr *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyArray_Descr *__pyx_t_1;
  __Pyx_RefNannySetupContext("descr", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":333
 *             """Returns an owned reference to the dtype of the array.
 *             """
 *             return <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
  __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
  __pyx_r = ((PyArray_Descr *)__pyx_t_1);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":329
 *             return PyArray_BASE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline dtype descr(self):
 *             """Returns an owned reference to the dtype of the array.
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
 *             return <dtype>PyArray_DESCR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int ndim(self) noexcept nogil:
 *             """Returns the number of dimensions in the array.
*/

static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":339
 *             """Returns the number of dimensions in the array.
 *             """
 *             return PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_NDIM(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
 *             return <dtype>PyArray_DESCR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int ndim(self) noexcept nogil:
 *             """Returns the number of dimensions in the array.
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
 *             return PyArray_NDIM(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *shape(self) noexcept nogil:
 *             """Returns a pointer to the dimensions/shape of the array.
*/

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
 *             Can return NULL for 0-dimensional arrays.
 *             """
 *             return PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_DIMS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
 *             return PyArray_NDIM(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *shape(self) noexcept nogil:
 *             """Returns a pointer to the dimensions/shape of the array.
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":349
 *             return PyArray_DIMS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *strides(self) noexcept nogil:
 *             """Returns a pointer to the strides of the array.
*/

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":354
 *             The number of elements matches the number of dimensions of the array (ndim).
 *             """
 *             return PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_STRIDES(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":349
 *             return PyArray_DIMS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *strides(self) noexcept nogil:
 *             """Returns a pointer to the strides of the array.
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":356
 *             return PyArray_STRIDES(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """Returns the total size (in number of elements) of the array.
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":360
 *             """Returns the total size (in number of elements) of the array.
 *             """
 *             return PyArray_SIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_SIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":356
 *             return PyArray_STRIDES(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """Returns the total size (in number of elements) of the array.
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":362
 *             return PyArray_SIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline char* data(self) noexcept nogil:
 *             """The pointer to the data buffer as a char*.
*/

static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
  char *__pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":369
 *             of `PyArray_DATA()` instead, which returns a 'void*'.
 *             """
 *             return PyArray_BYTES(self)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyArray_BYTES(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":362
 *             return PyArray_SIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline char* data(self) noexcept nogil:
 *             """The pointer to the data buffer as a char*.
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":777
 * ctypedef long double complex clongdouble_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  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("PyArray_MultiIterNew1", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":778
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":777
 * ctypedef long double complex clongdouble_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  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("PyArray_MultiIterNew2", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":781
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  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("PyArray_MultiIterNew3", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":784
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  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("PyArray_MultiIterNew4", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":787
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":789
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  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("PyArray_MultiIterNew5", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":790
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":789
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":792
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":793
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
*/
  __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
  if (__pyx_t_1) {

    /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
 *     else:
 *         return ()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
    __Pyx_INCREF(((PyObject*)__pyx_t_2));
    __pyx_r = ((PyObject*)__pyx_t_2);
    goto __pyx_L0;

    /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":793
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
*/
  }

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":796
 *         return <tuple>d.subarray.shape
 *     else:
 *         return ()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
    __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":792
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":995
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base) except *:             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
*/

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":996
 * 
 * cdef inline void set_array_base(ndarray arr, object base) except *:
 *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
 *     PyArray_SetBaseObject(arr, base)
 * 
*/
  Py_INCREF(__pyx_v_base);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":997
 * cdef inline void set_array_base(ndarray arr, object base) except *:
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
*/
  __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 997, __pyx_L1_error)

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":995
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base) except *:             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":999
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_base;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1000
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
 *     if base is NULL:
 *         return None
*/
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1001
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
*/
  __pyx_t_1 = (__pyx_v_base == NULL);
  if (__pyx_t_1) {

    /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1002
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     return <object>base
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1001
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
*/
  }

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1003
 *     if base is NULL:
 *         return None
 *     return <object>base             # <<<<<<<<<<<<<<
 * 
 * # Versions of the import_* functions which are more suitable for
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_base));
  __pyx_r = ((PyObject *)__pyx_v_base);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":999
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1007
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
*/

static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_array", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1008
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1009
 * cdef inline int import_array() except -1:
 *     try:
 *         __pyx_import_array()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy._core.multiarray failed to import")
*/
      __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1009, __pyx_L3_error)

      /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1008
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1010
 *     try:
 *         __pyx_import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy._core.multiarray failed to import")
 * 
*/
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1010, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1011
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy._core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
*/
      __pyx_t_9 = NULL;
      __pyx_t_10 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1011, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 1011, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1008
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1007
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __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("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1013
 *         raise ImportError("numpy._core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_umath", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1014
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1015
 * cdef inline int import_umath() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")
*/
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1015, __pyx_L3_error)

      /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1014
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1016
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy._core.umath failed to import")
 * 
*/
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1016, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1017
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
*/
      __pyx_t_9 = NULL;
      __pyx_t_10 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1017, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 1017, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1014
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1013
 *         raise ImportError("numpy._core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __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("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1019
 *         raise ImportError("numpy._core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_ufunc", 0);

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1020
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1021
 * cdef inline int import_ufunc() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")
*/
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1021, __pyx_L3_error)

      /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1020
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1022
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy._core.umath failed to import")
 * 
*/
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1022, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1023
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_t_9 = NULL;
      __pyx_t_10 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1023, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 1023, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1020
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1019
 *         raise ImportError("numpy._core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __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("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1026
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
*/

static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1038
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1026
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1041
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
*/

static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1053
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1041
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1056
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
*/

static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
  npy_datetime __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1063
 *     also needed.  That can be found using `get_datetime64_unit`.
 *     """
 *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1056
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
*/

static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
  npy_timedelta __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1070
 *     returns the int64 value underlying scalar numpy timedelta64 object
 *     """
 *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
*/

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

/* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
*/

static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
  NPY_DATETIMEUNIT __pyx_r;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
 *     returns the unit part of the dtype for a numpy datetime64 object.
 *     """
 *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
  goto __pyx_L0;

  /* "../../../../usr/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
*/

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

/* "indexed_gzip/tests/ctest_zran.pyx":77
 * np.import_array()
 * 
 * cdef read_element(zran.zran_index_t *index, element, nelems, seek=True):             # <<<<<<<<<<<<<<
 * 
 *     cdef void *buffer
*/

static PyObject *__pyx_f_12indexed_gzip_5tests_10ctest_zran_read_element(zran_index_t *__pyx_v_index, PyObject *__pyx_v_element, PyObject *__pyx_v_nelems, struct __pyx_opt_args_12indexed_gzip_5tests_10ctest_zran_read_element *__pyx_optional_args) {
  PyObject *__pyx_v_seek = ((PyObject *)Py_True);
  void *__pyx_v_buffer;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_buf = NULL;
  int __pyx_v_expseek;
  PyObject *__pyx_v_exptell = NULL;
  int __pyx_v_gotseek;
  uint64_t __pyx_v_gottell;
  long __pyx_v_expread;
  int64_t __pyx_v_gotread;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  void *__pyx_t_4;
  int __pyx_t_5;
  int64_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_element", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_seek = __pyx_optional_args->seek;
    }
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":81
 *     cdef void *buffer
 * 
 *     buf    = ReadBuffer(8)             # <<<<<<<<<<<<<<
 *     buffer = buf.buffer
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":82
 * 
 *     buf    = ReadBuffer(8)
 *     buffer = buf.buffer             # <<<<<<<<<<<<<<
 * 
 *     if   element >= nelems: expseek = zran.ZRAN_SEEK_EOF
*/
  __pyx_t_4 = __pyx_v_buf->buffer;
  __pyx_v_buffer = __pyx_t_4;

  /* "indexed_gzip/tests/ctest_zran.pyx":84
 *     buffer = buf.buffer
 * 
 *     if   element >= nelems: expseek = zran.ZRAN_SEEK_EOF             # <<<<<<<<<<<<<<
 *     else:                   expseek = zran.ZRAN_SEEK_OK
 * 
*/
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_element, __pyx_v_nelems, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
    __pyx_v_expseek = ZRAN_SEEK_EOF;
    goto __pyx_L3;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":85
 * 
 *     if   element >= nelems: expseek = zran.ZRAN_SEEK_EOF
 *     else:                   expseek = zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 * 
 *     if   element >= nelems: exptell = (nelems * 8)
*/
  /*else*/ {
    __pyx_v_expseek = ZRAN_SEEK_OK;
  }
  __pyx_L3:;

  /* "indexed_gzip/tests/ctest_zran.pyx":87
 *     else:                   expseek = zran.ZRAN_SEEK_OK
 * 
 *     if   element >= nelems: exptell = (nelems * 8)             # <<<<<<<<<<<<<<
 *     else:                   exptell = element * 8
 * 
*/
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_element, __pyx_v_nelems, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_exptell = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":88
 * 
 *     if   element >= nelems: exptell = (nelems * 8)
 *     else:                   exptell = element * 8             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_element, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_exptell = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "indexed_gzip/tests/ctest_zran.pyx":91
 * 
 * 
 *     if seek:             # <<<<<<<<<<<<<<
 *         gotseek = zran.zran_seek(index, element * 8, SEEK_SET, NULL)
 *         gottell = zran.zran_tell(index)
*/
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_seek); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 91, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "indexed_gzip/tests/ctest_zran.pyx":92
 * 
 *     if seek:
 *         gotseek = zran.zran_seek(index, element * 8, SEEK_SET, NULL)             # <<<<<<<<<<<<<<
 *         gottell = zran.zran_tell(index)
 *         try:
*/
    __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_element, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyLong_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_gotseek = zran_seek(__pyx_v_index, __pyx_t_6, SEEK_SET, NULL);

    /* "indexed_gzip/tests/ctest_zran.pyx":93
 *     if seek:
 *         gotseek = zran.zran_seek(index, element * 8, SEEK_SET, NULL)
 *         gottell = zran.zran_tell(index)             # <<<<<<<<<<<<<<
 *         try:
 *             assert gotseek == expseek
*/
    __pyx_v_gottell = zran_tell(__pyx_v_index);

    /* "indexed_gzip/tests/ctest_zran.pyx":94
 *         gotseek = zran.zran_seek(index, element * 8, SEEK_SET, NULL)
 *         gottell = zran.zran_tell(index)
 *         try:             # <<<<<<<<<<<<<<
 *             assert gotseek == expseek
 *             assert gottell == exptell
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      /*try:*/ {

        /* "indexed_gzip/tests/ctest_zran.pyx":95
 *         gottell = zran.zran_tell(index)
 *         try:
 *             assert gotseek == expseek             # <<<<<<<<<<<<<<
 *             assert gottell == exptell
 *         except:
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __pyx_t_5 = (__pyx_v_gotseek == __pyx_v_expseek);
          if (unlikely(!__pyx_t_5)) {
            __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
            __PYX_ERR(0, 95, __pyx_L6_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 95, __pyx_L6_error)
        #endif

        /* "indexed_gzip/tests/ctest_zran.pyx":96
 *         try:
 *             assert gotseek == expseek
 *             assert gottell == exptell             # <<<<<<<<<<<<<<
 *         except:
 *             print('expseek: {}'.format(expseek))
*/
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_gottell); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exptell, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 96, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_5)) {
            __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
            __PYX_ERR(0, 96, __pyx_L6_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 96, __pyx_L6_error)
        #endif

        /* "indexed_gzip/tests/ctest_zran.pyx":94
 *         gotseek = zran.zran_seek(index, element * 8, SEEK_SET, NULL)
 *         gottell = zran.zran_tell(index)
 *         try:             # <<<<<<<<<<<<<<
 *             assert gotseek == expseek
 *             assert gottell == exptell
*/
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":97
 *             assert gotseek == expseek
 *             assert gottell == exptell
 *         except:             # <<<<<<<<<<<<<<
 *             print('expseek: {}'.format(expseek))
 *             print('exptell: {}'.format(exptell))
*/
      /*except:*/ {
        __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.read_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_10) < 0) __PYX_ERR(0, 97, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_10);

        /* "indexed_gzip/tests/ctest_zran.pyx":98
 *             assert gottell == exptell
 *         except:
 *             print('expseek: {}'.format(expseek))             # <<<<<<<<<<<<<<
 *             print('exptell: {}'.format(exptell))
 *             print('gotseek: {}'.format(gotseek))
*/
        __pyx_t_12 = NULL;
        __pyx_t_14 = __pyx_mstate_global->__pyx_kp_u_expseek;
        __Pyx_INCREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_PyLong_From___pyx_anon_enum(__pyx_v_expseek); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 98, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_15};
          __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 98, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __pyx_t_3 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "indexed_gzip/tests/ctest_zran.pyx":99
 *         except:
 *             print('expseek: {}'.format(expseek))
 *             print('exptell: {}'.format(exptell))             # <<<<<<<<<<<<<<
 *             print('gotseek: {}'.format(gotseek))
 *             print('gottell: {}'.format(gottell))
*/
        __pyx_t_13 = NULL;
        __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_exptell;
        __Pyx_INCREF(__pyx_t_15);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_exptell};
          __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 99, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_12);
        }
        __pyx_t_3 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "indexed_gzip/tests/ctest_zran.pyx":100
 *             print('expseek: {}'.format(expseek))
 *             print('exptell: {}'.format(exptell))
 *             print('gotseek: {}'.format(gotseek))             # <<<<<<<<<<<<<<
 *             print('gottell: {}'.format(gottell))
 *             raise
*/
        __pyx_t_12 = NULL;
        __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_gotseek;
        __Pyx_INCREF(__pyx_t_15);
        __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_gotseek); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 100, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_14};
          __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __pyx_t_3 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 100, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "indexed_gzip/tests/ctest_zran.pyx":101
 *             print('exptell: {}'.format(exptell))
 *             print('gotseek: {}'.format(gotseek))
 *             print('gottell: {}'.format(gottell))             # <<<<<<<<<<<<<<
 *             raise
 * 
*/
        __pyx_t_13 = NULL;
        __pyx_t_14 = __pyx_mstate_global->__pyx_kp_u_gottell;
        __Pyx_INCREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_PyLong_From_uint64_t(__pyx_v_gottell); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 101, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_15};
          __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 101, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_12);
        }
        __pyx_t_3 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 101, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "indexed_gzip/tests/ctest_zran.pyx":102
 *             print('gotseek: {}'.format(gotseek))
 *             print('gottell: {}'.format(gottell))
 *             raise             # <<<<<<<<<<<<<<
 * 
 * 
*/
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_10);
        __pyx_t_2 = 0;  __pyx_t_1 = 0;  __pyx_t_10 = 0; 
        __PYX_ERR(0, 102, __pyx_L8_except_error)
      }

      /* "indexed_gzip/tests/ctest_zran.pyx":94
 *         gotseek = zran.zran_seek(index, element * 8, SEEK_SET, NULL)
 *         gottell = zran.zran_tell(index)
 *         try:             # <<<<<<<<<<<<<<
 *             assert gotseek == expseek
 *             assert gottell == exptell
*/
      __pyx_L8_except_error:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      goto __pyx_L1_error;
      __pyx_L11_try_end:;
    }

    /* "indexed_gzip/tests/ctest_zran.pyx":91
 * 
 * 
 *     if seek:             # <<<<<<<<<<<<<<
 *         gotseek = zran.zran_seek(index, element * 8, SEEK_SET, NULL)
 *         gottell = zran.zran_tell(index)
*/
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":105
 * 
 * 
 *     if   element >= nelems: expread = zran.ZRAN_READ_EOF             # <<<<<<<<<<<<<<
 *     else:                   expread = 8
 * 
*/
  __pyx_t_10 = PyObject_RichCompare(__pyx_v_element, __pyx_v_nelems, Py_GE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 105, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_5) {
    __pyx_v_expread = ZRAN_READ_EOF;
    goto __pyx_L14;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":106
 * 
 *     if   element >= nelems: expread = zran.ZRAN_READ_EOF
 *     else:                   expread = 8             # <<<<<<<<<<<<<<
 * 
 *     if   element >= nelems: exptell = (nelems * 8)
*/
  /*else*/ {
    __pyx_v_expread = 8;
  }
  __pyx_L14:;

  /* "indexed_gzip/tests/ctest_zran.pyx":108
 *     else:                   expread = 8
 * 
 *     if   element >= nelems: exptell = (nelems * 8)             # <<<<<<<<<<<<<<
 *     else:                   exptell = (element + 1) * 8
 * 
*/
  __pyx_t_10 = PyObject_RichCompare(__pyx_v_element, __pyx_v_nelems, Py_GE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 108, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_5) {
    __pyx_t_10 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF_SET(__pyx_v_exptell, __pyx_t_10);
    __pyx_t_10 = 0;
    goto __pyx_L15;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":109
 * 
 *     if   element >= nelems: exptell = (nelems * 8)
 *     else:                   exptell = (element + 1) * 8             # <<<<<<<<<<<<<<
 * 
 *     gotread = zran.zran_read(index, buffer, 8)
*/
  /*else*/ {
    __pyx_t_10 = __Pyx_PyLong_AddObjC(__pyx_v_element, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_t_10, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_exptell, __pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L15:;

  /* "indexed_gzip/tests/ctest_zran.pyx":111
 *     else:                   exptell = (element + 1) * 8
 * 
 *     gotread = zran.zran_read(index, buffer, 8)             # <<<<<<<<<<<<<<
 *     gottell = zran.zran_tell(index)
 * 
*/
  __pyx_v_gotread = zran_read(__pyx_v_index, __pyx_v_buffer, 8);

  /* "indexed_gzip/tests/ctest_zran.pyx":112
 * 
 *     gotread = zran.zran_read(index, buffer, 8)
 *     gottell = zran.zran_tell(index)             # <<<<<<<<<<<<<<
 * 
 *     try:
*/
  __pyx_v_gottell = zran_tell(__pyx_v_index);

  /* "indexed_gzip/tests/ctest_zran.pyx":114
 *     gottell = zran.zran_tell(index)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         assert gotread == expread
 *         assert gottell == exptell
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "indexed_gzip/tests/ctest_zran.pyx":115
 * 
 *     try:
 *         assert gotread == expread             # <<<<<<<<<<<<<<
 *         assert gottell == exptell
 *     except:
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_5 = (__pyx_v_gotread == __pyx_v_expread);
        if (unlikely(!__pyx_t_5)) {
          __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
          __PYX_ERR(0, 115, __pyx_L16_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 115, __pyx_L16_error)
      #endif

      /* "indexed_gzip/tests/ctest_zran.pyx":116
 *     try:
 *         assert gotread == expread
 *         assert gottell == exptell             # <<<<<<<<<<<<<<
 *     except:
 *         print('nelems:  {}'.format(nelems))
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_gottell); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exptell, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 116, __pyx_L16_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 116, __pyx_L16_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_5)) {
          __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
          __PYX_ERR(0, 116, __pyx_L16_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 116, __pyx_L16_error)
      #endif

      /* "indexed_gzip/tests/ctest_zran.pyx":114
 *     gottell = zran.zran_tell(index)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         assert gotread == expread
 *         assert gottell == exptell
*/
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L21_try_end;
    __pyx_L16_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":117
 *         assert gotread == expread
 *         assert gottell == exptell
 *     except:             # <<<<<<<<<<<<<<
 *         print('nelems:  {}'.format(nelems))
 *         print('element: {}'.format(element))
*/
    /*except:*/ {
      __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.read_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 117, __pyx_L18_except_error)
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);

      /* "indexed_gzip/tests/ctest_zran.pyx":118
 *         assert gottell == exptell
 *     except:
 *         print('nelems:  {}'.format(nelems))             # <<<<<<<<<<<<<<
 *         print('element: {}'.format(element))
 *         print('expread: {}'.format(expread))
*/
      __pyx_t_12 = NULL;
      __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_nelems;
      __Pyx_INCREF(__pyx_t_15);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_nelems};
        __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 118, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_13);
      }
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 118, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":119
 *     except:
 *         print('nelems:  {}'.format(nelems))
 *         print('element: {}'.format(element))             # <<<<<<<<<<<<<<
 *         print('expread: {}'.format(expread))
 *         print('exptell: {}'.format(exptell))
*/
      __pyx_t_13 = NULL;
      __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_element;
      __Pyx_INCREF(__pyx_t_15);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_element};
        __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 119, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_12);
      }
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":120
 *         print('nelems:  {}'.format(nelems))
 *         print('element: {}'.format(element))
 *         print('expread: {}'.format(expread))             # <<<<<<<<<<<<<<
 *         print('exptell: {}'.format(exptell))
 *         print('gotread: {}'.format(gotread))
*/
      __pyx_t_12 = NULL;
      __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_expread;
      __Pyx_INCREF(__pyx_t_15);
      __pyx_t_14 = __Pyx_PyLong_From_long(__pyx_v_expread); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 120, __pyx_L18_except_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_14};
        __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 120, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_13);
      }
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 120, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":121
 *         print('element: {}'.format(element))
 *         print('expread: {}'.format(expread))
 *         print('exptell: {}'.format(exptell))             # <<<<<<<<<<<<<<
 *         print('gotread: {}'.format(gotread))
 *         print('gottell: {}'.format(gottell))
*/
      __pyx_t_13 = NULL;
      __pyx_t_14 = __pyx_mstate_global->__pyx_kp_u_exptell;
      __Pyx_INCREF(__pyx_t_14);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_exptell};
        __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_12);
      }
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":122
 *         print('expread: {}'.format(expread))
 *         print('exptell: {}'.format(exptell))
 *         print('gotread: {}'.format(gotread))             # <<<<<<<<<<<<<<
 *         print('gottell: {}'.format(gottell))
 *         raise
*/
      __pyx_t_12 = NULL;
      __pyx_t_14 = __pyx_mstate_global->__pyx_kp_u_gotread;
      __Pyx_INCREF(__pyx_t_14);
      __pyx_t_15 = __Pyx_PyLong_From_int64_t(__pyx_v_gotread); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 122, __pyx_L18_except_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_15};
        __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 122, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_13);
      }
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 122, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":123
 *         print('exptell: {}'.format(exptell))
 *         print('gotread: {}'.format(gotread))
 *         print('gottell: {}'.format(gottell))             # <<<<<<<<<<<<<<
 *         raise
 * 
*/
      __pyx_t_13 = NULL;
      __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_gottell;
      __Pyx_INCREF(__pyx_t_15);
      __pyx_t_14 = __Pyx_PyLong_From_uint64_t(__pyx_v_gottell); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 123, __pyx_L18_except_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_14};
        __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 123, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_12);
      }
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 123, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":124
 *         print('gotread: {}'.format(gotread))
 *         print('gottell: {}'.format(gottell))
 *         raise             # <<<<<<<<<<<<<<
 * 
 *     if element < nelems:
*/
      __Pyx_GIVEREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_ErrRestoreWithState(__pyx_t_10, __pyx_t_1, __pyx_t_2);
      __pyx_t_10 = 0;  __pyx_t_1 = 0;  __pyx_t_2 = 0; 
      __PYX_ERR(0, 124, __pyx_L18_except_error)
    }

    /* "indexed_gzip/tests/ctest_zran.pyx":114
 *     gottell = zran.zran_tell(index)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         assert gotread == expread
 *         assert gottell == exptell
*/
    __pyx_L18_except_error:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L21_try_end:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":126
 *         raise
 * 
 *     if element < nelems:             # <<<<<<<<<<<<<<
 *         pybuf = <bytes>(<char *>buffer)[:8]
 *         val   = np.ndarray(1, np.uint64, buffer=pybuf)
*/
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_element, __pyx_v_nelems, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "indexed_gzip/tests/ctest_zran.pyx":127
 * 
 *     if element < nelems:
 *         pybuf = <bytes>(<char *>buffer)[:8]             # <<<<<<<<<<<<<<
 *         val   = np.ndarray(1, np.uint64, buffer=pybuf)
 *         return val[0]
*/
    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_buffer) + 0, 8 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_pybuf = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":128
 *     if element < nelems:
 *         pybuf = <bytes>(<char *>buffer)[:8]
 *         val   = np.ndarray(1, np.uint64, buffer=pybuf)             # <<<<<<<<<<<<<<
 *         return val[0]
 *     else:
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_1, __pyx_t_11};
      __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_buffer, __pyx_v_pybuf, __pyx_t_10, __pyx_callargs+3, 0) < (0)) __PYX_ERR(0, 128, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_5numpy_ndarray, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_val = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":129
 *         pybuf = <bytes>(<char *>buffer)[:8]
 *         val   = np.ndarray(1, np.uint64, buffer=pybuf)
 *         return val[0]             # <<<<<<<<<<<<<<
 *     else:
 *         return None
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "indexed_gzip/tests/ctest_zran.pyx":126
 *         raise
 * 
 *     if element < nelems:             # <<<<<<<<<<<<<<
 *         pybuf = <bytes>(<char *>buffer)[:8]
 *         val   = np.ndarray(1, np.uint64, buffer=pybuf)
*/
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":131
 *         return val[0]
 *     else:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":77
 * np.import_array()
 * 
 * cdef read_element(zran.zran_index_t *index, element, nelems, seek=True):             # <<<<<<<<<<<<<<
 * 
 *     cdef void *buffer
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.read_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_exptell);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":155
 * 
 * 
 *     def __cinit__(self, size_t size, use_mmap=False):             # <<<<<<<<<<<<<<
 *         """Allocate ``size`` bytes of memory. """
 * 
*/

/* Python wrapper */
static int __pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_size;
  PyObject *__pyx_v_use_mmap = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_use_mmap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 155, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 155, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 155, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 155, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, i); __PYX_ERR(0, 155, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 155, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 155, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_size = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error)
    __pyx_v_use_mmap = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 155, __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("indexed_gzip.tests.ctest_zran.ReadBuffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer___cinit__(((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_v_self), __pyx_v_size, __pyx_v_use_mmap);

  /* 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;
}

/* "indexed_gzip/tests/ctest_zran.pyx":175
 *             print('Memory-mapping {:0.2f} GB ({})'.format(size / 1073741824., path))
 * 
 *             def initmem():             # <<<<<<<<<<<<<<
 * 
 *                 towrite = size
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___1initmem(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___1initmem = {"initmem", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___1initmem, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___1initmem(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initmem (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___initmem(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___initmem(PyObject *__pyx_self) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *__pyx_cur_scope;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *__pyx_outer_scope;
  PyObject *__pyx_v_towrite = NULL;
  PyObject *__pyx_v_zeros = 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;
  long __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initmem", 0);
  __pyx_outer_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "indexed_gzip/tests/ctest_zran.pyx":177
 *             def initmem():
 * 
 *                 towrite = size             # <<<<<<<<<<<<<<
 * 
 *                 while towrite > 0:
*/
  __pyx_t_1 = __Pyx_PyLong_FromSize_t(__pyx_cur_scope->__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_towrite = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":179
 *                 towrite = size
 * 
 *                 while towrite > 0:             # <<<<<<<<<<<<<<
 * 
 *                     zeros    = np.zeros(min(towrite, 134217728), dtype=np.uint8)
*/
  while (1) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_towrite, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 179, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_2) break;

    /* "indexed_gzip/tests/ctest_zran.pyx":181
 *                 while towrite > 0:
 * 
 *                     zeros    = np.zeros(min(towrite, 134217728), dtype=np.uint8)             # <<<<<<<<<<<<<<
 *                     towrite -= len(zeros)
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 0x8000000;
    __Pyx_INCREF(__pyx_v_towrite);
    __pyx_t_4 = __pyx_v_towrite;
    __pyx_t_8 = __Pyx_PyLong_From_long(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_2) {
      __pyx_t_9 = __Pyx_PyLong_From_long(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = __pyx_t_9;
      __pyx_t_9 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_7 = __pyx_t_4;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_uint8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = 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_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_9, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 181, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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(0, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_zeros, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":182
 * 
 *                     zeros    = np.zeros(min(towrite, 134217728), dtype=np.uint8)
 *                     towrite -= len(zeros)             # <<<<<<<<<<<<<<
 * 
 *                     os.write(fd, zeros.tobytes())
*/
    __pyx_t_11 = PyObject_Length(__pyx_v_zeros); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 182, __pyx_L1_error)
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_v_towrite, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_towrite, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":184
 *                     towrite -= len(zeros)
 * 
 *                     os.write(fd, zeros.tobytes())             # <<<<<<<<<<<<<<
 * 
 *             th = threading.Thread(target=initmem)
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_write); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_v_fd)) { __Pyx_RaiseClosureNameError("fd"); __PYX_ERR(0, 184, __pyx_L1_error) }
    __pyx_t_7 = __pyx_v_zeros;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tobytes, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_fd, __pyx_t_4};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":175
 *             print('Memory-mapping {:0.2f} GB ({})'.format(size / 1073741824., path))
 * 
 *             def initmem():             # <<<<<<<<<<<<<<
 * 
 *                 towrite = size
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.ReadBuffer.__cinit__.initmem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_towrite);
  __Pyx_XDECREF(__pyx_v_zeros);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":188
 *             th = threading.Thread(target=initmem)
 *             th.start()
 *             poll(lambda : not th.is_alive())             # <<<<<<<<<<<<<<
 * 
 *             self.mmap_fd   = fd
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___2lambda = {"lambda", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___2lambda, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *__pyx_cur_scope;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda", 0);
  __pyx_outer_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_th)) { __Pyx_RaiseClosureNameError("th"); __PYX_ERR(0, 188, __pyx_L1_error) }
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_th;
  __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_is_alive, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.ReadBuffer.__cinit__.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":155
 * 
 * 
 *     def __cinit__(self, size_t size, use_mmap=False):             # <<<<<<<<<<<<<<
 *         """Allocate ``size`` bytes of memory. """
 * 
*/

static int __pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer___cinit__(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_self, size_t __pyx_v_size, PyObject *__pyx_v_use_mmap) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *__pyx_cur_scope;
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_v_initmem = 0;
  int __pyx_r;
  __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;
  size_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __pyx_cur_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__(__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 155, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_size = __pyx_v_size;

  /* "indexed_gzip/tests/ctest_zran.pyx":158
 *         """Allocate ``size`` bytes of memory. """
 * 
 *         self.use_mmap  = use_mmap             # <<<<<<<<<<<<<<
 *         self.mmap_fd   = None
 *         self.mmap_path = None
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_use_mmap); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error)
  __pyx_v_self->use_mmap = __pyx_t_1;

  /* "indexed_gzip/tests/ctest_zran.pyx":159
 * 
 *         self.use_mmap  = use_mmap
 *         self.mmap_fd   = None             # <<<<<<<<<<<<<<
 *         self.mmap_path = None
 *         self.size      = size
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->mmap_fd);
  __Pyx_DECREF(__pyx_v_self->mmap_fd);
  __pyx_v_self->mmap_fd = Py_None;

  /* "indexed_gzip/tests/ctest_zran.pyx":160
 *         self.use_mmap  = use_mmap
 *         self.mmap_fd   = None
 *         self.mmap_path = None             # <<<<<<<<<<<<<<
 *         self.size      = size
 *         self.buffer    = NULL
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->mmap_path);
  __Pyx_DECREF(__pyx_v_self->mmap_path);
  __pyx_v_self->mmap_path = Py_None;

  /* "indexed_gzip/tests/ctest_zran.pyx":161
 *         self.mmap_fd   = None
 *         self.mmap_path = None
 *         self.size      = size             # <<<<<<<<<<<<<<
 *         self.buffer    = NULL
 * 
*/
  __pyx_v_self->size = __pyx_cur_scope->__pyx_v_size;

  /* "indexed_gzip/tests/ctest_zran.pyx":162
 *         self.mmap_path = None
 *         self.size      = size
 *         self.buffer    = NULL             # <<<<<<<<<<<<<<
 * 
 *         if not self.use_mmap:
*/
  __pyx_v_self->buffer = NULL;

  /* "indexed_gzip/tests/ctest_zran.pyx":164
 *         self.buffer    = NULL
 * 
 *         if not self.use_mmap:             # <<<<<<<<<<<<<<
 *             self.buffer = PyMem_Malloc(size)
 * 
*/
  __pyx_t_1 = (!__pyx_v_self->use_mmap);
  if (__pyx_t_1) {

    /* "indexed_gzip/tests/ctest_zran.pyx":165
 * 
 *         if not self.use_mmap:
 *             self.buffer = PyMem_Malloc(size)             # <<<<<<<<<<<<<<
 * 
 *             memset(self.buffer, 0, size);
*/
    __pyx_v_self->buffer = PyMem_Malloc(__pyx_cur_scope->__pyx_v_size);

    /* "indexed_gzip/tests/ctest_zran.pyx":167
 *             self.buffer = PyMem_Malloc(size)
 * 
 *             memset(self.buffer, 0, size);             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    (void)(memset(__pyx_v_self->buffer, 0, __pyx_cur_scope->__pyx_v_size));

    /* "indexed_gzip/tests/ctest_zran.pyx":164
 *         self.buffer    = NULL
 * 
 *         if not self.use_mmap:             # <<<<<<<<<<<<<<
 *             self.buffer = PyMem_Malloc(size)
 * 
*/
    goto __pyx_L3;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":171
 *         else:
 * 
 *             fd, path = tempfile.mkstemp('readbuf_mmap_{}'.format(id(self)))             # <<<<<<<<<<<<<<
 * 
 *             print('Memory-mapping {:0.2f} GB ({})'.format(size / 1073741824., path))
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tempfile); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_mkstemp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_readbuf_mmap;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_v_self)};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_id, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 171, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
      index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_3), 2) < (0)) __PYX_ERR(0, 171, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 171, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_fd = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_path = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":173
 *             fd, path = tempfile.mkstemp('readbuf_mmap_{}'.format(id(self)))
 * 
 *             print('Memory-mapping {:0.2f} GB ({})'.format(size / 1073741824., path))             # <<<<<<<<<<<<<<
 * 
 *             def initmem():
*/
    __pyx_t_4 = NULL;
    __pyx_t_3 = __pyx_mstate_global->__pyx_kp_u_Memory_mapping_0_2f_GB;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = PyFloat_FromDouble((((double)__pyx_cur_scope->__pyx_v_size) / 1073741824.)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_7, __pyx_v_path};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":175
 *             print('Memory-mapping {:0.2f} GB ({})'.format(size / 1073741824., path))
 * 
 *             def initmem():             # <<<<<<<<<<<<<<
 * 
 *                 towrite = size
*/
    __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___1initmem, 0, __pyx_mstate_global->__pyx_n_u_cinit___locals_initmem, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_initmem = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":186
 *                     os.write(fd, zeros.tobytes())
 * 
 *             th = threading.Thread(target=initmem)             # <<<<<<<<<<<<<<
 *             th.start()
 *             poll(lambda : not th.is_alive())
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Thread); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_target, __pyx_v_initmem, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 186, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_th = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":187
 * 
 *             th = threading.Thread(target=initmem)
 *             th.start()             # <<<<<<<<<<<<<<
 *             poll(lambda : not th.is_alive())
 * 
*/
    __pyx_t_7 = __pyx_cur_scope->__pyx_v_th;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_start, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":188
 *             th = threading.Thread(target=initmem)
 *             th.start()
 *             poll(lambda : not th.is_alive())             # <<<<<<<<<<<<<<
 * 
 *             self.mmap_fd   = fd
*/
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_poll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__cinit___2lambda, 0, __pyx_mstate_global->__pyx_n_u_cinit___locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":190
 *             poll(lambda : not th.is_alive())
 * 
 *             self.mmap_fd   = fd             # <<<<<<<<<<<<<<
 *             self.mmap_path = path
 *             self.buffer    = mmap(NULL,
*/
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fd);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fd);
    __Pyx_GOTREF(__pyx_v_self->mmap_fd);
    __Pyx_DECREF(__pyx_v_self->mmap_fd);
    __pyx_v_self->mmap_fd = __pyx_cur_scope->__pyx_v_fd;

    /* "indexed_gzip/tests/ctest_zran.pyx":191
 * 
 *             self.mmap_fd   = fd
 *             self.mmap_path = path             # <<<<<<<<<<<<<<
 *             self.buffer    = mmap(NULL,
 *                                   size,
*/
    __Pyx_INCREF(__pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    __Pyx_GOTREF(__pyx_v_self->mmap_path);
    __Pyx_DECREF(__pyx_v_self->mmap_path);
    __pyx_v_self->mmap_path = __pyx_v_path;

    /* "indexed_gzip/tests/ctest_zran.pyx":196
 *                                   PROT_READ | PROT_WRITE,
 *                                   MAP_SHARED,
 *                                   fd,             # <<<<<<<<<<<<<<
 *                                   0)
 * 
*/
    __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_cur_scope->__pyx_v_fd); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":192
 *             self.mmap_fd   = fd
 *             self.mmap_path = path
 *             self.buffer    = mmap(NULL,             # <<<<<<<<<<<<<<
 *                                   size,
 *                                   PROT_READ | PROT_WRITE,
*/
    __pyx_v_self->buffer = mmap(NULL, __pyx_cur_scope->__pyx_v_size, (PROT_READ | PROT_WRITE), MAP_SHARED, __pyx_t_11, 0);

    /* "indexed_gzip/tests/ctest_zran.pyx":199
 *                                   0)
 * 
 *             if self.buffer == <void*>MAP_FAILED:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('mmap fail')
 * 
*/
    __pyx_t_1 = (__pyx_v_self->buffer == ((void *)MAP_FAILED));
    if (unlikely(__pyx_t_1)) {

      /* "indexed_gzip/tests/ctest_zran.pyx":200
 * 
 *             if self.buffer == <void*>MAP_FAILED:
 *                 raise RuntimeError('mmap fail')             # <<<<<<<<<<<<<<
 * 
 *         if not self.buffer:
*/
      __pyx_t_4 = NULL;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_mmap_fail};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 200, __pyx_L1_error)

      /* "indexed_gzip/tests/ctest_zran.pyx":199
 *                                   0)
 * 
 *             if self.buffer == <void*>MAP_FAILED:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('mmap fail')
 * 
*/
    }
  }
  __pyx_L3:;

  /* "indexed_gzip/tests/ctest_zran.pyx":202
 *                 raise RuntimeError('mmap fail')
 * 
 *         if not self.buffer:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('ReadBuffer init fail')
 * 
*/
  __pyx_t_1 = (!(__pyx_v_self->buffer != 0));
  if (unlikely(__pyx_t_1)) {

    /* "indexed_gzip/tests/ctest_zran.pyx":203
 * 
 *         if not self.buffer:
 *             raise RuntimeError('ReadBuffer init fail')             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_4 = NULL;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_ReadBuffer_init_fail};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 203, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":202
 *                 raise RuntimeError('mmap fail')
 * 
 *         if not self.buffer:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('ReadBuffer init fail')
 * 
*/
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":155
 * 
 * 
 *     def __cinit__(self, size_t size, use_mmap=False):             # <<<<<<<<<<<<<<
 *         """Allocate ``size`` bytes of memory. """
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.ReadBuffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_initmem);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":206
 * 
 * 
 *     def resize(self, size_t size):             # <<<<<<<<<<<<<<
 *         """Re-allocate the memory to the given ``size``. """
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_3resize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_2resize, "Re-allocate the memory to the given ``size``. ");
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_3resize = {"resize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_3resize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_2resize};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_3resize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_size;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 206, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 206, __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, "resize", 0) < (0)) __PYX_ERR(0, 206, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("resize", 1, 1, 1, i); __PYX_ERR(0, 206, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 206, __pyx_L3_error)
    }
    __pyx_v_size = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("resize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 206, __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("indexed_gzip.tests.ctest_zran.ReadBuffer.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_2resize(((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_v_self), __pyx_v_size);

  /* 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_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_2resize(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_self, size_t __pyx_v_size) {
  void *__pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("resize", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":209
 *         """Re-allocate the memory to the given ``size``. """
 * 
 *         if self.use_mmap:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('Cannot resize a memmapped array!')
 * 
*/
  if (unlikely(__pyx_v_self->use_mmap)) {

    /* "indexed_gzip/tests/ctest_zran.pyx":210
 * 
 *         if self.use_mmap:
 *             raise NotImplementedError('Cannot resize a memmapped array!')             # <<<<<<<<<<<<<<
 * 
 *         buf = PyMem_Realloc(self.buffer, size)
*/
    __pyx_t_2 = NULL;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Cannot_resize_a_memmapped_array};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 210, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":209
 *         """Re-allocate the memory to the given ``size``. """
 * 
 *         if self.use_mmap:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('Cannot resize a memmapped array!')
 * 
*/
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":212
 *             raise NotImplementedError('Cannot resize a memmapped array!')
 * 
 *         buf = PyMem_Realloc(self.buffer, size)             # <<<<<<<<<<<<<<
 * 
 *         if not buf:
*/
  __pyx_v_buf = PyMem_Realloc(__pyx_v_self->buffer, __pyx_v_size);

  /* "indexed_gzip/tests/ctest_zran.pyx":214
 *         buf = PyMem_Realloc(self.buffer, size)
 * 
 *         if not buf:             # <<<<<<<<<<<<<<
 *             raise MemoryError('PyMem_Realloc fail')
 * 
*/
  __pyx_t_4 = (!(__pyx_v_buf != 0));
  if (unlikely(__pyx_t_4)) {

    /* "indexed_gzip/tests/ctest_zran.pyx":215
 * 
 *         if not buf:
 *             raise MemoryError('PyMem_Realloc fail')             # <<<<<<<<<<<<<<
 * 
 *         self.buffer = buf
*/
    __pyx_t_2 = NULL;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_PyMem_Realloc_fail};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 215, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":214
 *         buf = PyMem_Realloc(self.buffer, size)
 * 
 *         if not buf:             # <<<<<<<<<<<<<<
 *             raise MemoryError('PyMem_Realloc fail')
 * 
*/
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":217
 *             raise MemoryError('PyMem_Realloc fail')
 * 
 *         self.buffer = buf             # <<<<<<<<<<<<<<
 *         self.size   = size
 * 
*/
  __pyx_v_self->buffer = __pyx_v_buf;

  /* "indexed_gzip/tests/ctest_zran.pyx":218
 * 
 *         self.buffer = buf
 *         self.size   = size             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_v_self->size = __pyx_v_size;

  /* "indexed_gzip/tests/ctest_zran.pyx":206
 * 
 * 
 *     def resize(self, size_t size):             # <<<<<<<<<<<<<<
 *         """Re-allocate the memory to the given ``size``. """
 * 
*/

  /* 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("indexed_gzip.tests.ctest_zran.ReadBuffer.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":221
 * 
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """Free the mwmory. """
 * 
*/

/* Python wrapper */
static void __pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_5__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_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_4__dealloc__(((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_v_self));

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

static void __pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_4__dealloc__(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_self) {
  __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("__dealloc__", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":224
 *         """Free the mwmory. """
 * 
 *         if not self.use_mmap:             # <<<<<<<<<<<<<<
 *             PyMem_Free(self.buffer)
 *         else:
*/
  __pyx_t_1 = (!__pyx_v_self->use_mmap);
  if (__pyx_t_1) {

    /* "indexed_gzip/tests/ctest_zran.pyx":225
 * 
 *         if not self.use_mmap:
 *             PyMem_Free(self.buffer)             # <<<<<<<<<<<<<<
 *         else:
 *             munmap(self.buffer, self.size)
*/
    PyMem_Free(__pyx_v_self->buffer);

    /* "indexed_gzip/tests/ctest_zran.pyx":224
 *         """Free the mwmory. """
 * 
 *         if not self.use_mmap:             # <<<<<<<<<<<<<<
 *             PyMem_Free(self.buffer)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":227
 *             PyMem_Free(self.buffer)
 *         else:
 *             munmap(self.buffer, self.size)             # <<<<<<<<<<<<<<
 *             os.close( self.mmap_fd)
 *             os.remove(self.mmap_path)
*/
  /*else*/ {
    (void)(munmap(__pyx_v_self->buffer, __pyx_v_self->size));

    /* "indexed_gzip/tests/ctest_zran.pyx":228
 *         else:
 *             munmap(self.buffer, self.size)
 *             os.close( self.mmap_fd)             # <<<<<<<<<<<<<<
 *             os.remove(self.mmap_path)
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->mmap_fd};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":229
 *             munmap(self.buffer, self.size)
 *             os.close( self.mmap_fd)
 *             os.remove(self.mmap_path)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __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_v_self->mmap_path};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "indexed_gzip/tests/ctest_zran.pyx":221
 * 
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """Free the mwmory. """
 * 
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("indexed_gzip.tests.ctest_zran.ReadBuffer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

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

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

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__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("indexed_gzip.tests.ctest_zran.ReadBuffer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__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("indexed_gzip.tests.ctest_zran.ReadBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":232
 * 
 * 
 * def error_fn(*args, **kwargs):             # <<<<<<<<<<<<<<
 *     raise Exception("Error")
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_1error_fn(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_1error_fn = {"error_fn", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_1error_fn, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_1error_fn(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("error_fn (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (__pyx_kwds_len > 0) {
    if (unlikely(__Pyx_CheckKeywordStrings("error_fn", __pyx_kwds) == -1)) return NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_error_fn(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_error_fn(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  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("error_fn", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":233
 * 
 * def error_fn(*args, **kwargs):
 *     raise Exception("Error")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Error};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 233, __pyx_L1_error)

  /* "indexed_gzip/tests/ctest_zran.pyx":232
 * 
 * 
 * def error_fn(*args, **kwargs):             # <<<<<<<<<<<<<<
 *     raise Exception("Error")
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.error_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":236
 * 
 * 
 * def return_fn(return_value):             # <<<<<<<<<<<<<<
 *     return lambda *args, **kwargs: return_value
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_3return_fn(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_3return_fn = {"return_fn", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_3return_fn, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_3return_fn(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_return_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("return_fn (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_return_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 236, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 236, __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, "return_fn", 0) < (0)) __PYX_ERR(0, 236, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("return_fn", 1, 1, 1, i); __PYX_ERR(0, 236, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 236, __pyx_L3_error)
    }
    __pyx_v_return_value = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("return_fn", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 236, __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("indexed_gzip.tests.ctest_zran.return_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_2return_fn(__pyx_self, __pyx_v_return_value);

  /* 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;
}

/* "indexed_gzip/tests/ctest_zran.pyx":237
 * 
 * def return_fn(return_value):
 *     return lambda *args, **kwargs: return_value             # <<<<<<<<<<<<<<
 * 
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_9return_fn_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_9return_fn_lambda1 = {"lambda1", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_9return_fn_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_9return_fn_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (__pyx_kwds_len > 0) {
    if (unlikely(__Pyx_CheckKeywordStrings("lambda1", __pyx_kwds) == -1)) return NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *__pyx_cur_scope;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __pyx_outer_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_return_value)) { __Pyx_RaiseClosureNameError("return_value"); __PYX_ERR(0, 237, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_value);
  __pyx_r = __pyx_cur_scope->__pyx_v_return_value;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.return_fn.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":236
 * 
 * 
 * def return_fn(return_value):             # <<<<<<<<<<<<<<
 *     return lambda *args, **kwargs: return_value
 * 
*/

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_2return_fn(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_return_value) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *__pyx_cur_scope;
  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("return_fn", 0);
  __pyx_cur_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn(__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 236, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_return_value = __pyx_v_return_value;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_value);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_value);

  /* "indexed_gzip/tests/ctest_zran.pyx":237
 * 
 * def return_fn(return_value):
 *     return lambda *args, **kwargs: return_value             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_9return_fn_lambda1, 0, __pyx_mstate_global->__pyx_n_u_return_fn_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "indexed_gzip/tests/ctest_zran.pyx":236
 * 
 * 
 * def return_fn(return_value):             # <<<<<<<<<<<<<<
 *     return lambda *args, **kwargs: return_value
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.return_fn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":240
 * 
 * 
 * def test_fread():             # <<<<<<<<<<<<<<
 *     """Tests Python wrapper C function for fread."""
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_5test_fread(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_12indexed_gzip_5tests_10ctest_zran_4test_fread, "Tests Python wrapper C function for fread.");
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_5test_fread = {"test_fread", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_5test_fread, METH_NOARGS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_4test_fread};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_5test_fread(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_fread (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_4test_fread(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_4test_fread(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_f = NULL;
  char __pyx_v_buf[3];
  size_t __pyx_v_elems_read;
  PyObject *__pyx_v_fn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  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("test_fread", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":243
 *     """Tests Python wrapper C function for fread."""
 * 
 *     f = BytesIO(b"abc")             # <<<<<<<<<<<<<<
 *     cdef char buf[3]
 *     elems_read = zran_file_util._fread_python(buf, 1, 3, <PyObject*>f)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_b_abc};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":245
 *     f = BytesIO(b"abc")
 *     cdef char buf[3]
 *     elems_read = zran_file_util._fread_python(buf, 1, 3, <PyObject*>f)             # <<<<<<<<<<<<<<
 *     assert elems_read == 3
 *     assert f.tell() == 3
*/
  __pyx_v_elems_read = _fread_python(__pyx_v_buf, 1, 3, ((PyObject *)__pyx_v_f));

  /* "indexed_gzip/tests/ctest_zran.pyx":246
 *     cdef char buf[3]
 *     elems_read = zran_file_util._fread_python(buf, 1, 3, <PyObject*>f)
 *     assert elems_read == 3             # <<<<<<<<<<<<<<
 *     assert f.tell() == 3
 *     assert buf[0:3] == b"abc"
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (__pyx_v_elems_read == 3);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 246, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 246, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":247
 *     elems_read = zran_file_util._fread_python(buf, 1, 3, <PyObject*>f)
 *     assert elems_read == 3
 *     assert f.tell() == 3             # <<<<<<<<<<<<<<
 *     assert buf[0:3] == b"abc"
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __pyx_v_f;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tell, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_3, 3, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 247, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 247, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":248
 *     assert elems_read == 3
 *     assert f.tell() == 3
 *     assert buf[0:3] == b"abc"             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_buf + 0, 3 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_b_abc, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 248, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 248, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 248, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":249
 *     assert f.tell() == 3
 *     assert buf[0:3] == b"abc"
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 * 
 *     # fread error conditions:
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 249, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 249, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":252
 * 
 *     # fread error conditions:
 *     for fn in [error_fn, return_fn(None)]:             # <<<<<<<<<<<<<<
 *         f.read = fn
 *         assert zran_file_util._fread_python(buf, 1, 3, <PyObject*>f) == 0
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_error_fn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return_fn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, Py_None};
    __pyx_t_3 = __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_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 252, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 252, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_7 >= 2) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7));
    #else
    __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7);
    #endif
    ++__pyx_t_7;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_fn, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":253
 *     # fread error conditions:
 *     for fn in [error_fn, return_fn(None)]:
 *         f.read = fn             # <<<<<<<<<<<<<<
 *         assert zran_file_util._fread_python(buf, 1, 3, <PyObject*>f) == 0
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_f, __pyx_mstate_global->__pyx_n_u_read, __pyx_v_fn) < (0)) __PYX_ERR(0, 253, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":254
 *     for fn in [error_fn, return_fn(None)]:
 *         f.read = fn
 *         assert zran_file_util._fread_python(buf, 1, 3, <PyObject*>f) == 0             # <<<<<<<<<<<<<<
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_fread_python(__pyx_v_buf, 1, 3, ((PyObject *)__pyx_v_f)) == 0);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 254, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 254, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":255
 *         f.read = fn
 *         assert zran_file_util._fread_python(buf, 1, 3, <PyObject*>f) == 0
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1             # <<<<<<<<<<<<<<
 *         PyErr_Clear()
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 1);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 255, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 255, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":256
 *         assert zran_file_util._fread_python(buf, 1, 3, <PyObject*>f) == 0
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    PyErr_Clear();

    /* "indexed_gzip/tests/ctest_zran.pyx":252
 * 
 *     # fread error conditions:
 *     for fn in [error_fn, return_fn(None)]:             # <<<<<<<<<<<<<<
 *         f.read = fn
 *         assert zran_file_util._fread_python(buf, 1, 3, <PyObject*>f) == 0
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":240
 * 
 * 
 * def test_fread():             # <<<<<<<<<<<<<<
 *     """Tests Python wrapper C function for fread."""
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_fread", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":259
 * 
 * 
 * def test_ftell():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_7test_ftell(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_7test_ftell = {"test_ftell", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_7test_ftell, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_7test_ftell(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_ftell (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_6test_ftell(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_6test_ftell(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_fn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  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("test_ftell", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":261
 * def test_ftell():
 * 
 *     f = BytesIO(b"abc")             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ftell_python(<PyObject*>f) == 0
 *     f.seek(2)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_b_abc};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":262
 * 
 *     f = BytesIO(b"abc")
 *     assert zran_file_util._ftell_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 *     f.seek(2)
 *     assert zran_file_util._ftell_python(<PyObject*>f) == 2
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ftell_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 262, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 262, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":263
 *     f = BytesIO(b"abc")
 *     assert zran_file_util._ftell_python(<PyObject*>f) == 0
 *     f.seek(2)             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ftell_python(<PyObject*>f) == 2
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
*/
  __pyx_t_3 = __pyx_v_f;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_2};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_seek, __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_1)) __PYX_ERR(0, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":264
 *     assert zran_file_util._ftell_python(<PyObject*>f) == 0
 *     f.seek(2)
 *     assert zran_file_util._ftell_python(<PyObject*>f) == 2             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ftell_python(((PyObject *)__pyx_v_f)) == 2);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 264, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 264, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":265
 *     f.seek(2)
 *     assert zran_file_util._ftell_python(<PyObject*>f) == 2
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 * 
 *     # ftell error conditions
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 265, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 265, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":268
 * 
 *     # ftell error conditions
 *     for fn in [error_fn, return_fn(None)]:             # <<<<<<<<<<<<<<
 *         f.tell = fn
 *         assert zran_file_util._ftell_python(<PyObject*>f) == -1
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_error_fn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return_fn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, Py_None};
    __pyx_t_3 = __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_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 268, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 268, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_7 >= 2) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7));
    #else
    __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7);
    #endif
    ++__pyx_t_7;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_fn, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":269
 *     # ftell error conditions
 *     for fn in [error_fn, return_fn(None)]:
 *         f.tell = fn             # <<<<<<<<<<<<<<
 *         assert zran_file_util._ftell_python(<PyObject*>f) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_f, __pyx_mstate_global->__pyx_n_u_tell, __pyx_v_fn) < (0)) __PYX_ERR(0, 269, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":270
 *     for fn in [error_fn, return_fn(None)]:
 *         f.tell = fn
 *         assert zran_file_util._ftell_python(<PyObject*>f) == -1             # <<<<<<<<<<<<<<
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_ftell_python(((PyObject *)__pyx_v_f)) == -1L);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 270, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 270, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":271
 *         f.tell = fn
 *         assert zran_file_util._ftell_python(<PyObject*>f) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1             # <<<<<<<<<<<<<<
 *         PyErr_Clear()
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 1);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 271, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 271, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":272
 *         assert zran_file_util._ftell_python(<PyObject*>f) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    PyErr_Clear();

    /* "indexed_gzip/tests/ctest_zran.pyx":268
 * 
 *     # ftell error conditions
 *     for fn in [error_fn, return_fn(None)]:             # <<<<<<<<<<<<<<
 *         f.tell = fn
 *         assert zran_file_util._ftell_python(<PyObject*>f) == -1
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":259
 * 
 * 
 * def test_ftell():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_ftell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":275
 * 
 * 
 * def test_fseek():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_9test_fseek(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_9test_fseek = {"test_fseek", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_9test_fseek, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_9test_fseek(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_fseek (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_8test_fseek(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_8test_fseek(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_fn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_fseek", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":277
 * def test_fseek():
 * 
 *     f = BytesIO(b"abc")             # <<<<<<<<<<<<<<
 *     zran_file_util._fseek_python(<PyObject*>f, 1, SEEK_SET)
 *     assert f.tell() == 1
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_b_abc};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":278
 * 
 *     f = BytesIO(b"abc")
 *     zran_file_util._fseek_python(<PyObject*>f, 1, SEEK_SET)             # <<<<<<<<<<<<<<
 *     assert f.tell() == 1
 *     zran_file_util._fseek_python(<PyObject*>f, -1, SEEK_END)
*/
  (void)(_fseek_python(((PyObject *)__pyx_v_f), 1, SEEK_SET));

  /* "indexed_gzip/tests/ctest_zran.pyx":279
 *     f = BytesIO(b"abc")
 *     zran_file_util._fseek_python(<PyObject*>f, 1, SEEK_SET)
 *     assert f.tell() == 1             # <<<<<<<<<<<<<<
 *     zran_file_util._fseek_python(<PyObject*>f, -1, SEEK_END)
 *     assert f.tell() == 2
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __pyx_v_f;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tell, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 279, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 279, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":280
 *     zran_file_util._fseek_python(<PyObject*>f, 1, SEEK_SET)
 *     assert f.tell() == 1
 *     zran_file_util._fseek_python(<PyObject*>f, -1, SEEK_END)             # <<<<<<<<<<<<<<
 *     assert f.tell() == 2
 *     zran_file_util._fseek_python(<PyObject*>f, 100, SEEK_SET)
*/
  (void)(_fseek_python(((PyObject *)__pyx_v_f), -1L, SEEK_END));

  /* "indexed_gzip/tests/ctest_zran.pyx":281
 *     assert f.tell() == 1
 *     zran_file_util._fseek_python(<PyObject*>f, -1, SEEK_END)
 *     assert f.tell() == 2             # <<<<<<<<<<<<<<
 *     zran_file_util._fseek_python(<PyObject*>f, 100, SEEK_SET)
 *     assert f.tell() == 100
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __pyx_v_f;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tell, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 281, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 281, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":282
 *     zran_file_util._fseek_python(<PyObject*>f, -1, SEEK_END)
 *     assert f.tell() == 2
 *     zran_file_util._fseek_python(<PyObject*>f, 100, SEEK_SET)             # <<<<<<<<<<<<<<
 *     assert f.tell() == 100
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
*/
  (void)(_fseek_python(((PyObject *)__pyx_v_f), 0x64, SEEK_SET));

  /* "indexed_gzip/tests/ctest_zran.pyx":283
 *     assert f.tell() == 2
 *     zran_file_util._fseek_python(<PyObject*>f, 100, SEEK_SET)
 *     assert f.tell() == 100             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __pyx_v_f;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tell, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_100, 0x64, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 283, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 283, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":284
 *     zran_file_util._fseek_python(<PyObject*>f, 100, SEEK_SET)
 *     assert f.tell() == 100
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 * 
 *     # fseek error conditions
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 284, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 284, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":287
 * 
 *     # fseek error conditions
 *     for fn in [error_fn]:             # <<<<<<<<<<<<<<
 *         f.seek = fn
 *         assert zran_file_util._fseek_python(<PyObject*>f, 1, SEEK_SET) == -1
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_error_fn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 287, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_6 >= 1) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6);
    #endif
    ++__pyx_t_6;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_fn, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":288
 *     # fseek error conditions
 *     for fn in [error_fn]:
 *         f.seek = fn             # <<<<<<<<<<<<<<
 *         assert zran_file_util._fseek_python(<PyObject*>f, 1, SEEK_SET) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_f, __pyx_mstate_global->__pyx_n_u_seek, __pyx_v_fn) < (0)) __PYX_ERR(0, 288, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":289
 *     for fn in [error_fn]:
 *         f.seek = fn
 *         assert zran_file_util._fseek_python(<PyObject*>f, 1, SEEK_SET) == -1             # <<<<<<<<<<<<<<
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_fseek_python(((PyObject *)__pyx_v_f), 1, SEEK_SET) == -1L);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 289, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 289, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":290
 *         f.seek = fn
 *         assert zran_file_util._fseek_python(<PyObject*>f, 1, SEEK_SET) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1             # <<<<<<<<<<<<<<
 *         PyErr_Clear()
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 1);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 290, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 290, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":291
 *         assert zran_file_util._fseek_python(<PyObject*>f, 1, SEEK_SET) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    PyErr_Clear();

    /* "indexed_gzip/tests/ctest_zran.pyx":287
 * 
 *     # fseek error conditions
 *     for fn in [error_fn]:             # <<<<<<<<<<<<<<
 *         f.seek = fn
 *         assert zran_file_util._fseek_python(<PyObject*>f, 1, SEEK_SET) == -1
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":275
 * 
 * 
 * def test_fseek():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_fseek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":294
 * 
 * 
 * def test_feof():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_11test_feof(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_11test_feof = {"test_feof", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_11test_feof, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_11test_feof(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_feof (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_10test_feof(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_10test_feof(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_feof", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":296
 * def test_feof():
 * 
 *     f = BytesIO(b"abc")             # <<<<<<<<<<<<<<
 *     f.seek(0)
 *     # the EOF indicator shouldn't be set...
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_b_abc};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":297
 * 
 *     f = BytesIO(b"abc")
 *     f.seek(0)             # <<<<<<<<<<<<<<
 *     # the EOF indicator shouldn't be set...
 *     assert zran_file_util._feof_python(<PyObject*>f, 2) == 0
*/
  __pyx_t_3 = __pyx_v_f;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_seek, __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_1)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":299
 *     f.seek(0)
 *     # the EOF indicator shouldn't be set...
 *     assert zran_file_util._feof_python(<PyObject*>f, 2) == 0             # <<<<<<<<<<<<<<
 *     # ...unless f_read is zero.
 *     assert zran_file_util._feof_python(<PyObject*>f, 0) == 1
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_feof_python(((PyObject *)__pyx_v_f), 2) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 299, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 299, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":301
 *     assert zran_file_util._feof_python(<PyObject*>f, 2) == 0
 *     # ...unless f_read is zero.
 *     assert zran_file_util._feof_python(<PyObject*>f, 0) == 1             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_feof_python(((PyObject *)__pyx_v_f), 0) == 1);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 301, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 301, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":302
 *     # ...unless f_read is zero.
 *     assert zran_file_util._feof_python(<PyObject*>f, 0) == 1
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 302, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 302, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":294
 * 
 * 
 * def test_feof():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_feof", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":305
 * 
 * 
 * def test_ferror():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_13test_ferror(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_13test_ferror = {"test_ferror", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_13test_ferror, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_13test_ferror(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_ferror (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_12test_ferror(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_12test_ferror(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_ferror", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":307
 * def test_ferror():
 * 
 *     f = BytesIO(b"abc")             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     PyErr_SetString(ValueError, "Error")
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_b_abc};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":308
 * 
 *     f = BytesIO(b"abc")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 *     PyErr_SetString(ValueError, "Error")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 1
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 308, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 308, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":309
 *     f = BytesIO(b"abc")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     PyErr_SetString(ValueError, "Error")             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *     PyErr_Clear()
*/
  PyErr_SetString(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), ((char *)"Error"));

  /* "indexed_gzip/tests/ctest_zran.pyx":310
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     PyErr_SetString(ValueError, "Error")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 1             # <<<<<<<<<<<<<<
 *     PyErr_Clear()
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 1);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 310, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 310, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":311
 *     PyErr_SetString(ValueError, "Error")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *     PyErr_Clear()             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 * 
*/
  PyErr_Clear();

  /* "indexed_gzip/tests/ctest_zran.pyx":312
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *     PyErr_Clear()
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 312, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 312, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":305
 * 
 * 
 * def test_ferror():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_ferror", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":315
 * 
 * 
 * def test_fflush():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_15test_fflush(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_15test_fflush = {"test_fflush", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_15test_fflush, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_15test_fflush(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_fflush (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_14test_fflush(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_14test_fflush(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_fn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_fflush", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":317
 * def test_fflush():
 * 
 *     f = BytesIO(b"abc")             # <<<<<<<<<<<<<<
 *     zran_file_util._fflush_python(<PyObject*>f)
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_b_abc};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":318
 * 
 *     f = BytesIO(b"abc")
 *     zran_file_util._fflush_python(<PyObject*>f)             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 * 
*/
  (void)(_fflush_python(((PyObject *)__pyx_v_f)));

  /* "indexed_gzip/tests/ctest_zran.pyx":319
 *     f = BytesIO(b"abc")
 *     zran_file_util._fflush_python(<PyObject*>f)
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 * 
 *     # fflush error conditions
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 319, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 319, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":322
 * 
 *     # fflush error conditions
 *     for fn in [error_fn]:             # <<<<<<<<<<<<<<
 *         f.flush = fn
 *         assert zran_file_util._fflush_python(<PyObject*>f) == -1
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_error_fn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 322, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_6 >= 1) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6);
    #endif
    ++__pyx_t_6;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_fn, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":323
 *     # fflush error conditions
 *     for fn in [error_fn]:
 *         f.flush = fn             # <<<<<<<<<<<<<<
 *         assert zran_file_util._fflush_python(<PyObject*>f) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_f, __pyx_mstate_global->__pyx_n_u_flush, __pyx_v_fn) < (0)) __PYX_ERR(0, 323, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":324
 *     for fn in [error_fn]:
 *         f.flush = fn
 *         assert zran_file_util._fflush_python(<PyObject*>f) == -1             # <<<<<<<<<<<<<<
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_fflush_python(((PyObject *)__pyx_v_f)) == -1L);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 324, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 324, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":325
 *         f.flush = fn
 *         assert zran_file_util._fflush_python(<PyObject*>f) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1             # <<<<<<<<<<<<<<
 *         PyErr_Clear()
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 1);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 325, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 325, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":326
 *         assert zran_file_util._fflush_python(<PyObject*>f) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    PyErr_Clear();

    /* "indexed_gzip/tests/ctest_zran.pyx":322
 * 
 *     # fflush error conditions
 *     for fn in [error_fn]:             # <<<<<<<<<<<<<<
 *         f.flush = fn
 *         assert zran_file_util._fflush_python(<PyObject*>f) == -1
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":315
 * 
 * 
 * def test_fflush():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_fflush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":329
 * 
 * 
 * def test_fwrite():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_17test_fwrite(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_17test_fwrite = {"test_fwrite", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_17test_fwrite, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_17test_fwrite(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_fwrite (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_16test_fwrite(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_16test_fwrite(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_f = NULL;
  char *__pyx_v_inp;
  size_t __pyx_v_elems_written;
  PyObject *__pyx_v_fn = NULL;
  size_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_fwrite", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":331
 * def test_fwrite():
 * 
 *     f = BytesIO(b"abc")             # <<<<<<<<<<<<<<
 *     cdef char* inp = 'de'
 *     elems_written = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_b_abc};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":332
 * 
 *     f = BytesIO(b"abc")
 *     cdef char* inp = 'de'             # <<<<<<<<<<<<<<
 *     elems_written = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)
 *     assert elems_written == 2
*/
  __pyx_v_inp = ((char *)"de");

  /* "indexed_gzip/tests/ctest_zran.pyx":333
 *     f = BytesIO(b"abc")
 *     cdef char* inp = 'de'
 *     elems_written = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)             # <<<<<<<<<<<<<<
 *     assert elems_written == 2
 *     assert f.tell() == 2
*/
  __pyx_v_elems_written = _fwrite_python(__pyx_v_inp, 1, 2, ((PyObject *)__pyx_v_f));

  /* "indexed_gzip/tests/ctest_zran.pyx":334
 *     cdef char* inp = 'de'
 *     elems_written = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)
 *     assert elems_written == 2             # <<<<<<<<<<<<<<
 *     assert f.tell() == 2
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (__pyx_v_elems_written == 2);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 334, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 334, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":335
 *     elems_written = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)
 *     assert elems_written == 2
 *     assert f.tell() == 2             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     f.seek(0)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __pyx_v_f;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tell, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 335, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 335, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 335, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":336
 *     assert elems_written == 2
 *     assert f.tell() == 2
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 *     f.seek(0)
 *     assert f.read() == b"dec"
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 336, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 336, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":337
 *     assert f.tell() == 2
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     f.seek(0)             # <<<<<<<<<<<<<<
 *     assert f.read() == b"dec"
 * 
*/
  __pyx_t_3 = __pyx_v_f;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_seek, __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_1)) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":338
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     f.seek(0)
 *     assert f.read() == b"dec"             # <<<<<<<<<<<<<<
 * 
 *     # fwrite error conditions
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __pyx_v_f;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_b_dec, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 338, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 338, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 338, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":343
 *     # In Python 2, .write() returns None, so its return value
 *     # is ignored by _fwrite_python and can't cause an error.
 *     for fn in [error_fn, return_fn(None)] if sys.version_info[0] >= 3 else [error_fn]:             # <<<<<<<<<<<<<<
 *         f.write = fn
 *         result = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_mstate_global->__pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_error_fn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_return_fn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(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_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, Py_None};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 343, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 343, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_error_fn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 343, __pyx_L1_error);
    __pyx_t_7 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 343, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error)
      #endif
      if (__pyx_t_8 >= __pyx_temp) break;
    }
    __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_8;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_fn, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":344
 *     # is ignored by _fwrite_python and can't cause an error.
 *     for fn in [error_fn, return_fn(None)] if sys.version_info[0] >= 3 else [error_fn]:
 *         f.write = fn             # <<<<<<<<<<<<<<
 *         result = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)
 *         assert result == 0, result
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_f, __pyx_mstate_global->__pyx_n_u_write, __pyx_v_fn) < (0)) __PYX_ERR(0, 344, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":345
 *     for fn in [error_fn, return_fn(None)] if sys.version_info[0] >= 3 else [error_fn]:
 *         f.write = fn
 *         result = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)             # <<<<<<<<<<<<<<
 *         assert result == 0, result
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
*/
    __pyx_v_result = _fwrite_python(__pyx_v_inp, 1, 2, ((PyObject *)__pyx_v_f));

    /* "indexed_gzip/tests/ctest_zran.pyx":346
 *         f.write = fn
 *         result = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)
 *         assert result == 0, result             # <<<<<<<<<<<<<<
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (__pyx_v_result == 0);
      if (unlikely(!__pyx_t_5)) {
        __pyx_t_1 = __Pyx_PyLong_FromSize_t(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_7, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(0, 346, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 346, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":347
 *         result = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)
 *         assert result == 0, result
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1             # <<<<<<<<<<<<<<
 *         PyErr_Clear()
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 1);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 347, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 347, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":348
 *         assert result == 0, result
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    PyErr_Clear();

    /* "indexed_gzip/tests/ctest_zran.pyx":343
 *     # In Python 2, .write() returns None, so its return value
 *     # is ignored by _fwrite_python and can't cause an error.
 *     for fn in [error_fn, return_fn(None)] if sys.version_info[0] >= 3 else [error_fn]:             # <<<<<<<<<<<<<<
 *         f.write = fn
 *         result = zran_file_util._fwrite_python(inp, 1, 2, <PyObject*>f)
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":329
 * 
 * 
 * def test_fwrite():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":351
 * 
 * 
 * def test_getc():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"dbc")
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_getc(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_19test_getc = {"test_getc", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_getc, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_getc(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_getc (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_18test_getc(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_18test_getc(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_fn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  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("test_getc", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":353
 * def test_getc():
 * 
 *     f = BytesIO(b"dbc")             # <<<<<<<<<<<<<<
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"d")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_b_dbc};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":354
 * 
 *     f = BytesIO(b"dbc")
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"d")             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"b")
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_getc_python(((PyObject *)__pyx_v_f)) == 0x64);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 354, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 354, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":355
 *     f = BytesIO(b"dbc")
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"d")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"b")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 355, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 355, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":356
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"d")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"b")             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"c")
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_getc_python(((PyObject *)__pyx_v_f)) == 98);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 356, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 356, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":357
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"b")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"c")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 357, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 357, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":358
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"b")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"c")             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._getc_python(<PyObject*>f) == -1 # reached EOF
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_getc_python(((PyObject *)__pyx_v_f)) == 99);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 358, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 358, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":359
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"c")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 *     assert zran_file_util._getc_python(<PyObject*>f) == -1 # reached EOF
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 359, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 359, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":360
 *     assert zran_file_util._getc_python(<PyObject*>f) == ord(b"c")
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._getc_python(<PyObject*>f) == -1 # reached EOF             # <<<<<<<<<<<<<<
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._feof_python(<PyObject*>f, 0) == 1
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_getc_python(((PyObject *)__pyx_v_f)) == -1L);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 360, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 360, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":361
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._getc_python(<PyObject*>f) == -1 # reached EOF
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 *     assert zran_file_util._feof_python(<PyObject*>f, 0) == 1
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 361, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 361, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":362
 *     assert zran_file_util._getc_python(<PyObject*>f) == -1 # reached EOF
 *     assert zran_file_util._ferror_python(<PyObject*>f) == 0
 *     assert zran_file_util._feof_python(<PyObject*>f, 0) == 1             # <<<<<<<<<<<<<<
 * 
 *     # getc error conditions
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_feof_python(((PyObject *)__pyx_v_f), 0) == 1);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 362, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 362, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":365
 * 
 *     # getc error conditions
 *     for fn in [error_fn, return_fn(None)]:             # <<<<<<<<<<<<<<
 *         f.read = fn
 *         assert zran_file_util._getc_python(<PyObject*>f) == -1
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_error_fn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return_fn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, Py_None};
    __pyx_t_3 = __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_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 365, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 365, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_7 >= 2) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7));
    #else
    __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7);
    #endif
    ++__pyx_t_7;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_fn, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":366
 *     # getc error conditions
 *     for fn in [error_fn, return_fn(None)]:
 *         f.read = fn             # <<<<<<<<<<<<<<
 *         assert zran_file_util._getc_python(<PyObject*>f) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_f, __pyx_mstate_global->__pyx_n_u_read, __pyx_v_fn) < (0)) __PYX_ERR(0, 366, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":367
 *     for fn in [error_fn, return_fn(None)]:
 *         f.read = fn
 *         assert zran_file_util._getc_python(<PyObject*>f) == -1             # <<<<<<<<<<<<<<
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_getc_python(((PyObject *)__pyx_v_f)) == -1L);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 367, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 367, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":368
 *         f.read = fn
 *         assert zran_file_util._getc_python(<PyObject*>f) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1             # <<<<<<<<<<<<<<
 *         PyErr_Clear()
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = (_ferror_python(((PyObject *)__pyx_v_f)) == 1);
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 368, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 368, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":369
 *         assert zran_file_util._getc_python(<PyObject*>f) == -1
 *         assert zran_file_util._ferror_python(<PyObject*>f) == 1
 *         PyErr_Clear()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    PyErr_Clear();

    /* "indexed_gzip/tests/ctest_zran.pyx":365
 * 
 *     # getc error conditions
 *     for fn in [error_fn, return_fn(None)]:             # <<<<<<<<<<<<<<
 *         f.read = fn
 *         assert zran_file_util._getc_python(<PyObject*>f) == -1
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":351
 * 
 * 
 * def test_getc():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"dbc")
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_getc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":372
 * 
 * 
 * def test_seekable():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_21test_seekable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_21test_seekable = {"test_seekable", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_21test_seekable, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_21test_seekable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_seekable (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_20test_seekable(__pyx_self);

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

/* "indexed_gzip/tests/ctest_zran.pyx":376
 *     f = BytesIO(b"abc")
 *     assert zran_file_util._seekable_python(<PyObject*>f) == 1
 *     f.seekable = lambda: False             # <<<<<<<<<<<<<<
 *     assert zran_file_util._seekable_python(<PyObject*>f) == 0
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_13test_seekable_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_13test_seekable_lambda2 = {"lambda2", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_13test_seekable_lambda2, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_13test_seekable_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

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

/* "indexed_gzip/tests/ctest_zran.pyx":372
 * 
 * 
 * def test_seekable():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_20test_seekable(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_seekable", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":374
 * def test_seekable():
 * 
 *     f = BytesIO(b"abc")             # <<<<<<<<<<<<<<
 *     assert zran_file_util._seekable_python(<PyObject*>f) == 1
 *     f.seekable = lambda: False
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_b_abc};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":375
 * 
 *     f = BytesIO(b"abc")
 *     assert zran_file_util._seekable_python(<PyObject*>f) == 1             # <<<<<<<<<<<<<<
 *     f.seekable = lambda: False
 *     assert zran_file_util._seekable_python(<PyObject*>f) == 0
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_seekable_python(((PyObject *)__pyx_v_f)) == 1);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 375, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 375, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":376
 *     f = BytesIO(b"abc")
 *     assert zran_file_util._seekable_python(<PyObject*>f) == 1
 *     f.seekable = lambda: False             # <<<<<<<<<<<<<<
 *     assert zran_file_util._seekable_python(<PyObject*>f) == 0
 * 
*/
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_13test_seekable_lambda2, 0, __pyx_mstate_global->__pyx_n_u_test_seekable_locals_lambda, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_f, __pyx_mstate_global->__pyx_n_u_seekable, __pyx_t_1) < (0)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":377
 *     assert zran_file_util._seekable_python(<PyObject*>f) == 1
 *     f.seekable = lambda: False
 *     assert zran_file_util._seekable_python(<PyObject*>f) == 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = (_seekable_python(((PyObject *)__pyx_v_f)) == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 377, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 377, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":372
 * 
 * 
 * def test_seekable():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seekable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":380
 * 
 * 
 * def test_init(testfile, no_fds):             # <<<<<<<<<<<<<<
 *     """Tests a bunch of permutations of the parameters to zran_init. """
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_23test_init(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_12indexed_gzip_5tests_10ctest_zran_22test_init, "Tests a bunch of permutations of the parameters to zran_init. ");
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_23test_init = {"test_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_23test_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_22test_init};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_23test_init(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_init (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 380, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 380, __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, "test_init", 0) < (0)) __PYX_ERR(0, 380, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_init", 1, 2, 2, i); __PYX_ERR(0, 380, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 380, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 380, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_init", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 380, __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("indexed_gzip.tests.ctest_zran.test_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_22test_init(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds);

  /* 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_12indexed_gzip_5tests_10ctest_zran_22test_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds) {
  PyObject *__pyx_v_spacings = NULL;
  PyObject *__pyx_v_window_sizes = NULL;
  PyObject *__pyx_v_readbuf_sizes = NULL;
  PyObject *__pyx_v_flags = NULL;
  zran_index_t __pyx_v_index;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_pyfid = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_f = NULL;
  int __pyx_v_result;
  PyObject *__pyx_v_expected = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  void *__pyx_t_17;
  int __pyx_t_18;
  PyObject *__pyx_t_19;
  uint32_t __pyx_t_20;
  uint32_t __pyx_t_21;
  uint32_t __pyx_t_22;
  uint16_t __pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_init", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":383
 *     """Tests a bunch of permutations of the parameters to zran_init. """
 * 
 *     spacings      = [0, 16384, 32768, 65536, 524288, 1048576, 2097152, 4194304]             # <<<<<<<<<<<<<<
 *     window_sizes  = [0, 8192, 16384, 32768, 65536, 131072]
 *     readbuf_sizes = [0, 8192, 16384, 24576, 32768, 65536, 131072]
*/
  __pyx_t_1 = PyList_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 383, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_16384);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_16384);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_16384) != (0)) __PYX_ERR(0, 383, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_32768);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_32768);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_32768) != (0)) __PYX_ERR(0, 383, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_65536);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_65536);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_65536) != (0)) __PYX_ERR(0, 383, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_524288);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_524288);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_524288) != (0)) __PYX_ERR(0, 383, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1048576);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1048576);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_int_1048576) != (0)) __PYX_ERR(0, 383, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2097152);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2097152);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_mstate_global->__pyx_int_2097152) != (0)) __PYX_ERR(0, 383, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4194304);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4194304);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 7, __pyx_mstate_global->__pyx_int_4194304) != (0)) __PYX_ERR(0, 383, __pyx_L1_error);
  __pyx_v_spacings = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":384
 * 
 *     spacings      = [0, 16384, 32768, 65536, 524288, 1048576, 2097152, 4194304]
 *     window_sizes  = [0, 8192, 16384, 32768, 65536, 131072]             # <<<<<<<<<<<<<<
 *     readbuf_sizes = [0, 8192, 16384, 24576, 32768, 65536, 131072]
 *     flags         = [0, zran.ZRAN_AUTO_BUILD]
*/
  __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 384, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_8192);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_8192);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_8192) != (0)) __PYX_ERR(0, 384, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_16384);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_16384);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_16384) != (0)) __PYX_ERR(0, 384, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_32768);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_32768);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_32768) != (0)) __PYX_ERR(0, 384, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_65536);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_65536);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_65536) != (0)) __PYX_ERR(0, 384, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_131072);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_131072);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_int_131072) != (0)) __PYX_ERR(0, 384, __pyx_L1_error);
  __pyx_v_window_sizes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":385
 *     spacings      = [0, 16384, 32768, 65536, 524288, 1048576, 2097152, 4194304]
 *     window_sizes  = [0, 8192, 16384, 32768, 65536, 131072]
 *     readbuf_sizes = [0, 8192, 16384, 24576, 32768, 65536, 131072]             # <<<<<<<<<<<<<<
 *     flags         = [0, zran.ZRAN_AUTO_BUILD]
 * 
*/
  __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 385, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_8192);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_8192);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_8192) != (0)) __PYX_ERR(0, 385, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_16384);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_16384);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_16384) != (0)) __PYX_ERR(0, 385, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_24576);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_24576);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_24576) != (0)) __PYX_ERR(0, 385, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_32768);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_32768);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_32768) != (0)) __PYX_ERR(0, 385, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_65536);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_65536);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_int_65536) != (0)) __PYX_ERR(0, 385, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_131072);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_131072);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_mstate_global->__pyx_int_131072) != (0)) __PYX_ERR(0, 385, __pyx_L1_error);
  __pyx_v_readbuf_sizes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":386
 *     window_sizes  = [0, 8192, 16384, 32768, 65536, 131072]
 *     readbuf_sizes = [0, 8192, 16384, 24576, 32768, 65536, 131072]
 *     flags         = [0, zran.ZRAN_AUTO_BUILD]             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_1 = __Pyx_PyLong_From___pyx_anon_enum(ZRAN_AUTO_BUILD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 386, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 386, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_v_flags = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":391
 *     cdef FILE             *cfid
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 * 
 *         cfid = fdopen(pyfid.fileno(), 'rb')
*/
  /*with:*/ {
    __pyx_t_1 = NULL;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_6 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":393
 *     with open(testfile, 'rb') as pyfid:
 * 
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         for s, w, r, f in it.product(spacings,
*/
          __pyx_t_2 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
            __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __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_6)) __PYX_ERR(0, 393, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_10, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":395
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         for s, w, r, f in it.product(spacings,             # <<<<<<<<<<<<<<
 *                                      window_sizes,
 *                                      readbuf_sizes,
*/
          __pyx_t_2 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":398
 *                                      window_sizes,
 *                                      readbuf_sizes,
 *                                      flags):             # <<<<<<<<<<<<<<
 * 
 *             result = not zran.zran_init(&index, NULL if no_fds else cfid, <PyObject*>pyfid if no_fds else NULL, s, w, r, f)
*/
          __pyx_t_3 = 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_3 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_spacings, __pyx_v_window_sizes, __pyx_v_readbuf_sizes, __pyx_v_flags};
            __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":395
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         for s, w, r, f in it.product(spacings,             # <<<<<<<<<<<<<<
 *                                      window_sizes,
 *                                      readbuf_sizes,
*/
          if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
            __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
            __pyx_t_11 = 0;
            __pyx_t_12 = NULL;
          } else {
            __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 395, __pyx_L7_error)
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          for (;;) {
            if (likely(!__pyx_t_12)) {
              if (likely(PyList_CheckExact(__pyx_t_5))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 395, __pyx_L7_error)
                  #endif
                  if (__pyx_t_11 >= __pyx_temp) break;
                }
                __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference);
                ++__pyx_t_11;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 395, __pyx_L7_error)
                  #endif
                  if (__pyx_t_11 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11));
                #else
                __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_11);
                #endif
                ++__pyx_t_11;
              }
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L7_error)
            } else {
              __pyx_t_6 = __pyx_t_12(__pyx_t_5);
              if (unlikely(!__pyx_t_6)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 395, __pyx_L7_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_6);
            if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
              PyObject* sequence = __pyx_t_6;
              Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
              if (unlikely(size != 4)) {
                if (size > 4) __Pyx_RaiseTooManyValuesError(4);
                else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                __PYX_ERR(0, 395, __pyx_L7_error)
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              if (likely(PyTuple_CheckExact(sequence))) {
                __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
                __Pyx_INCREF(__pyx_t_2);
                __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
                __Pyx_INCREF(__pyx_t_1);
                __pyx_t_13 = PyTuple_GET_ITEM(sequence, 2);
                __Pyx_INCREF(__pyx_t_13);
                __pyx_t_14 = PyTuple_GET_ITEM(sequence, 3);
                __Pyx_INCREF(__pyx_t_14);
              } else {
                __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L7_error)
                __Pyx_XGOTREF(__pyx_t_2);
                __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L7_error)
                __Pyx_XGOTREF(__pyx_t_1);
                __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
                if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 395, __pyx_L7_error)
                __Pyx_XGOTREF(__pyx_t_13);
                __pyx_t_14 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
                if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 395, __pyx_L7_error)
                __Pyx_XGOTREF(__pyx_t_14);
              }
              #else
              {
                Py_ssize_t i;
                PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_13,&__pyx_t_14};
                for (i=0; i < 4; i++) {
                  PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 395, __pyx_L7_error)
                  __Pyx_GOTREF(item);
                  *(temps[i]) = item;
                }
              }
              #endif
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            } else {
              Py_ssize_t index = -1;
              PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_13,&__pyx_t_14};
              __pyx_t_15 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 395, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_15);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_15);
              for (index=0; index < 4; index++) {
                PyObject* item = __pyx_t_16(__pyx_t_15); if (unlikely(!item)) goto __pyx_L15_unpacking_failed;
                __Pyx_GOTREF(item);
                *(temps[index]) = item;
              }
              if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 4) < (0)) __PYX_ERR(0, 395, __pyx_L7_error)
              __pyx_t_16 = NULL;
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              goto __pyx_L16_unpacking_done;
              __pyx_L15_unpacking_failed:;
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              __pyx_t_16 = NULL;
              if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
              __PYX_ERR(0, 395, __pyx_L7_error)
              __pyx_L16_unpacking_done:;
            }
            __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_13);
            __pyx_t_13 = 0;
            __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_14);
            __pyx_t_14 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":400
 *                                      flags):
 * 
 *             result = not zran.zran_init(&index, NULL if no_fds else cfid, <PyObject*>pyfid if no_fds else NULL, s, w, r, f)             # <<<<<<<<<<<<<<
 * 
 *             expected = True
*/
            __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 400, __pyx_L7_error)
            if (__pyx_t_18) {
              __pyx_t_17 = NULL;
            } else {
              __pyx_t_17 = __pyx_v_cfid;
            }
            __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 400, __pyx_L7_error)
            if (__pyx_t_18) {
              __pyx_t_19 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_19 = NULL;
            }
            __pyx_t_20 = __Pyx_PyLong_As_uint32_t(__pyx_v_s); if (unlikely((__pyx_t_20 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L7_error)
            __pyx_t_21 = __Pyx_PyLong_As_uint32_t(__pyx_v_w); if (unlikely((__pyx_t_21 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L7_error)
            __pyx_t_22 = __Pyx_PyLong_As_uint32_t(__pyx_v_r); if (unlikely((__pyx_t_22 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L7_error)
            __pyx_t_23 = __Pyx_PyLong_As_uint16_t(__pyx_v_f); if (unlikely((__pyx_t_23 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L7_error)
            __pyx_v_result = (!(zran_init((&__pyx_v_index), __pyx_t_17, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23) != 0));

            /* "indexed_gzip/tests/ctest_zran.pyx":402
 *             result = not zran.zran_init(&index, NULL if no_fds else cfid, <PyObject*>pyfid if no_fds else NULL, s, w, r, f)
 * 
 *             expected = True             # <<<<<<<<<<<<<<
 * 
 *             # zran_init should fail if the point spacing
*/
            __Pyx_INCREF(Py_True);
            __Pyx_XDECREF_SET(__pyx_v_expected, Py_True);

            /* "indexed_gzip/tests/ctest_zran.pyx":407
 *             # is less than the window size
 * 
 *             if w == 0: w = 32768             # <<<<<<<<<<<<<<
 *             if s == 0: s = 1048576
 *             if r == 0: r = 16384
*/
            __pyx_t_18 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_w, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 407, __pyx_L7_error)
            if (__pyx_t_18) {
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_32768);
              __Pyx_DECREF_SET(__pyx_v_w, __pyx_mstate_global->__pyx_int_32768);
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":408
 * 
 *             if w == 0: w = 32768
 *             if s == 0: s = 1048576             # <<<<<<<<<<<<<<
 *             if r == 0: r = 16384
 * 
*/
            __pyx_t_18 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_s, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 408, __pyx_L7_error)
            if (__pyx_t_18) {
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1048576);
              __Pyx_DECREF_SET(__pyx_v_s, __pyx_mstate_global->__pyx_int_1048576);
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":409
 *             if w == 0: w = 32768
 *             if s == 0: s = 1048576
 *             if r == 0: r = 16384             # <<<<<<<<<<<<<<
 * 
 *             expected = (w >= 32768) and (s > w)
*/
            __pyx_t_18 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_r, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 409, __pyx_L7_error)
            if (__pyx_t_18) {
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_16384);
              __Pyx_DECREF_SET(__pyx_v_r, __pyx_mstate_global->__pyx_int_16384);
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":411
 *             if r == 0: r = 16384
 * 
 *             expected = (w >= 32768) and (s > w)             # <<<<<<<<<<<<<<
 * 
 *             assert result == expected
*/
            __pyx_t_14 = PyObject_RichCompare(__pyx_v_w, __pyx_mstate_global->__pyx_int_32768, Py_GE); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 411, __pyx_L7_error)
            __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 411, __pyx_L7_error)
            if (__pyx_t_18) {
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            } else {
              __Pyx_INCREF(__pyx_t_14);
              __pyx_t_6 = __pyx_t_14;
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              goto __pyx_L20_bool_binop_done;
            }
            __pyx_t_14 = PyObject_RichCompare(__pyx_v_s, __pyx_v_w, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 411, __pyx_L7_error)
            __Pyx_INCREF(__pyx_t_14);
            __pyx_t_6 = __pyx_t_14;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_L20_bool_binop_done:;
            __Pyx_DECREF_SET(__pyx_v_expected, __pyx_t_6);
            __pyx_t_6 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":413
 *             expected = (w >= 32768) and (s > w)
 * 
 *             assert result == expected             # <<<<<<<<<<<<<<
 * 
 *             zran.zran_free(&index)
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_14 = PyObject_RichCompare(__pyx_t_6, __pyx_v_expected, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 413, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 413, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              if (unlikely(!__pyx_t_18)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 413, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 413, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":415
 *             assert result == expected
 * 
 *             zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
            zran_free((&__pyx_v_index));

            /* "indexed_gzip/tests/ctest_zran.pyx":395
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         for s, w, r, f in it.product(spacings,             # <<<<<<<<<<<<<<
 *                                      window_sizes,
 *                                      readbuf_sizes,
*/
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":391
 *     cdef FILE             *cfid
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 * 
 *         cfid = fdopen(pyfid.fileno(), 'rb')
*/
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_14, &__pyx_t_6) < 0) __PYX_ERR(0, 391, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_13 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_14, __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 391, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 391, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_24);
          __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_24);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
          if (__pyx_t_18 < (0)) __PYX_ERR(0, 391, __pyx_L9_except_error)
          __pyx_t_25 = (!__pyx_t_18);
          if (unlikely(__pyx_t_25)) {
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_6);
            __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_14, __pyx_t_6);
            __pyx_t_5 = 0;  __pyx_t_14 = 0;  __pyx_t_6 = 0; 
            __PYX_ERR(0, 391, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_4) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 391, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L26;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L26:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":380
 * 
 * 
 * def test_init(testfile, no_fds):             # <<<<<<<<<<<<<<
 *     """Tests a bunch of permutations of the parameters to zran_init. """
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_spacings);
  __Pyx_XDECREF(__pyx_v_window_sizes);
  __Pyx_XDECREF(__pyx_v_readbuf_sizes);
  __Pyx_XDECREF(__pyx_v_flags);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_expected);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":418
 * 
 * 
 * def test_init_file_modes(testfile, no_fds):             # <<<<<<<<<<<<<<
 * 
 *     modes = ['r', 'r+', 'w', 'w+', 'a', 'a+']
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_25test_init_file_modes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_25test_init_file_modes = {"test_init_file_modes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_25test_init_file_modes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_25test_init_file_modes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_init_file_modes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 418, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 418, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 418, __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, "test_init_file_modes", 0) < (0)) __PYX_ERR(0, 418, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_init_file_modes", 1, 2, 2, i); __PYX_ERR(0, 418, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 418, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 418, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_init_file_modes", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 418, __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("indexed_gzip.tests.ctest_zran.test_init_file_modes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_24test_init_file_modes(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds);

  /* 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_12indexed_gzip_5tests_10ctest_zran_24test_init_file_modes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds) {
  PyObject *__pyx_v_modes = NULL;
  PyObject *__pyx_v_files = NULL;
  zran_index_t __pyx_v_index;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_bmode = 0;
  char *__pyx_v_cmode;
  PyObject *__pyx_v_filename = NULL;
  PyObject *__pyx_v_mode = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  PyObject *__pyx_v_expected = NULL;
  int __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  char *__pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  void *__pyx_t_17;
  PyObject *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_init_file_modes", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":420
 * def test_init_file_modes(testfile, no_fds):
 * 
 *     modes = ['r', 'r+', 'w', 'w+', 'a', 'a+']             # <<<<<<<<<<<<<<
 * 
 *     files = [testfile, testfile,
*/
  __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_r);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_r);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_r) != (0)) __PYX_ERR(0, 420, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_r_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_r_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_kp_u_r_2) != (0)) __PYX_ERR(0, 420, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_w);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_w);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_n_u_w) != (0)) __PYX_ERR(0, 420, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_w_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_w_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_kp_u_w_2) != (0)) __PYX_ERR(0, 420, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_a);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_a);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_n_u_a) != (0)) __PYX_ERR(0, 420, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_a_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_a_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_kp_u_a_2) != (0)) __PYX_ERR(0, 420, __pyx_L1_error);
  __pyx_v_modes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":422
 *     modes = ['r', 'r+', 'w', 'w+', 'a', 'a+']
 * 
 *     files = [testfile, testfile,             # <<<<<<<<<<<<<<
 *              'dummy.gz', 'dummy.gz', 'dummy.gz', 'dummy.gz']
 * 
*/
  __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_testfile);
  __Pyx_GIVEREF(__pyx_v_testfile);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_testfile) != (0)) __PYX_ERR(0, 422, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_testfile);
  __Pyx_GIVEREF(__pyx_v_testfile);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_testfile) != (0)) __PYX_ERR(0, 422, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_dummy_gz);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_dummy_gz);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_kp_u_dummy_gz) != (0)) __PYX_ERR(0, 422, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_dummy_gz);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_dummy_gz);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_kp_u_dummy_gz) != (0)) __PYX_ERR(0, 422, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_dummy_gz);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_dummy_gz);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_kp_u_dummy_gz) != (0)) __PYX_ERR(0, 422, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_dummy_gz);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_dummy_gz);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_kp_u_dummy_gz) != (0)) __PYX_ERR(0, 422, __pyx_L1_error);
  __pyx_v_files = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":430
 *     cdef char             *cmode
 * 
 *     for filename, mode in zip(files, modes):             # <<<<<<<<<<<<<<
 * 
 *         with open(filename, mode) as pyfid:
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_files, __pyx_v_modes};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 430, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 430, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 430, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 430, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_7);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(0, 430, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 430, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_mode, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":432
 *     for filename, mode in zip(files, modes):
 * 
 *         with open(filename, mode) as pyfid:             # <<<<<<<<<<<<<<
 * 
 *             bmode    = mode.encode()
*/
    /*with:*/ {
      __pyx_t_7 = NULL;
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_filename, __pyx_v_mode};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 432, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = NULL;
      __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = 1;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_3 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_8 = __pyx_t_7;
      __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          /*try:*/ {
            __Pyx_XDECREF_SET(__pyx_v_pyfid, __pyx_t_8);
            __pyx_t_8 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":434
 *         with open(filename, mode) as pyfid:
 * 
 *             bmode    = mode.encode()             # <<<<<<<<<<<<<<
 *             cmode    = bmode
 *             cfid     = fdopen(pyfid.fileno(), cmode)
*/
            __pyx_t_1 = __pyx_v_mode;
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
              __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_8);
            }
            if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_8))) __PYX_ERR(0, 434, __pyx_L13_error)
            __Pyx_XDECREF_SET(__pyx_v_bmode, ((PyObject*)__pyx_t_8));
            __pyx_t_8 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":435
 * 
 *             bmode    = mode.encode()
 *             cmode    = bmode             # <<<<<<<<<<<<<<
 *             cfid     = fdopen(pyfid.fileno(), cmode)
 * 
*/
            if (unlikely(__pyx_v_bmode == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
              __PYX_ERR(0, 435, __pyx_L13_error)
            }
            __pyx_t_14 = __Pyx_PyBytes_AsWritableString(__pyx_v_bmode); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L13_error)
            __pyx_v_cmode = __pyx_t_14;

            /* "indexed_gzip/tests/ctest_zran.pyx":436
 *             bmode    = mode.encode()
 *             cmode    = bmode
 *             cfid     = fdopen(pyfid.fileno(), cmode)             # <<<<<<<<<<<<<<
 * 
 *             # If no_fds is set, we can't detect the mode, so reading is always allowed.
*/
            __pyx_t_1 = __pyx_v_pyfid;
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
              __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 436, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_8);
            }
            __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L13_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_cfid = fdopen(__pyx_t_15, __pyx_v_cmode);

            /* "indexed_gzip/tests/ctest_zran.pyx":439
 * 
 *             # If no_fds is set, we can't detect the mode, so reading is always allowed.
 *             expected = 1 if no_fds else mode == 'r'             # <<<<<<<<<<<<<<
 * 
 *             result = not zran.zran_init(&index, NULL if no_fds else cfid, <PyObject*>pyfid if no_fds else NULL, 0, 0, 0, 0)
*/
            __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 439, __pyx_L13_error)
            if (__pyx_t_16) {
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
              __pyx_t_8 = __pyx_mstate_global->__pyx_int_1;
            } else {
              __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_r, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L13_error)
              __pyx_t_8 = __pyx_t_1;
              __pyx_t_1 = 0;
            }
            __Pyx_XDECREF_SET(__pyx_v_expected, __pyx_t_8);
            __pyx_t_8 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":441
 *             expected = 1 if no_fds else mode == 'r'
 * 
 *             result = not zran.zran_init(&index, NULL if no_fds else cfid, <PyObject*>pyfid if no_fds else NULL, 0, 0, 0, 0)             # <<<<<<<<<<<<<<
 * 
 *             assert result == expected
*/
            __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 441, __pyx_L13_error)
            if (__pyx_t_16) {
              __pyx_t_17 = NULL;
            } else {
              __pyx_t_17 = __pyx_v_cfid;
            }
            __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 441, __pyx_L13_error)
            if (__pyx_t_16) {
              __pyx_t_18 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_18 = NULL;
            }
            __pyx_v_result = (!(zran_init((&__pyx_v_index), __pyx_t_17, __pyx_t_18, 0, 0, 0, 0) != 0));

            /* "indexed_gzip/tests/ctest_zran.pyx":443
 *             result = not zran.zran_init(&index, NULL if no_fds else cfid, <PyObject*>pyfid if no_fds else NULL, 0, 0, 0, 0)
 * 
 *             assert result == expected             # <<<<<<<<<<<<<<
 * 
 *             zran.zran_free(&index)
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 443, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_v_expected, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L13_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 443, __pyx_L13_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (unlikely(!__pyx_t_16)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 443, __pyx_L13_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 443, __pyx_L13_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":445
 *             assert result == expected
 * 
 *             zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *         if filename == 'dummy.gz' and op.exists(filename):
*/
            zran_free((&__pyx_v_index));

            /* "indexed_gzip/tests/ctest_zran.pyx":432
 *     for filename, mode in zip(files, modes):
 * 
 *         with open(filename, mode) as pyfid:             # <<<<<<<<<<<<<<
 * 
 *             bmode    = mode.encode()
*/
          }
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L20_try_end;
          __pyx_L13_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;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_init_file_modes", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(0, 432, __pyx_L15_except_error)
            __Pyx_XGOTREF(__pyx_t_1);
            __Pyx_XGOTREF(__pyx_t_8);
            __Pyx_XGOTREF(__pyx_t_7);
            __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L15_except_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 432, __pyx_L15_except_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            if (__pyx_t_16 < (0)) __PYX_ERR(0, 432, __pyx_L15_except_error)
            __pyx_t_20 = (!__pyx_t_16);
            if (unlikely(__pyx_t_20)) {
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_8);
              __Pyx_XGIVEREF(__pyx_t_7);
              __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_8, __pyx_t_7);
              __pyx_t_1 = 0;  __pyx_t_8 = 0;  __pyx_t_7 = 0; 
              __PYX_ERR(0, 432, __pyx_L15_except_error)
            }
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            goto __pyx_L14_exception_handled;
          }
          __pyx_L15_except_error:;
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
          goto __pyx_L1_error;
          __pyx_L14_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
          __pyx_L20_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_10) {
            __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      goto __pyx_L24;
      __pyx_L7_error:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L1_error;
      __pyx_L24:;
    }

    /* "indexed_gzip/tests/ctest_zran.pyx":447
 *             zran.zran_free(&index)
 * 
 *         if filename == 'dummy.gz' and op.exists(filename):             # <<<<<<<<<<<<<<
 *             os.remove(filename)
 * 
*/
    __pyx_t_16 = (__Pyx_PyUnicode_Equals(__pyx_v_filename, __pyx_mstate_global->__pyx_kp_u_dummy_gz, Py_EQ)); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 447, __pyx_L1_error)
    if (__pyx_t_16) {
    } else {
      __pyx_t_20 = __pyx_t_16;
      goto __pyx_L26_bool_binop_done;
    }
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_op); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exists); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_filename};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 447, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 447, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_20 = __pyx_t_16;
    __pyx_L26_bool_binop_done:;
    if (__pyx_t_20) {

      /* "indexed_gzip/tests/ctest_zran.pyx":448
 * 
 *         if filename == 'dummy.gz' and op.exists(filename):
 *             os.remove(filename)             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_3 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
        __pyx_t_3 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_filename};
        __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 448, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":447
 *             zran.zran_free(&index)
 * 
 *         if filename == 'dummy.gz' and op.exists(filename):             # <<<<<<<<<<<<<<
 *             os.remove(filename)
 * 
*/
    }

    /* "indexed_gzip/tests/ctest_zran.pyx":430
 *     cdef char             *cmode
 * 
 *     for filename, mode in zip(files, modes):             # <<<<<<<<<<<<<<
 * 
 *         with open(filename, mode) as pyfid:
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":418
 * 
 * 
 * def test_init_file_modes(testfile, no_fds):             # <<<<<<<<<<<<<<
 * 
 *     modes = ['r', 'r+', 'w', 'w+', 'a', 'a+']
*/

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_init_file_modes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_modes);
  __Pyx_XDECREF(__pyx_v_files);
  __Pyx_XDECREF(__pyx_v_bmode);
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XDECREF(__pyx_v_mode);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_expected);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":451
 * 
 * 
 * def test_no_auto_build(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_27test_no_auto_build(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_27test_no_auto_build = {"test_no_auto_build", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_27test_no_auto_build, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_27test_no_auto_build(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_no_auto_build (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 451, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 451, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 451, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 451, __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, "test_no_auto_build", 0) < (0)) __PYX_ERR(0, 451, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_no_auto_build", 1, 3, 3, i); __PYX_ERR(0, 451, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 451, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 451, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 451, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_no_auto_build", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 451, __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("indexed_gzip.tests.ctest_zran.test_no_auto_build", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_26test_no_auto_build(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems);

  /* 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_12indexed_gzip_5tests_10ctest_zran_26test_no_auto_build(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems) {
  zran_index_t __pyx_v_index;
  void *__pyx_v_buffer;
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  long __pyx_v_bufSize;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_buf = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_gotread = NULL;
  uint64_t __pyx_v_gottell;
  PyObject *__pyx_v_expread = NULL;
  PyObject *__pyx_v_exptell = NULL;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  void *__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14;
  uint32_t __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  int __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_no_auto_build", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":456
 *     cdef void             *buffer
 * 
 *     filesize     = nelems * 8             # <<<<<<<<<<<<<<
 *     indexSpacing = max(1048576, filesize // 1500)
 *     bufSize      = 1048576
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":457
 * 
 *     filesize     = nelems * 8
 *     indexSpacing = max(1048576, filesize // 1500)             # <<<<<<<<<<<<<<
 *     bufSize      = 1048576
 *     buf          = ReadBuffer(bufSize)
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1500, 0x5DC, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0x100000;
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":458
 *     filesize     = nelems * 8
 *     indexSpacing = max(1048576, filesize // 1500)
 *     bufSize      = 1048576             # <<<<<<<<<<<<<<
 *     buf          = ReadBuffer(bufSize)
 *     buffer       = buf.buffer
*/
  __pyx_v_bufSize = 0x100000;

  /* "indexed_gzip/tests/ctest_zran.pyx":459
 *     indexSpacing = max(1048576, filesize // 1500)
 *     bufSize      = 1048576
 *     buf          = ReadBuffer(bufSize)             # <<<<<<<<<<<<<<
 *     buffer       = buf.buffer
 * 
*/
  __pyx_t_3 = NULL;
  __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_v_bufSize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, __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_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":460
 *     bufSize      = 1048576
 *     buf          = ReadBuffer(bufSize)
 *     buffer       = buf.buffer             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __pyx_t_8 = __pyx_v_buf->buffer;
  __pyx_v_buffer = __pyx_t_8;

  /* "indexed_gzip/tests/ctest_zran.pyx":462
 *     buffer       = buf.buffer
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_5 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_4 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":463
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_1 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_13 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_13, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":465
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":466
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 466, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_8 = NULL;
            } else {
              __pyx_t_8 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":467
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 467, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_14 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_14 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":468
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_15 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L7_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":465
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_6 = (!(zran_init((&__pyx_v_index), __pyx_t_8, __pyx_t_14, __pyx_t_15, 0x8000, 0x20000, 0) != 0));
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 465, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 465, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":473
 *                                   0)
 * 
 *         assert zran.zran_seek(&index, 0, SEEK_SET, NULL) == zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 *         assert zran.zran_tell(&index) == 0
 *         assert zran.zran_seek(&index, 1, SEEK_SET, NULL) == zran.ZRAN_SEEK_NOT_COVERED
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_seek((&__pyx_v_index), 0, SEEK_SET, NULL) == ZRAN_SEEK_OK);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 473, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 473, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":474
 * 
 *         assert zran.zran_seek(&index, 0, SEEK_SET, NULL) == zran.ZRAN_SEEK_OK
 *         assert zran.zran_tell(&index) == 0             # <<<<<<<<<<<<<<
 *         assert zran.zran_seek(&index, 1, SEEK_SET, NULL) == zran.ZRAN_SEEK_NOT_COVERED
 *         assert zran.zran_tell(&index) == 0
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_tell((&__pyx_v_index)) == 0);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 474, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 474, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":475
 *         assert zran.zran_seek(&index, 0, SEEK_SET, NULL) == zran.ZRAN_SEEK_OK
 *         assert zran.zran_tell(&index) == 0
 *         assert zran.zran_seek(&index, 1, SEEK_SET, NULL) == zran.ZRAN_SEEK_NOT_COVERED             # <<<<<<<<<<<<<<
 *         assert zran.zran_tell(&index) == 0
 * 
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_seek((&__pyx_v_index), 1, SEEK_SET, NULL) == ZRAN_SEEK_NOT_COVERED);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 475, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 475, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":476
 *         assert zran.zran_tell(&index) == 0
 *         assert zran.zran_seek(&index, 1, SEEK_SET, NULL) == zran.ZRAN_SEEK_NOT_COVERED
 *         assert zran.zran_tell(&index) == 0             # <<<<<<<<<<<<<<
 * 
 *         gotread = zran.zran_read(&index, buffer, bufSize)
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_tell((&__pyx_v_index)) == 0);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 476, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 476, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":478
 *         assert zran.zran_tell(&index) == 0
 * 
 *         gotread = zran.zran_read(&index, buffer, bufSize)             # <<<<<<<<<<<<<<
 *         gottell = zran.zran_tell(&index)
 * 
*/
          __pyx_t_4 = __Pyx_PyLong_From_int64_t(zran_read((&__pyx_v_index), __pyx_v_buffer, __pyx_v_bufSize)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_v_gotread = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":479
 * 
 *         gotread = zran.zran_read(&index, buffer, bufSize)
 *         gottell = zran.zran_tell(&index)             # <<<<<<<<<<<<<<
 * 
 *         if bufSize > filesize: expread = filesize
*/
          __pyx_v_gottell = zran_tell((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":481
 *         gottell = zran.zran_tell(&index)
 * 
 *         if bufSize > filesize: expread = filesize             # <<<<<<<<<<<<<<
 *         else:                  expread = bufSize
 * 
*/
          __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_bufSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_filesize, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 481, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_6) {
            __Pyx_INCREF(__pyx_v_filesize);
            __pyx_v_expread = __pyx_v_filesize;
            goto __pyx_L13;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":482
 * 
 *         if bufSize > filesize: expread = filesize
 *         else:                  expread = bufSize             # <<<<<<<<<<<<<<
 * 
 *         if bufSize > filesize: exptell = filesize
*/
          /*else*/ {
            __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v_bufSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_expread = __pyx_t_1;
            __pyx_t_1 = 0;
          }
          __pyx_L13:;

          /* "indexed_gzip/tests/ctest_zran.pyx":484
 *         else:                  expread = bufSize
 * 
 *         if bufSize > filesize: exptell = filesize             # <<<<<<<<<<<<<<
 *         else:                  exptell = bufSize
 * 
*/
          __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v_bufSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_filesize, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 484, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 484, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_6) {
            __Pyx_INCREF(__pyx_v_filesize);
            __pyx_v_exptell = __pyx_v_filesize;
            goto __pyx_L14;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":485
 * 
 *         if bufSize > filesize: exptell = filesize
 *         else:                  exptell = bufSize             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
          /*else*/ {
            __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_bufSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_v_exptell = __pyx_t_4;
            __pyx_t_4 = 0;
          }
          __pyx_L14:;

          /* "indexed_gzip/tests/ctest_zran.pyx":487
 *         else:                  exptell = bufSize
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             assert gotread == expread
 *             assert gottell == exptell
*/
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            /*try:*/ {

              /* "indexed_gzip/tests/ctest_zran.pyx":488
 * 
 *         try:
 *             assert gotread == expread             # <<<<<<<<<<<<<<
 *             assert gottell == exptell
 *         except:
*/
              #ifndef CYTHON_WITHOUT_ASSERTIONS
              if (unlikely(__pyx_assertions_enabled())) {
                __pyx_t_4 = PyObject_RichCompare(__pyx_v_gotread, __pyx_v_expread, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L15_error)
                __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 488, __pyx_L15_error)
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                if (unlikely(!__pyx_t_6)) {
                  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                  __PYX_ERR(0, 488, __pyx_L15_error)
                }
              }
              #else
              if ((1)); else __PYX_ERR(0, 488, __pyx_L15_error)
              #endif

              /* "indexed_gzip/tests/ctest_zran.pyx":489
 *         try:
 *             assert gotread == expread
 *             assert gottell == exptell             # <<<<<<<<<<<<<<
 *         except:
 *             print("expread: {}".format(expread))
*/
              #ifndef CYTHON_WITHOUT_ASSERTIONS
              if (unlikely(__pyx_assertions_enabled())) {
                __pyx_t_4 = __Pyx_PyLong_From_uint64_t(__pyx_v_gottell); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_exptell, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L15_error)
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 489, __pyx_L15_error)
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (unlikely(!__pyx_t_6)) {
                  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                  __PYX_ERR(0, 489, __pyx_L15_error)
                }
              }
              #else
              if ((1)); else __PYX_ERR(0, 489, __pyx_L15_error)
              #endif

              /* "indexed_gzip/tests/ctest_zran.pyx":487
 *         else:                  exptell = bufSize
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             assert gotread == expread
 *             assert gottell == exptell
*/
            }
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            goto __pyx_L20_try_end;
            __pyx_L15_error:;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":490
 *             assert gotread == expread
 *             assert gottell == exptell
 *         except:             # <<<<<<<<<<<<<<
 *             print("expread: {}".format(expread))
 *             print("gotread: {}".format(gotread))
*/
            /*except:*/ {
              __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_no_auto_build", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 490, __pyx_L17_except_error)
              __Pyx_XGOTREF(__pyx_t_1);
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_5);

              /* "indexed_gzip/tests/ctest_zran.pyx":491
 *             assert gottell == exptell
 *         except:
 *             print("expread: {}".format(expread))             # <<<<<<<<<<<<<<
 *             print("gotread: {}".format(gotread))
 *             print("exptell: {}".format(exptell))
*/
              __pyx_t_19 = NULL;
              __pyx_t_21 = __pyx_mstate_global->__pyx_kp_u_expread;
              __Pyx_INCREF(__pyx_t_21);
              __pyx_t_7 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_v_expread};
                __pyx_t_20 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 491, __pyx_L17_except_error)
                __Pyx_GOTREF(__pyx_t_20);
              }
              __pyx_t_7 = 1;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_t_20};
                __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L17_except_error)
                __Pyx_GOTREF(__pyx_t_3);
              }
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":492
 *         except:
 *             print("expread: {}".format(expread))
 *             print("gotread: {}".format(gotread))             # <<<<<<<<<<<<<<
 *             print("exptell: {}".format(exptell))
 *             print("gottell: {}".format(gottell))
*/
              __pyx_t_20 = NULL;
              __pyx_t_21 = __pyx_mstate_global->__pyx_kp_u_gotread;
              __Pyx_INCREF(__pyx_t_21);
              __pyx_t_7 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_v_gotread};
                __pyx_t_19 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 492, __pyx_L17_except_error)
                __Pyx_GOTREF(__pyx_t_19);
              }
              __pyx_t_7 = 1;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_19};
                __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L17_except_error)
                __Pyx_GOTREF(__pyx_t_3);
              }
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":493
 *             print("expread: {}".format(expread))
 *             print("gotread: {}".format(gotread))
 *             print("exptell: {}".format(exptell))             # <<<<<<<<<<<<<<
 *             print("gottell: {}".format(gottell))
 *             raise
*/
              __pyx_t_19 = NULL;
              __pyx_t_21 = __pyx_mstate_global->__pyx_kp_u_exptell;
              __Pyx_INCREF(__pyx_t_21);
              __pyx_t_7 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_v_exptell};
                __pyx_t_20 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 493, __pyx_L17_except_error)
                __Pyx_GOTREF(__pyx_t_20);
              }
              __pyx_t_7 = 1;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_t_20};
                __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L17_except_error)
                __Pyx_GOTREF(__pyx_t_3);
              }
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":494
 *             print("gotread: {}".format(gotread))
 *             print("exptell: {}".format(exptell))
 *             print("gottell: {}".format(gottell))             # <<<<<<<<<<<<<<
 *             raise
 * 
*/
              __pyx_t_20 = NULL;
              __pyx_t_21 = __pyx_mstate_global->__pyx_kp_u_gottell;
              __Pyx_INCREF(__pyx_t_21);
              __pyx_t_22 = __Pyx_PyLong_From_uint64_t(__pyx_v_gottell); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 494, __pyx_L17_except_error)
              __Pyx_GOTREF(__pyx_t_22);
              __pyx_t_7 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_t_22};
                __pyx_t_19 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 494, __pyx_L17_except_error)
                __Pyx_GOTREF(__pyx_t_19);
              }
              __pyx_t_7 = 1;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_19};
                __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L17_except_error)
                __Pyx_GOTREF(__pyx_t_3);
              }
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":495
 *             print("exptell: {}".format(exptell))
 *             print("gottell: {}".format(gottell))
 *             raise             # <<<<<<<<<<<<<<
 * 
 *         pybuf = <bytes>(<char *>buffer)[:gotread]
*/
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_4);
              __Pyx_XGIVEREF(__pyx_t_5);
              __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_5);
              __pyx_t_1 = 0;  __pyx_t_4 = 0;  __pyx_t_5 = 0; 
              __PYX_ERR(0, 495, __pyx_L17_except_error)
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":487
 *         else:                  exptell = bufSize
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             assert gotread == expread
 *             assert gottell == exptell
*/
            __pyx_L17_except_error:;
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            goto __pyx_L7_error;
            __pyx_L20_try_end:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":497
 *             raise
 * 
 *         pybuf = <bytes>(<char *>buffer)[:gotread]             # <<<<<<<<<<<<<<
 *         data  = np.ndarray(gotread // 8, np.uint64, pybuf)
 * 
*/
          __Pyx_INCREF(__pyx_v_gotread);
          __pyx_t_5 = __pyx_v_gotread;
          __pyx_t_6 = (__pyx_t_5 == Py_None);
          if (__pyx_t_6) {
            __pyx_t_23 = PY_SSIZE_T_MAX;
          } else {
            __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L7_error)
            __pyx_t_23 = __pyx_t_24;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_buffer) + 0, __pyx_t_23 - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 497, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_4 = __pyx_t_5;
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_v_pybuf = ((PyObject*)__pyx_t_4);
          __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":498
 * 
 *         pybuf = <bytes>(<char *>buffer)[:gotread]
 *         data  = np.ndarray(gotread // 8, np.uint64, pybuf)             # <<<<<<<<<<<<<<
 * 
 *         assert check_data_valid(data, 0)
*/
          __pyx_t_5 = NULL;
          __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_gotread, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_uint64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 498, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_7 = 1;
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_t_1, __pyx_t_19, __pyx_v_pybuf};
            __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5numpy_ndarray, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L7_error)
            __Pyx_GOTREF((PyObject *)__pyx_t_4);
          }
          __pyx_v_data = ((PyObject *)__pyx_t_4);
          __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":500
 *         data  = np.ndarray(gotread // 8, np.uint64, pybuf)
 * 
 *         assert check_data_valid(data, 0)             # <<<<<<<<<<<<<<
 * 
 *         if bufSize < filesize:
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_19 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_check_data_valid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_7 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_1);
              assert(__pyx_t_19);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_19);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
              __pyx_t_7 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_19, __pyx_v_data, __pyx_mstate_global->__pyx_int_0};
              __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_4);
            }
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 500, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 500, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 500, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":502
 *         assert check_data_valid(data, 0)
 * 
 *         if bufSize < filesize:             # <<<<<<<<<<<<<<
 *             assert zran.zran_read(&index, buffer, bufSize) == zran.ZRAN_READ_NOT_COVERED
 * 
*/
          __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_bufSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_filesize, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 502, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_6) {

            /* "indexed_gzip/tests/ctest_zran.pyx":503
 * 
 *         if bufSize < filesize:
 *             assert zran.zran_read(&index, buffer, bufSize) == zran.ZRAN_READ_NOT_COVERED             # <<<<<<<<<<<<<<
 * 
 * 
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_6 = (zran_read((&__pyx_v_index), __pyx_v_buffer, __pyx_v_bufSize) == ZRAN_READ_NOT_COVERED);
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 503, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 503, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":502
 *         assert check_data_valid(data, 0)
 * 
 *         if bufSize < filesize:             # <<<<<<<<<<<<<<
 *             assert zran.zran_read(&index, buffer, bufSize) == zran.ZRAN_READ_NOT_COVERED
 * 
*/
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":462
 *     buffer       = buf.buffer
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_no_auto_build", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_19) < 0) __PYX_ERR(0, 462, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_4, __pyx_t_19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 462, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (__pyx_t_6 < (0)) __PYX_ERR(0, 462, __pyx_L9_except_error)
          __pyx_t_25 = (!__pyx_t_6);
          if (unlikely(__pyx_t_25)) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_19);
            __pyx_t_1 = 0;  __pyx_t_4 = 0;  __pyx_t_19 = 0; 
            __PYX_ERR(0, 462, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_9) {
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 462, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L27;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L1_error;
    __pyx_L27:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":451
 * 
 * 
 * def test_no_auto_build(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

  /* 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_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_no_auto_build", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_gotread);
  __Pyx_XDECREF(__pyx_v_expread);
  __Pyx_XDECREF(__pyx_v_exptell);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":506
 * 
 * 
 * def test_seek_to_end(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_29test_seek_to_end(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_29test_seek_to_end = {"test_seek_to_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_29test_seek_to_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_29test_seek_to_end(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_seek_to_end (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 506, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 506, __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, "test_seek_to_end", 0) < (0)) __PYX_ERR(0, 506, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_seek_to_end", 1, 3, 3, i); __PYX_ERR(0, 506, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 506, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 506, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 506, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_seek_to_end", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 506, __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("indexed_gzip.tests.ctest_zran.test_seek_to_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_28test_seek_to_end(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems);

  /* 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_12indexed_gzip_5tests_10ctest_zran_28test_seek_to_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems) {
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_seek_point = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  uint64_t __pyx_v_zt;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  void *__pyx_t_13;
  PyObject *__pyx_t_14;
  uint32_t __pyx_t_15;
  int64_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_seek_to_end", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":510
 *     cdef zran.zran_index_t index
 * 
 *     filesize = nelems * 8             # <<<<<<<<<<<<<<
 * 
 *     seek_point   = filesize - 1
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":512
 *     filesize = nelems * 8
 * 
 *     seek_point   = filesize - 1             # <<<<<<<<<<<<<<
 *     indexSpacing = max(524288, filesize // 1500)
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_seek_point = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":513
 * 
 *     seek_point   = filesize - 1
 *     indexSpacing = max(524288, filesize // 1500)             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1500, 0x5DC, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0x80000;
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":515
 *     indexSpacing = max(524288, filesize // 1500)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_3 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":516
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_1 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_12, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":518
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":519
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 519, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_13 = NULL;
            } else {
              __pyx_t_13 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":520
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 520, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_14 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_14 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":521
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_15 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 521, __pyx_L7_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":518
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_6 = (!(zran_init((&__pyx_v_index), __pyx_t_13, __pyx_t_14, __pyx_t_15, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 518, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 518, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":526
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         assert zran.zran_seek(&index, seek_point, SEEK_SET, NULL) == 0             # <<<<<<<<<<<<<<
 * 
 *         zt = zran.zran_tell(&index)
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_16 = __Pyx_PyLong_As_int64_t(__pyx_v_seek_point); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L7_error)
            __pyx_t_6 = (zran_seek((&__pyx_v_index), __pyx_t_16, SEEK_SET, NULL) == 0);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 526, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 526, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":528
 *         assert zran.zran_seek(&index, seek_point, SEEK_SET, NULL) == 0
 * 
 *         zt = zran.zran_tell(&index)             # <<<<<<<<<<<<<<
 * 
 *         assert zt == seek_point
*/
          __pyx_v_zt = zran_tell((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":530
 *         zt = zran.zran_tell(&index)
 * 
 *         assert zt == seek_point             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index)
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_4 = __Pyx_PyLong_From_uint64_t(__pyx_v_zt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_seek_point, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 530, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 530, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 530, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":532
 *         assert zt == seek_point
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":515
 *     indexSpacing = max(524288, filesize // 1500)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seek_to_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 515, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 515, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (__pyx_t_6 < (0)) __PYX_ERR(0, 515, __pyx_L9_except_error)
          __pyx_t_18 = (!__pyx_t_6);
          if (unlikely(__pyx_t_18)) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_3);
            __pyx_t_1 = 0;  __pyx_t_4 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(0, 515, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_8) {
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 515, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":506
 * 
 * 
 * def test_seek_to_end(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

  /* 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("indexed_gzip.tests.ctest_zran.test_seek_to_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_seek_point);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":535
 * 
 * 
 * def test_seek_cur(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_31test_seek_cur(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_31test_seek_cur = {"test_seek_cur", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_31test_seek_cur, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_31test_seek_cur(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_seek_cur (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 535, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 535, __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, "test_seek_cur", 0) < (0)) __PYX_ERR(0, 535, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_seek_cur", 1, 3, 3, i); __PYX_ERR(0, 535, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 535, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 535, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 535, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_seek_cur", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 535, __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("indexed_gzip.tests.ctest_zran.test_seek_cur", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_30test_seek_cur(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems);

  /* 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_12indexed_gzip_5tests_10ctest_zran_30test_seek_cur(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems) {
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  PyObject *__pyx_v_seekstep = NULL;
  PyObject *__pyx_v_curelem = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  int __pyx_v_exp;
  int __pyx_v_out;
  uint64_t __pyx_v_zt;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  void *__pyx_t_13;
  PyObject *__pyx_t_14;
  uint32_t __pyx_t_15;
  int64_t __pyx_t_16;
  struct __pyx_opt_args_12indexed_gzip_5tests_10ctest_zran_read_element __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_seek_cur", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":539
 *     cdef zran.zran_index_t index
 * 
 *     filesize     = nelems * 8             # <<<<<<<<<<<<<<
 *     indexSpacing = max(524288, filesize // 1500)
 *     seekstep     = max(1, (nelems - 1) // 500)
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":540
 * 
 *     filesize     = nelems * 8
 *     indexSpacing = max(524288, filesize // 1500)             # <<<<<<<<<<<<<<
 *     seekstep     = max(1, (nelems - 1) // 500)
 *     curelem      = 0;
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1500, 0x5DC, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0x80000;
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":541
 *     filesize     = nelems * 8
 *     indexSpacing = max(524288, filesize // 1500)
 *     seekstep     = max(1, (nelems - 1) // 500)             # <<<<<<<<<<<<<<
 *     curelem      = 0;
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_FloorDivideObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_500, 0x1F4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = 1;
  __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seekstep = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":542
 *     indexSpacing = max(524288, filesize // 1500)
 *     seekstep     = max(1, (nelems - 1) // 500)
 *     curelem      = 0;             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_curelem = __pyx_mstate_global->__pyx_int_0;

  /* "indexed_gzip/tests/ctest_zran.pyx":544
 *     curelem      = 0;
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_1 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = NULL;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":545
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_3 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_3);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
          }
          __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_12, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":547
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":548
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 548, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_13 = NULL;
            } else {
              __pyx_t_13 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":549
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 549, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_14 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_14 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":550
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_15 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L7_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":547
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_6 = (!(zran_init((&__pyx_v_index), __pyx_t_13, __pyx_t_14, __pyx_t_15, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 547, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 547, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":555
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         while curelem < nelems:             # <<<<<<<<<<<<<<
 * 
 *             if (curelem + seekstep) * 8 < filesize: exp = zran.ZRAN_SEEK_OK
*/
          while (1) {
            __pyx_t_5 = PyObject_RichCompare(__pyx_v_curelem, __pyx_v_nelems, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L7_error)
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 555, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (!__pyx_t_6) break;

            /* "indexed_gzip/tests/ctest_zran.pyx":557
 *         while curelem < nelems:
 * 
 *             if (curelem + seekstep) * 8 < filesize: exp = zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 *             else:                                   exp = zran.ZRAN_SEEK_EOF
 * 
*/
            __pyx_t_5 = PyNumber_Add(__pyx_v_curelem, __pyx_v_seekstep); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_3 = __Pyx_PyLong_MultiplyObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_v_filesize, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 557, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (__pyx_t_6) {
              __pyx_v_exp = ZRAN_SEEK_OK;
              goto __pyx_L15;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":558
 * 
 *             if (curelem + seekstep) * 8 < filesize: exp = zran.ZRAN_SEEK_OK
 *             else:                                   exp = zran.ZRAN_SEEK_EOF             # <<<<<<<<<<<<<<
 * 
 * 
*/
            /*else*/ {
              __pyx_v_exp = ZRAN_SEEK_EOF;
            }
            __pyx_L15:;

            /* "indexed_gzip/tests/ctest_zran.pyx":561
 * 
 * 
 *             out = zran.zran_seek(&index, seekstep * 8, SEEK_CUR, NULL)             # <<<<<<<<<<<<<<
 *             assert out == exp, out
 * 
*/
            __pyx_t_5 = __Pyx_PyLong_MultiplyObjC(__pyx_v_seekstep, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_16 = __Pyx_PyLong_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 561, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_v_out = zran_seek((&__pyx_v_index), __pyx_t_16, SEEK_CUR, NULL);

            /* "indexed_gzip/tests/ctest_zran.pyx":562
 * 
 *             out = zran.zran_seek(&index, seekstep * 8, SEEK_CUR, NULL)
 *             assert out == exp, out             # <<<<<<<<<<<<<<
 * 
 *             if exp == zran.ZRAN_SEEK_EOF:
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_6 = (__pyx_v_out == __pyx_v_exp);
              if (unlikely(!__pyx_t_6)) {
                __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_out); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_3 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_3, 0, 0);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __PYX_ERR(0, 562, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 562, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":564
 *             assert out == exp, out
 * 
 *             if exp == zran.ZRAN_SEEK_EOF:             # <<<<<<<<<<<<<<
 *                 break
 * 
*/
            __pyx_t_6 = (__pyx_v_exp == ZRAN_SEEK_EOF);
            if (__pyx_t_6) {

              /* "indexed_gzip/tests/ctest_zran.pyx":565
 * 
 *             if exp == zran.ZRAN_SEEK_EOF:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             curelem += seekstep
*/
              goto __pyx_L14_break;

              /* "indexed_gzip/tests/ctest_zran.pyx":564
 *             assert out == exp, out
 * 
 *             if exp == zran.ZRAN_SEEK_EOF:             # <<<<<<<<<<<<<<
 *                 break
 * 
*/
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":567
 *                 break
 * 
 *             curelem += seekstep             # <<<<<<<<<<<<<<
 *             zt = zran.zran_tell(&index)
 *             val = read_element(&index, curelem, nelems, False)
*/
            __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_curelem, __pyx_v_seekstep); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF_SET(__pyx_v_curelem, __pyx_t_3);
            __pyx_t_3 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":568
 * 
 *             curelem += seekstep
 *             zt = zran.zran_tell(&index)             # <<<<<<<<<<<<<<
 *             val = read_element(&index, curelem, nelems, False)
 * 
*/
            __pyx_v_zt = zran_tell((&__pyx_v_index));

            /* "indexed_gzip/tests/ctest_zran.pyx":569
 *             curelem += seekstep
 *             zt = zran.zran_tell(&index)
 *             val = read_element(&index, curelem, nelems, False)             # <<<<<<<<<<<<<<
 * 
 *             assert zt  == curelem * 8
*/
            __pyx_t_17.__pyx_n = 1;
            __pyx_t_17.seek = Py_False;
            __pyx_t_3 = __pyx_f_12indexed_gzip_5tests_10ctest_zran_read_element((&__pyx_v_index), __pyx_v_curelem, __pyx_v_nelems, &__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3);
            __pyx_t_3 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":571
 *             val = read_element(&index, curelem, nelems, False)
 * 
 *             assert zt  == curelem * 8             # <<<<<<<<<<<<<<
 *             assert val == curelem
 * 
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_3 = __Pyx_PyLong_From_uint64_t(__pyx_v_zt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_5 = __Pyx_PyLong_MultiplyObjC(__pyx_v_curelem, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 571, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 571, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 571, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":572
 * 
 *             assert zt  == curelem * 8
 *             assert val == curelem             # <<<<<<<<<<<<<<
 * 
 *             assert zran.zran_seek(&index, -8, SEEK_CUR, NULL) == zran.ZRAN_SEEK_OK
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_1 = PyObject_RichCompare(__pyx_v_val, __pyx_v_curelem, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L7_error)
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 572, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 572, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 572, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":574
 *             assert val == curelem
 * 
 *             assert zran.zran_seek(&index, -8, SEEK_CUR, NULL) == zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index)
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_6 = (zran_seek((&__pyx_v_index), -8L, SEEK_CUR, NULL) == ZRAN_SEEK_OK);
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 574, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 574, __pyx_L7_error)
            #endif
          }
          __pyx_L14_break:;

          /* "indexed_gzip/tests/ctest_zran.pyx":576
 *             assert zran.zran_seek(&index, -8, SEEK_CUR, NULL) == zran.ZRAN_SEEK_OK
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":544
 *     curelem      = 0;
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seek_cur", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_3) < 0) __PYX_ERR(0, 544, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 544, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (__pyx_t_6 < (0)) __PYX_ERR(0, 544, __pyx_L9_except_error)
          __pyx_t_19 = (!__pyx_t_6);
          if (unlikely(__pyx_t_19)) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_5, __pyx_t_3);
            __pyx_t_1 = 0;  __pyx_t_5 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(0, 544, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_8) {
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 544, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L20;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":535
 * 
 * 
 * def test_seek_cur(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

  /* 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("indexed_gzip.tests.ctest_zran.test_seek_cur", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF(__pyx_v_seekstep);
  __Pyx_XDECREF(__pyx_v_curelem);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":579
 * 
 * 
 * def test_seek_end(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 *     cdef zran.zran_index_t index
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_33test_seek_end(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_33test_seek_end = {"test_seek_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_33test_seek_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_33test_seek_end(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_seek_end (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 579, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 579, __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, "test_seek_end", 0) < (0)) __PYX_ERR(0, 579, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_seek_end", 1, 3, 3, i); __PYX_ERR(0, 579, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 579, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 579, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 579, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_seek_end", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 579, __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("indexed_gzip.tests.ctest_zran.test_seek_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_32test_seek_end(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems);

  /* 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_12indexed_gzip_5tests_10ctest_zran_32test_seek_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems) {
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  PyObject *__pyx_v_seekstep = NULL;
  PyObject *__pyx_v_curelem = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_seekloc = NULL;
  int __pyx_v_exp;
  uint64_t __pyx_v_zt;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  void *__pyx_t_13;
  PyObject *__pyx_t_14;
  uint32_t __pyx_t_15;
  int64_t __pyx_t_16;
  struct __pyx_opt_args_12indexed_gzip_5tests_10ctest_zran_read_element __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_seek_end", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":582
 *     cdef zran.zran_index_t index
 * 
 *     filesize     = nelems * 8             # <<<<<<<<<<<<<<
 *     indexSpacing = max(131072, filesize // 1500)
 *     seekstep     = max(1, (nelems - 1) // 500)
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":583
 * 
 *     filesize     = nelems * 8
 *     indexSpacing = max(131072, filesize // 1500)             # <<<<<<<<<<<<<<
 *     seekstep     = max(1, (nelems - 1) // 500)
 *     curelem      = 0
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1500, 0x5DC, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0x20000;
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":584
 *     filesize     = nelems * 8
 *     indexSpacing = max(131072, filesize // 1500)
 *     seekstep     = max(1, (nelems - 1) // 500)             # <<<<<<<<<<<<<<
 *     curelem      = 0
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_FloorDivideObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_500, 0x1F4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = 1;
  __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seekstep = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":585
 *     indexSpacing = max(131072, filesize // 1500)
 *     seekstep     = max(1, (nelems - 1) // 500)
 *     curelem      = 0             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_curelem = __pyx_mstate_global->__pyx_int_0;

  /* "indexed_gzip/tests/ctest_zran.pyx":587
 *     curelem      = 0
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_1 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = NULL;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 587, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":588
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_3 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_3);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
          }
          __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_12, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":590
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":591
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 591, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_13 = NULL;
            } else {
              __pyx_t_13 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":592
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 592, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_14 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_14 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":593
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_15 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L7_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":590
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_6 = (!(zran_init((&__pyx_v_index), __pyx_t_13, __pyx_t_14, __pyx_t_15, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 590, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 590, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":598
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         assert zran.zran_seek(&index, -10, SEEK_END, NULL) == zran.ZRAN_SEEK_INDEX_NOT_BUILT             # <<<<<<<<<<<<<<
 *         assert zran.zran_seek(&index,  20, SEEK_SET, NULL) == zran.ZRAN_SEEK_OK
 *         assert zran.zran_tell(&index)                      == 20
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_seek((&__pyx_v_index), -10L, SEEK_END, NULL) == ZRAN_SEEK_INDEX_NOT_BUILT);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 598, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 598, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":599
 * 
 *         assert zran.zran_seek(&index, -10, SEEK_END, NULL) == zran.ZRAN_SEEK_INDEX_NOT_BUILT
 *         assert zran.zran_seek(&index,  20, SEEK_SET, NULL) == zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 *         assert zran.zran_tell(&index)                      == 20
 *         assert zran.zran_seek(&index, -10, SEEK_END, NULL) == zran.ZRAN_SEEK_INDEX_NOT_BUILT
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_seek((&__pyx_v_index), 20, SEEK_SET, NULL) == ZRAN_SEEK_OK);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 599, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 599, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":600
 *         assert zran.zran_seek(&index, -10, SEEK_END, NULL) == zran.ZRAN_SEEK_INDEX_NOT_BUILT
 *         assert zran.zran_seek(&index,  20, SEEK_SET, NULL) == zran.ZRAN_SEEK_OK
 *         assert zran.zran_tell(&index)                      == 20             # <<<<<<<<<<<<<<
 *         assert zran.zran_seek(&index, -10, SEEK_END, NULL) == zran.ZRAN_SEEK_INDEX_NOT_BUILT
 * 
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_tell((&__pyx_v_index)) == 20);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 600, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 600, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":601
 *         assert zran.zran_seek(&index,  20, SEEK_SET, NULL) == zran.ZRAN_SEEK_OK
 *         assert zran.zran_tell(&index)                      == 20
 *         assert zran.zran_seek(&index, -10, SEEK_END, NULL) == zran.ZRAN_SEEK_INDEX_NOT_BUILT             # <<<<<<<<<<<<<<
 * 
 *         assert zran.zran_build_index(&index, 0, 0)         == 0
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_seek((&__pyx_v_index), -10L, SEEK_END, NULL) == ZRAN_SEEK_INDEX_NOT_BUILT);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 601, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 601, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":603
 *         assert zran.zran_seek(&index, -10, SEEK_END, NULL) == zran.ZRAN_SEEK_INDEX_NOT_BUILT
 * 
 *         assert zran.zran_build_index(&index, 0, 0)         == 0             # <<<<<<<<<<<<<<
 * 
 *         assert zran.zran_seek(&index,  0, SEEK_END, NULL) == zran.ZRAN_SEEK_EOF
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_build_index((&__pyx_v_index), 0, 0) == 0);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 603, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 603, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":605
 *         assert zran.zran_build_index(&index, 0, 0)         == 0
 * 
 *         assert zran.zran_seek(&index,  0, SEEK_END, NULL) == zran.ZRAN_SEEK_EOF             # <<<<<<<<<<<<<<
 *         assert zran.zran_tell(&index)                     == filesize
 *         assert zran.zran_seek(&index, -1, SEEK_END, NULL) == zran.ZRAN_SEEK_OK
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_seek((&__pyx_v_index), 0, SEEK_END, NULL) == ZRAN_SEEK_EOF);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 605, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 605, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":606
 * 
 *         assert zran.zran_seek(&index,  0, SEEK_END, NULL) == zran.ZRAN_SEEK_EOF
 *         assert zran.zran_tell(&index)                     == filesize             # <<<<<<<<<<<<<<
 *         assert zran.zran_seek(&index, -1, SEEK_END, NULL) == zran.ZRAN_SEEK_OK
 *         assert zran.zran_tell(&index)                     == filesize - 1
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_5 = __Pyx_PyLong_From_uint64_t(zran_tell((&__pyx_v_index))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_filesize, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 606, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 606, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 606, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":607
 *         assert zran.zran_seek(&index,  0, SEEK_END, NULL) == zran.ZRAN_SEEK_EOF
 *         assert zran.zran_tell(&index)                     == filesize
 *         assert zran.zran_seek(&index, -1, SEEK_END, NULL) == zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 *         assert zran.zran_tell(&index)                     == filesize - 1
 * 
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_seek((&__pyx_v_index), -1L, SEEK_END, NULL) == ZRAN_SEEK_OK);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 607, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 607, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":608
 *         assert zran.zran_tell(&index)                     == filesize
 *         assert zran.zran_seek(&index, -1, SEEK_END, NULL) == zran.ZRAN_SEEK_OK
 *         assert zran.zran_tell(&index)                     == filesize - 1             # <<<<<<<<<<<<<<
 * 
 *         assert zran.zran_seek(&index,  1,             SEEK_END, NULL) == zran.ZRAN_SEEK_EOF
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_3 = __Pyx_PyLong_From_uint64_t(zran_tell((&__pyx_v_index))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 608, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 608, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 608, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":610
 *         assert zran.zran_tell(&index)                     == filesize - 1
 * 
 *         assert zran.zran_seek(&index,  1,             SEEK_END, NULL) == zran.ZRAN_SEEK_EOF             # <<<<<<<<<<<<<<
 *         assert zran.zran_tell(&index)                                 == filesize
 *         assert zran.zran_seek(&index,  -filesize - 1, SEEK_END, NULL) == zran.ZRAN_SEEK_FAIL
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_seek((&__pyx_v_index), 1, SEEK_END, NULL) == ZRAN_SEEK_EOF);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 610, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 610, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":611
 * 
 *         assert zran.zran_seek(&index,  1,             SEEK_END, NULL) == zran.ZRAN_SEEK_EOF
 *         assert zran.zran_tell(&index)                                 == filesize             # <<<<<<<<<<<<<<
 *         assert zran.zran_seek(&index,  -filesize - 1, SEEK_END, NULL) == zran.ZRAN_SEEK_FAIL
 *         assert zran.zran_seek(&index,  -filesize,     SEEK_END, NULL) == zran.ZRAN_SEEK_OK
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_1 = __Pyx_PyLong_From_uint64_t(zran_tell((&__pyx_v_index))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_v_filesize, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 611, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 611, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 611, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":612
 *         assert zran.zran_seek(&index,  1,             SEEK_END, NULL) == zran.ZRAN_SEEK_EOF
 *         assert zran.zran_tell(&index)                                 == filesize
 *         assert zran.zran_seek(&index,  -filesize - 1, SEEK_END, NULL) == zran.ZRAN_SEEK_FAIL             # <<<<<<<<<<<<<<
 *         assert zran.zran_seek(&index,  -filesize,     SEEK_END, NULL) == zran.ZRAN_SEEK_OK
 *         assert zran.zran_tell(&index)                                 == 0
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_5 = PyNumber_Negative(__pyx_v_filesize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_16 = __Pyx_PyLong_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 612, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_6 = (zran_seek((&__pyx_v_index), __pyx_t_16, SEEK_END, NULL) == ZRAN_SEEK_FAIL);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 612, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 612, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":613
 *         assert zran.zran_tell(&index)                                 == filesize
 *         assert zran.zran_seek(&index,  -filesize - 1, SEEK_END, NULL) == zran.ZRAN_SEEK_FAIL
 *         assert zran.zran_seek(&index,  -filesize,     SEEK_END, NULL) == zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 *         assert zran.zran_tell(&index)                                 == 0
 * 
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_1 = PyNumber_Negative(__pyx_v_filesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_16 = __Pyx_PyLong_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 613, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_6 = (zran_seek((&__pyx_v_index), __pyx_t_16, SEEK_END, NULL) == ZRAN_SEEK_OK);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 613, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 613, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":614
 *         assert zran.zran_seek(&index,  -filesize - 1, SEEK_END, NULL) == zran.ZRAN_SEEK_FAIL
 *         assert zran.zran_seek(&index,  -filesize,     SEEK_END, NULL) == zran.ZRAN_SEEK_OK
 *         assert zran.zran_tell(&index)                                 == 0             # <<<<<<<<<<<<<<
 * 
 *         while curelem < nelems:
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (zran_tell((&__pyx_v_index)) == 0);
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 614, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 614, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":616
 *         assert zran.zran_tell(&index)                                 == 0
 * 
 *         while curelem < nelems:             # <<<<<<<<<<<<<<
 *             seekloc = filesize - ((nelems + curelem - 1) * 8)
 * 
*/
          while (1) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_curelem, __pyx_v_nelems, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L7_error)
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 616, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (!__pyx_t_6) break;

            /* "indexed_gzip/tests/ctest_zran.pyx":617
 * 
 *         while curelem < nelems:
 *             seekloc = filesize - ((nelems + curelem - 1) * 8)             # <<<<<<<<<<<<<<
 * 
 *             if seekloc >= 0: exp = zran.ZRAN_SEEK_EOF
*/
            __pyx_t_1 = PyNumber_Add(__pyx_v_nelems, __pyx_v_curelem); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = PyNumber_Subtract(__pyx_v_filesize, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF_SET(__pyx_v_seekloc, __pyx_t_5);
            __pyx_t_5 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":619
 *             seekloc = filesize - ((nelems + curelem - 1) * 8)
 * 
 *             if seekloc >= 0: exp = zran.ZRAN_SEEK_EOF             # <<<<<<<<<<<<<<
 *             else:            exp = zran.ZRAN_SEEK_OK
 * 
*/
            __pyx_t_5 = PyObject_RichCompare(__pyx_v_seekloc, __pyx_mstate_global->__pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 619, __pyx_L7_error)
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 619, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (__pyx_t_6) {
              __pyx_v_exp = ZRAN_SEEK_EOF;
              goto __pyx_L15;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":620
 * 
 *             if seekloc >= 0: exp = zran.ZRAN_SEEK_EOF
 *             else:            exp = zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 * 
 *             assert zran.zran_seek(&index, seekloc, SEEK_END, NULL) == exp
*/
            /*else*/ {
              __pyx_v_exp = ZRAN_SEEK_OK;
            }
            __pyx_L15:;

            /* "indexed_gzip/tests/ctest_zran.pyx":622
 *             else:            exp = zran.ZRAN_SEEK_OK
 * 
 *             assert zran.zran_seek(&index, seekloc, SEEK_END, NULL) == exp             # <<<<<<<<<<<<<<
 * 
 *             if exp == zran.ZRAN_SEEK_EOF:
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_16 = __Pyx_PyLong_As_int64_t(__pyx_v_seekloc); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L7_error)
              __pyx_t_6 = (zran_seek((&__pyx_v_index), __pyx_t_16, SEEK_END, NULL) == __pyx_v_exp);
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 622, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 622, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":624
 *             assert zran.zran_seek(&index, seekloc, SEEK_END, NULL) == exp
 * 
 *             if exp == zran.ZRAN_SEEK_EOF:             # <<<<<<<<<<<<<<
 *                 break
 * 
*/
            __pyx_t_6 = (__pyx_v_exp == ZRAN_SEEK_EOF);
            if (__pyx_t_6) {

              /* "indexed_gzip/tests/ctest_zran.pyx":625
 * 
 *             if exp == zran.ZRAN_SEEK_EOF:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             curelem += seekstep
*/
              goto __pyx_L14_break;

              /* "indexed_gzip/tests/ctest_zran.pyx":624
 *             assert zran.zran_seek(&index, seekloc, SEEK_END, NULL) == exp
 * 
 *             if exp == zran.ZRAN_SEEK_EOF:             # <<<<<<<<<<<<<<
 *                 break
 * 
*/
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":627
 *                 break
 * 
 *             curelem += seekstep             # <<<<<<<<<<<<<<
 *             zt = zran.zran_tell(&index)
 *             val = read_element(&index, curelem, nelems, False)
*/
            __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_curelem, __pyx_v_seekstep); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF_SET(__pyx_v_curelem, __pyx_t_5);
            __pyx_t_5 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":628
 * 
 *             curelem += seekstep
 *             zt = zran.zran_tell(&index)             # <<<<<<<<<<<<<<
 *             val = read_element(&index, curelem, nelems, False)
 * 
*/
            __pyx_v_zt = zran_tell((&__pyx_v_index));

            /* "indexed_gzip/tests/ctest_zran.pyx":629
 *             curelem += seekstep
 *             zt = zran.zran_tell(&index)
 *             val = read_element(&index, curelem, nelems, False)             # <<<<<<<<<<<<<<
 * 
 *             assert zt  == curelem * 8
*/
            __pyx_t_17.__pyx_n = 1;
            __pyx_t_17.seek = Py_False;
            __pyx_t_5 = __pyx_f_12indexed_gzip_5tests_10ctest_zran_read_element((&__pyx_v_index), __pyx_v_curelem, __pyx_v_nelems, &__pyx_t_17); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
            __pyx_t_5 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":631
 *             val = read_element(&index, curelem, nelems, False)
 * 
 *             assert zt  == curelem * 8             # <<<<<<<<<<<<<<
 *             assert val == curelem
 * 
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_5 = __Pyx_PyLong_From_uint64_t(__pyx_v_zt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_curelem, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 631, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 631, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 631, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":632
 * 
 *             assert zt  == curelem * 8
 *             assert val == curelem             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index)
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_curelem, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L7_error)
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 632, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 632, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 632, __pyx_L7_error)
            #endif
          }
          __pyx_L14_break:;

          /* "indexed_gzip/tests/ctest_zran.pyx":634
 *             assert val == curelem
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":587
 *     curelem      = 0
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seek_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_5) < 0) __PYX_ERR(0, 587, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 587, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (__pyx_t_6 < (0)) __PYX_ERR(0, 587, __pyx_L9_except_error)
          __pyx_t_19 = (!__pyx_t_6);
          if (unlikely(__pyx_t_19)) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_5);
            __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_5);
            __pyx_t_3 = 0;  __pyx_t_1 = 0;  __pyx_t_5 = 0; 
            __PYX_ERR(0, 587, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_8) {
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 587, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L20;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":579
 * 
 * 
 * def test_seek_end(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 *     cdef zran.zran_index_t index
 * 
*/

  /* 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("indexed_gzip.tests.ctest_zran.test_seek_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF(__pyx_v_seekstep);
  __Pyx_XDECREF(__pyx_v_curelem);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_seekloc);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":637
 * 
 * 
 * def test_seek_beyond_end(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_35test_seek_beyond_end(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_35test_seek_beyond_end = {"test_seek_beyond_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_35test_seek_beyond_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_35test_seek_beyond_end(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_seek_beyond_end (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 637, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 637, __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, "test_seek_beyond_end", 0) < (0)) __PYX_ERR(0, 637, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_seek_beyond_end", 1, 3, 3, i); __PYX_ERR(0, 637, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 637, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 637, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 637, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_seek_beyond_end", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 637, __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("indexed_gzip.tests.ctest_zran.test_seek_beyond_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_34test_seek_beyond_end(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems);

  /* 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_12indexed_gzip_5tests_10ctest_zran_34test_seek_beyond_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems) {
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  PyObject *__pyx_v_seekpoints = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_sp = NULL;
  int __pyx_v_zs;
  PyObject *__pyx_v_expected = NULL;
  uint64_t __pyx_v_zt;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  void *__pyx_t_16;
  PyObject *__pyx_t_17;
  uint32_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int64_t __pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  int __pyx_t_26;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_seek_beyond_end", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":641
 *     cdef zran.zran_index_t index
 * 
 *     filesize     = nelems * 8             # <<<<<<<<<<<<<<
 *     indexSpacing = max(524288, filesize // 1500)
 *     seekpoints   = [filesize - 10,
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":642
 * 
 *     filesize     = nelems * 8
 *     indexSpacing = max(524288, filesize // 1500)             # <<<<<<<<<<<<<<
 *     seekpoints   = [filesize - 10,
 *                     filesize - 2,
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1500, 0x5DC, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0x80000;
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":643
 *     filesize     = nelems * 8
 *     indexSpacing = max(524288, filesize // 1500)
 *     seekpoints   = [filesize - 10,             # <<<<<<<<<<<<<<
 *                     filesize - 2,
 *                     filesize - 1,
*/
  __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "indexed_gzip/tests/ctest_zran.pyx":644
 *     indexSpacing = max(524288, filesize // 1500)
 *     seekpoints   = [filesize - 10,
 *                     filesize - 2,             # <<<<<<<<<<<<<<
 *                     filesize - 1,
 *                     filesize,
*/
  __pyx_t_3 = __Pyx_PyLong_SubtractObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "indexed_gzip/tests/ctest_zran.pyx":645
 *     seekpoints   = [filesize - 10,
 *                     filesize - 2,
 *                     filesize - 1,             # <<<<<<<<<<<<<<
 *                     filesize,
 *                     filesize + 1,
*/
  __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "indexed_gzip/tests/ctest_zran.pyx":647
 *                     filesize - 1,
 *                     filesize,
 *                     filesize + 1,             # <<<<<<<<<<<<<<
 *                     filesize + 2,
 *                     filesize + 10]
*/
  __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "indexed_gzip/tests/ctest_zran.pyx":648
 *                     filesize,
 *                     filesize + 1,
 *                     filesize + 2,             # <<<<<<<<<<<<<<
 *                     filesize + 10]
 * 
*/
  __pyx_t_7 = __Pyx_PyLong_AddObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "indexed_gzip/tests/ctest_zran.pyx":649
 *                     filesize + 1,
 *                     filesize + 2,
 *                     filesize + 10]             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "indexed_gzip/tests/ctest_zran.pyx":643
 *     filesize     = nelems * 8
 *     indexSpacing = max(524288, filesize // 1500)
 *     seekpoints   = [filesize - 10,             # <<<<<<<<<<<<<<
 *                     filesize - 2,
 *                     filesize - 1,
*/
  __pyx_t_9 = PyList_New(7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 643, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 643, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 643, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_filesize);
  __Pyx_GIVEREF(__pyx_v_filesize);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 3, __pyx_v_filesize) != (0)) __PYX_ERR(0, 643, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 4, __pyx_t_4) != (0)) __PYX_ERR(0, 643, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 5, __pyx_t_7) != (0)) __PYX_ERR(0, 643, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 6, __pyx_t_8) != (0)) __PYX_ERR(0, 643, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_v_seekpoints = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":651
 *                     filesize + 10]
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_8 = NULL;
    __pyx_t_10 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_7 = NULL;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 651, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_4 = __pyx_t_8;
    __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":652
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_9 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_9);
          __pyx_t_10 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 652, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_15, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":654
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":655
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 655, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_16 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":656
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 656, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_17 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_17 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":657
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_18 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_18 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L7_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":654
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_6 = (!(zran_init((&__pyx_v_index), __pyx_t_16, __pyx_t_17, __pyx_t_18, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 654, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 654, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":662
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         for sp in seekpoints:             # <<<<<<<<<<<<<<
 * 
 *             zs = zran.zran_seek(&index, sp, SEEK_SET, NULL)
*/
          __pyx_t_4 = __pyx_v_seekpoints; __Pyx_INCREF(__pyx_t_4);
          __pyx_t_19 = 0;
          for (;;) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 662, __pyx_L7_error)
              #endif
              if (__pyx_t_19 >= __pyx_temp) break;
            }
            __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_19, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_19;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 662, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_XDECREF_SET(__pyx_v_sp, __pyx_t_9);
            __pyx_t_9 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":664
 *         for sp in seekpoints:
 * 
 *             zs = zran.zran_seek(&index, sp, SEEK_SET, NULL)             # <<<<<<<<<<<<<<
 * 
 *             if sp >= filesize: expected = zran.ZRAN_SEEK_EOF
*/
            __pyx_t_20 = __Pyx_PyLong_As_int64_t(__pyx_v_sp); if (unlikely((__pyx_t_20 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L7_error)
            __pyx_v_zs = zran_seek((&__pyx_v_index), __pyx_t_20, SEEK_SET, NULL);

            /* "indexed_gzip/tests/ctest_zran.pyx":666
 *             zs = zran.zran_seek(&index, sp, SEEK_SET, NULL)
 * 
 *             if sp >= filesize: expected = zran.ZRAN_SEEK_EOF             # <<<<<<<<<<<<<<
 *             else:              expected = zran.ZRAN_SEEK_OK
 * 
*/
            __pyx_t_9 = PyObject_RichCompare(__pyx_v_sp, __pyx_v_filesize, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 666, __pyx_L7_error)
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 666, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (__pyx_t_6) {
              __pyx_t_9 = __Pyx_PyLong_From___pyx_anon_enum(ZRAN_SEEK_EOF); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 666, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_XDECREF_SET(__pyx_v_expected, __pyx_t_9);
              __pyx_t_9 = 0;
              goto __pyx_L15;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":667
 * 
 *             if sp >= filesize: expected = zran.ZRAN_SEEK_EOF
 *             else:              expected = zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 * 
 *             try:
*/
            /*else*/ {
              __pyx_t_9 = __Pyx_PyLong_From___pyx_anon_enum(ZRAN_SEEK_OK); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 667, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_XDECREF_SET(__pyx_v_expected, __pyx_t_9);
              __pyx_t_9 = 0;
            }
            __pyx_L15:;

            /* "indexed_gzip/tests/ctest_zran.pyx":669
 *             else:              expected = zran.ZRAN_SEEK_OK
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert zs == expected
 * 
*/
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_23);
              /*try:*/ {

                /* "indexed_gzip/tests/ctest_zran.pyx":670
 * 
 *             try:
 *                 assert zs == expected             # <<<<<<<<<<<<<<
 * 
 *             except:
*/
                #ifndef CYTHON_WITHOUT_ASSERTIONS
                if (unlikely(__pyx_assertions_enabled())) {
                  __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_zs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 670, __pyx_L16_error)
                  __Pyx_GOTREF(__pyx_t_9);
                  __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_v_expected, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __pyx_L16_error)
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 670, __pyx_L16_error)
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  if (unlikely(!__pyx_t_6)) {
                    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                    __PYX_ERR(0, 670, __pyx_L16_error)
                  }
                }
                #else
                if ((1)); else __PYX_ERR(0, 670, __pyx_L16_error)
                #endif

                /* "indexed_gzip/tests/ctest_zran.pyx":669
 *             else:              expected = zran.ZRAN_SEEK_OK
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert zs == expected
 * 
*/
              }
              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
              __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
              __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
              goto __pyx_L23_try_end;
              __pyx_L16_error:;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":672
 *                 assert zs == expected
 * 
 *             except:             # <<<<<<<<<<<<<<
 *                 print("{} != {} [sp={}, size={}]".format(zs, expected, sp, filesize))
 *                 raise
*/
              /*except:*/ {
                __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seek_beyond_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 672, __pyx_L18_except_error)
                __Pyx_XGOTREF(__pyx_t_8);
                __Pyx_XGOTREF(__pyx_t_9);
                __Pyx_XGOTREF(__pyx_t_7);

                /* "indexed_gzip/tests/ctest_zran.pyx":673
 * 
 *             except:
 *                 print("{} != {} [sp={}, size={}]".format(zs, expected, sp, filesize))             # <<<<<<<<<<<<<<
 *                 raise
 * 
*/
                __pyx_t_3 = NULL;
                __pyx_t_24 = __pyx_mstate_global->__pyx_kp_u_sp_size;
                __Pyx_INCREF(__pyx_t_24);
                __pyx_t_25 = __Pyx_PyLong_From_int(__pyx_v_zs); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 673, __pyx_L18_except_error)
                __Pyx_GOTREF(__pyx_t_25);
                __pyx_t_10 = 0;
                {
                  PyObject *__pyx_callargs[5] = {__pyx_t_24, __pyx_t_25, __pyx_v_expected, __pyx_v_sp, __pyx_v_filesize};
                  __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (5-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
                  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
                  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_1);
                }
                __pyx_t_10 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1};
                  __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __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_1); __pyx_t_1 = 0;
                  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 673, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_5);
                }
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":674
 *             except:
 *                 print("{} != {} [sp={}, size={}]".format(zs, expected, sp, filesize))
 *                 raise             # <<<<<<<<<<<<<<
 * 
 *             zt = zran.zran_tell(&index)
*/
                __Pyx_GIVEREF(__pyx_t_8);
                __Pyx_GIVEREF(__pyx_t_9);
                __Pyx_XGIVEREF(__pyx_t_7);
                __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_9, __pyx_t_7);
                __pyx_t_8 = 0;  __pyx_t_9 = 0;  __pyx_t_7 = 0; 
                __PYX_ERR(0, 674, __pyx_L18_except_error)
              }

              /* "indexed_gzip/tests/ctest_zran.pyx":669
 *             else:              expected = zran.ZRAN_SEEK_OK
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert zs == expected
 * 
*/
              __pyx_L18_except_error:;
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
              goto __pyx_L7_error;
              __pyx_L23_try_end:;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":676
 *                 raise
 * 
 *             zt = zran.zran_tell(&index)             # <<<<<<<<<<<<<<
 * 
 *             if sp >= filesize: expected = filesize
*/
            __pyx_v_zt = zran_tell((&__pyx_v_index));

            /* "indexed_gzip/tests/ctest_zran.pyx":678
 *             zt = zran.zran_tell(&index)
 * 
 *             if sp >= filesize: expected = filesize             # <<<<<<<<<<<<<<
 *             else:              expected = sp
 * 
*/
            __pyx_t_7 = PyObject_RichCompare(__pyx_v_sp, __pyx_v_filesize, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 678, __pyx_L7_error)
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 678, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (__pyx_t_6) {
              __Pyx_INCREF(__pyx_v_filesize);
              __Pyx_DECREF_SET(__pyx_v_expected, __pyx_v_filesize);
              goto __pyx_L26;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":679
 * 
 *             if sp >= filesize: expected = filesize
 *             else:              expected = sp             # <<<<<<<<<<<<<<
 * 
 *             try:
*/
            /*else*/ {
              __Pyx_INCREF(__pyx_v_sp);
              __Pyx_DECREF_SET(__pyx_v_expected, __pyx_v_sp);
            }
            __pyx_L26:;

            /* "indexed_gzip/tests/ctest_zran.pyx":681
 *             else:              expected = sp
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert zt == expected
 * 
*/
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_21);
              /*try:*/ {

                /* "indexed_gzip/tests/ctest_zran.pyx":682
 * 
 *             try:
 *                 assert zt == expected             # <<<<<<<<<<<<<<
 * 
 *             except:
*/
                #ifndef CYTHON_WITHOUT_ASSERTIONS
                if (unlikely(__pyx_assertions_enabled())) {
                  __pyx_t_7 = __Pyx_PyLong_From_uint64_t(__pyx_v_zt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L27_error)
                  __Pyx_GOTREF(__pyx_t_7);
                  __pyx_t_9 = PyObject_RichCompare(__pyx_t_7, __pyx_v_expected, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 682, __pyx_L27_error)
                  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 682, __pyx_L27_error)
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  if (unlikely(!__pyx_t_6)) {
                    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                    __PYX_ERR(0, 682, __pyx_L27_error)
                  }
                }
                #else
                if ((1)); else __PYX_ERR(0, 682, __pyx_L27_error)
                #endif

                /* "indexed_gzip/tests/ctest_zran.pyx":681
 *             else:              expected = sp
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert zt == expected
 * 
*/
              }
              __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
              __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
              goto __pyx_L34_try_end;
              __pyx_L27_error:;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
              __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":684
 *                 assert zt == expected
 * 
 *             except:             # <<<<<<<<<<<<<<
 *                 print("{} != {}".format(zt, expected))
 *                 raise
*/
              /*except:*/ {
                __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seek_beyond_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 684, __pyx_L29_except_error)
                __Pyx_XGOTREF(__pyx_t_9);
                __Pyx_XGOTREF(__pyx_t_7);
                __Pyx_XGOTREF(__pyx_t_8);

                /* "indexed_gzip/tests/ctest_zran.pyx":685
 * 
 *             except:
 *                 print("{} != {}".format(zt, expected))             # <<<<<<<<<<<<<<
 *                 raise
 * 
*/
                __pyx_t_1 = NULL;
                __pyx_t_25 = __pyx_mstate_global->__pyx_kp_u_;
                __Pyx_INCREF(__pyx_t_25);
                __pyx_t_24 = __Pyx_PyLong_From_uint64_t(__pyx_v_zt); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 685, __pyx_L29_except_error)
                __Pyx_GOTREF(__pyx_t_24);
                __pyx_t_10 = 0;
                {
                  PyObject *__pyx_callargs[3] = {__pyx_t_25, __pyx_t_24, __pyx_v_expected};
                  __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
                  __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L29_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                }
                __pyx_t_10 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
                  __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L29_except_error)
                  __Pyx_GOTREF(__pyx_t_5);
                }
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":686
 *             except:
 *                 print("{} != {}".format(zt, expected))
 *                 raise             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index)
*/
                __Pyx_GIVEREF(__pyx_t_9);
                __Pyx_GIVEREF(__pyx_t_7);
                __Pyx_XGIVEREF(__pyx_t_8);
                __Pyx_ErrRestoreWithState(__pyx_t_9, __pyx_t_7, __pyx_t_8);
                __pyx_t_9 = 0;  __pyx_t_7 = 0;  __pyx_t_8 = 0; 
                __PYX_ERR(0, 686, __pyx_L29_except_error)
              }

              /* "indexed_gzip/tests/ctest_zran.pyx":681
 *             else:              expected = sp
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert zt == expected
 * 
*/
              __pyx_L29_except_error:;
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21);
              goto __pyx_L7_error;
              __pyx_L34_try_end:;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":662
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         for sp in seekpoints:             # <<<<<<<<<<<<<<
 * 
 *             zs = zran.zran_seek(&index, sp, SEEK_SET, NULL)
*/
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":688
 *                 raise
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":651
 *                     filesize + 10]
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
        __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seek_beyond_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(0, 651, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_9 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 651, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_9, NULL);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 651, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_21);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_21);
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          if (__pyx_t_6 < (0)) __PYX_ERR(0, 651, __pyx_L9_except_error)
          __pyx_t_26 = (!__pyx_t_6);
          if (unlikely(__pyx_t_26)) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_7);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_8, __pyx_t_7);
            __pyx_t_4 = 0;  __pyx_t_8 = 0;  __pyx_t_7 = 0; 
            __PYX_ERR(0, 651, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_11) {
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 651, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L41;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L1_error;
    __pyx_L41:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":637
 * 
 * 
 * def test_seek_beyond_end(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_XDECREF(__pyx_t_25);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seek_beyond_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF(__pyx_v_seekpoints);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_sp);
  __Pyx_XDECREF(__pyx_v_expected);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":691
 * 
 * 
 * def test_sequential_seek_to_end(testfile, no_fds, nelems, niters):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_37test_sequential_seek_to_end(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_37test_sequential_seek_to_end = {"test_sequential_seek_to_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_37test_sequential_seek_to_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_37test_sequential_seek_to_end(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  PyObject *__pyx_v_niters = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_sequential_seek_to_end (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,&__pyx_mstate_global->__pyx_n_u_niters,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 691, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 691, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 691, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 691, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 691, __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, "test_sequential_seek_to_end", 0) < (0)) __PYX_ERR(0, 691, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_sequential_seek_to_end", 1, 4, 4, i); __PYX_ERR(0, 691, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 691, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 691, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 691, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 691, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
    __pyx_v_niters = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_sequential_seek_to_end", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 691, __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("indexed_gzip.tests.ctest_zran.test_sequential_seek_to_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_36test_sequential_seek_to_end(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems, __pyx_v_niters);

  /* 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_12indexed_gzip_5tests_10ctest_zran_36test_sequential_seek_to_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_niters) {
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_seek_points = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_sp = NULL;
  int __pyx_v_expseek;
  PyObject *__pyx_v_exptell = NULL;
  int __pyx_v_seek;
  uint64_t __pyx_v_tell;
  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;
  long __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  void *__pyx_t_14;
  PyObject *__pyx_t_15;
  uint32_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  PyObject *(*__pyx_t_18)(PyObject *);
  int64_t __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  int __pyx_t_27;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_sequential_seek_to_end", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":695
 *     cdef zran.zran_index_t index
 * 
 *     filesize   = nelems * 8             # <<<<<<<<<<<<<<
 * 
 *     seek_points = np.random.randint(0, filesize, niters, dtype=np.uint64)
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":697
 *     filesize   = nelems * 8
 * 
 *     seek_points = np.random.randint(0, filesize, niters, dtype=np.uint64)             # <<<<<<<<<<<<<<
 *     seek_points = np.sort(seek_points)
 *     indexSpacing = max(524288, filesize // 2000)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_uint64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0, __pyx_v_filesize, __pyx_v_niters};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_3, __pyx_callargs+4, 0) < (0)) __PYX_ERR(0, 697, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_seek_points = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":698
 * 
 *     seek_points = np.random.randint(0, filesize, niters, dtype=np.uint64)
 *     seek_points = np.sort(seek_points)             # <<<<<<<<<<<<<<
 *     indexSpacing = max(524288, filesize // 2000)
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sort); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_seek_points};
    __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_seek_points, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":699
 *     seek_points = np.random.randint(0, filesize, niters, dtype=np.uint64)
 *     seek_points = np.sort(seek_points)
 *     indexSpacing = max(524288, filesize // 2000)             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_2000, 0x7D0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = 0x80000;
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = __pyx_t_1;
  } else {
    __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":701
 *     indexSpacing = max(524288, filesize // 2000)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_5 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_4 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":702
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_1 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_6 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_13 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_13, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":704
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":705
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 705, __pyx_L7_error)
            if (__pyx_t_8) {
              __pyx_t_14 = NULL;
            } else {
              __pyx_t_14 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":706
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 706, __pyx_L7_error)
            if (__pyx_t_8) {
              __pyx_t_15 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_15 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":707
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_16 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_16 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L7_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":704
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_8 = (!(zran_init((&__pyx_v_index), __pyx_t_14, __pyx_t_15, __pyx_t_16, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
            if (unlikely(!__pyx_t_8)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 704, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 704, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":712
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         for sp in seek_points:             # <<<<<<<<<<<<<<
 * 
 *             if sp >= filesize:
*/
          if (likely(PyList_CheckExact(__pyx_v_seek_points)) || PyTuple_CheckExact(__pyx_v_seek_points)) {
            __pyx_t_4 = __pyx_v_seek_points; __Pyx_INCREF(__pyx_t_4);
            __pyx_t_17 = 0;
            __pyx_t_18 = NULL;
          } else {
            __pyx_t_17 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_seek_points); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_18 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 712, __pyx_L7_error)
          }
          for (;;) {
            if (likely(!__pyx_t_18)) {
              if (likely(PyList_CheckExact(__pyx_t_4))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 712, __pyx_L7_error)
                  #endif
                  if (__pyx_t_17 >= __pyx_temp) break;
                }
                __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_17, __Pyx_ReferenceSharing_OwnStrongReference);
                ++__pyx_t_17;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 712, __pyx_L7_error)
                  #endif
                  if (__pyx_t_17 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_17));
                #else
                __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_17);
                #endif
                ++__pyx_t_17;
              }
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L7_error)
            } else {
              __pyx_t_1 = __pyx_t_18(__pyx_t_4);
              if (unlikely(!__pyx_t_1)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 712, __pyx_L7_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_sp, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":714
 *         for sp in seek_points:
 * 
 *             if sp >= filesize:             # <<<<<<<<<<<<<<
 *                 expseek = zran.ZRAN_SEEK_EOF
 *                 exptell = filesize
*/
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_sp, __pyx_v_filesize, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L7_error)
            __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 714, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_8) {

              /* "indexed_gzip/tests/ctest_zran.pyx":715
 * 
 *             if sp >= filesize:
 *                 expseek = zran.ZRAN_SEEK_EOF             # <<<<<<<<<<<<<<
 *                 exptell = filesize
 *             else:
*/
              __pyx_v_expseek = ZRAN_SEEK_EOF;

              /* "indexed_gzip/tests/ctest_zran.pyx":716
 *             if sp >= filesize:
 *                 expseek = zran.ZRAN_SEEK_EOF
 *                 exptell = filesize             # <<<<<<<<<<<<<<
 *             else:
 *                 expseek = zran.ZRAN_SEEK_OK
*/
              __Pyx_INCREF(__pyx_v_filesize);
              __Pyx_XDECREF_SET(__pyx_v_exptell, __pyx_v_filesize);

              /* "indexed_gzip/tests/ctest_zran.pyx":714
 *         for sp in seek_points:
 * 
 *             if sp >= filesize:             # <<<<<<<<<<<<<<
 *                 expseek = zran.ZRAN_SEEK_EOF
 *                 exptell = filesize
*/
              goto __pyx_L15;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":718
 *                 exptell = filesize
 *             else:
 *                 expseek = zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 *                 exptell = sp
 * 
*/
            /*else*/ {
              __pyx_v_expseek = ZRAN_SEEK_OK;

              /* "indexed_gzip/tests/ctest_zran.pyx":719
 *             else:
 *                 expseek = zran.ZRAN_SEEK_OK
 *                 exptell = sp             # <<<<<<<<<<<<<<
 * 
 *             seek = zran.zran_seek(&index, sp, SEEK_SET, NULL)
*/
              __Pyx_INCREF(__pyx_v_sp);
              __Pyx_XDECREF_SET(__pyx_v_exptell, __pyx_v_sp);
            }
            __pyx_L15:;

            /* "indexed_gzip/tests/ctest_zran.pyx":721
 *                 exptell = sp
 * 
 *             seek = zran.zran_seek(&index, sp, SEEK_SET, NULL)             # <<<<<<<<<<<<<<
 *             tell = zran.zran_tell(&index)
 * 
*/
            __pyx_t_19 = __Pyx_PyLong_As_int64_t(__pyx_v_sp); if (unlikely((__pyx_t_19 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 721, __pyx_L7_error)
            __pyx_v_seek = zran_seek((&__pyx_v_index), __pyx_t_19, SEEK_SET, NULL);

            /* "indexed_gzip/tests/ctest_zran.pyx":722
 * 
 *             seek = zran.zran_seek(&index, sp, SEEK_SET, NULL)
 *             tell = zran.zran_tell(&index)             # <<<<<<<<<<<<<<
 * 
 *             try:
*/
            __pyx_v_tell = zran_tell((&__pyx_v_index));

            /* "indexed_gzip/tests/ctest_zran.pyx":724
 *             tell = zran.zran_tell(&index)
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert seek == expseek
 *                 assert tell == exptell
*/
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_22);
              /*try:*/ {

                /* "indexed_gzip/tests/ctest_zran.pyx":725
 * 
 *             try:
 *                 assert seek == expseek             # <<<<<<<<<<<<<<
 *                 assert tell == exptell
 *             except:
*/
                #ifndef CYTHON_WITHOUT_ASSERTIONS
                if (unlikely(__pyx_assertions_enabled())) {
                  __pyx_t_8 = (__pyx_v_seek == __pyx_v_expseek);
                  if (unlikely(!__pyx_t_8)) {
                    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                    __PYX_ERR(0, 725, __pyx_L16_error)
                  }
                }
                #else
                if ((1)); else __PYX_ERR(0, 725, __pyx_L16_error)
                #endif

                /* "indexed_gzip/tests/ctest_zran.pyx":726
 *             try:
 *                 assert seek == expseek
 *                 assert tell == exptell             # <<<<<<<<<<<<<<
 *             except:
 *                 print("expseek: {}".format(expseek))
*/
                #ifndef CYTHON_WITHOUT_ASSERTIONS
                if (unlikely(__pyx_assertions_enabled())) {
                  __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_tell); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L16_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exptell, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 726, __pyx_L16_error)
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 726, __pyx_L16_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  if (unlikely(!__pyx_t_8)) {
                    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                    __PYX_ERR(0, 726, __pyx_L16_error)
                  }
                }
                #else
                if ((1)); else __PYX_ERR(0, 726, __pyx_L16_error)
                #endif

                /* "indexed_gzip/tests/ctest_zran.pyx":724
 *             tell = zran.zran_tell(&index)
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert seek == expseek
 *                 assert tell == exptell
*/
              }
              __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
              __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
              goto __pyx_L23_try_end;
              __pyx_L16_error:;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":727
 *                 assert seek == expseek
 *                 assert tell == exptell
 *             except:             # <<<<<<<<<<<<<<
 *                 print("expseek: {}".format(expseek))
 *                 print("exptell: {}".format(exptell))
*/
              /*except:*/ {
                __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_sequential_seek_to_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 727, __pyx_L18_except_error)
                __Pyx_XGOTREF(__pyx_t_5);
                __Pyx_XGOTREF(__pyx_t_1);
                __Pyx_XGOTREF(__pyx_t_3);

                /* "indexed_gzip/tests/ctest_zran.pyx":728
 *                 assert tell == exptell
 *             except:
 *                 print("expseek: {}".format(expseek))             # <<<<<<<<<<<<<<
 *                 print("exptell: {}".format(exptell))
 *                 print("seek:    {}".format(seek))
*/
                __pyx_t_23 = NULL;
                __pyx_t_25 = __pyx_mstate_global->__pyx_kp_u_expseek;
                __Pyx_INCREF(__pyx_t_25);
                __pyx_t_26 = __Pyx_PyLong_From___pyx_anon_enum(__pyx_v_expseek); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 728, __pyx_L18_except_error)
                __Pyx_GOTREF(__pyx_t_26);
                __pyx_t_6 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_25, __pyx_t_26};
                  __pyx_t_24 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
                  __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
                  if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 728, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_24);
                }
                __pyx_t_6 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_t_24};
                  __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
                  __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_2);
                }
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":729
 *             except:
 *                 print("expseek: {}".format(expseek))
 *                 print("exptell: {}".format(exptell))             # <<<<<<<<<<<<<<
 *                 print("seek:    {}".format(seek))
 *                 print("tell:    {}".format(tell))
*/
                __pyx_t_24 = NULL;
                __pyx_t_26 = __pyx_mstate_global->__pyx_kp_u_exptell;
                __Pyx_INCREF(__pyx_t_26);
                __pyx_t_6 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_26, __pyx_v_exptell};
                  __pyx_t_23 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
                  if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 729, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_23);
                }
                __pyx_t_6 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_24, __pyx_t_23};
                  __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
                  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
                  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_2);
                }
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":730
 *                 print("expseek: {}".format(expseek))
 *                 print("exptell: {}".format(exptell))
 *                 print("seek:    {}".format(seek))             # <<<<<<<<<<<<<<
 *                 print("tell:    {}".format(tell))
 *                 raise
*/
                __pyx_t_23 = NULL;
                __pyx_t_26 = __pyx_mstate_global->__pyx_kp_u_seek_2;
                __Pyx_INCREF(__pyx_t_26);
                __pyx_t_25 = __Pyx_PyLong_From_int(__pyx_v_seek); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 730, __pyx_L18_except_error)
                __Pyx_GOTREF(__pyx_t_25);
                __pyx_t_6 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_26, __pyx_t_25};
                  __pyx_t_24 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
                  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
                  if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 730, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_24);
                }
                __pyx_t_6 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_t_24};
                  __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
                  __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_2);
                }
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":731
 *                 print("exptell: {}".format(exptell))
 *                 print("seek:    {}".format(seek))
 *                 print("tell:    {}".format(tell))             # <<<<<<<<<<<<<<
 *                 raise
 * 
*/
                __pyx_t_24 = NULL;
                __pyx_t_25 = __pyx_mstate_global->__pyx_kp_u_tell_2;
                __Pyx_INCREF(__pyx_t_25);
                __pyx_t_26 = __Pyx_PyLong_From_uint64_t(__pyx_v_tell); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 731, __pyx_L18_except_error)
                __Pyx_GOTREF(__pyx_t_26);
                __pyx_t_6 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_25, __pyx_t_26};
                  __pyx_t_23 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
                  __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
                  if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 731, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_23);
                }
                __pyx_t_6 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_24, __pyx_t_23};
                  __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
                  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
                  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_2);
                }
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":732
 *                 print("seek:    {}".format(seek))
 *                 print("tell:    {}".format(tell))
 *                 raise             # <<<<<<<<<<<<<<
 * 
 * 
*/
                __Pyx_GIVEREF(__pyx_t_5);
                __Pyx_GIVEREF(__pyx_t_1);
                __Pyx_XGIVEREF(__pyx_t_3);
                __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_1, __pyx_t_3);
                __pyx_t_5 = 0;  __pyx_t_1 = 0;  __pyx_t_3 = 0; 
                __PYX_ERR(0, 732, __pyx_L18_except_error)
              }

              /* "indexed_gzip/tests/ctest_zran.pyx":724
 *             tell = zran.zran_tell(&index)
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert seek == expseek
 *                 assert tell == exptell
*/
              __pyx_L18_except_error:;
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
              goto __pyx_L7_error;
              __pyx_L23_try_end:;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":712
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         for sp in seek_points:             # <<<<<<<<<<<<<<
 * 
 *             if sp >= filesize:
*/
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":735
 * 
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":701
 *     indexSpacing = max(524288, filesize // 2000)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
        __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
        __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
        __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_sequential_seek_to_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 701, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 701, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_22);
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_22);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          if (__pyx_t_8 < (0)) __PYX_ERR(0, 701, __pyx_L9_except_error)
          __pyx_t_27 = (!__pyx_t_8);
          if (unlikely(__pyx_t_27)) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_3, __pyx_t_1);
            __pyx_t_4 = 0;  __pyx_t_3 = 0;  __pyx_t_1 = 0; 
            __PYX_ERR(0, 701, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_9) {
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 701, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L30;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L1_error;
    __pyx_L30:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":691
 * 
 * 
 * def test_sequential_seek_to_end(testfile, no_fds, nelems, niters):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_XDECREF(__pyx_t_25);
  __Pyx_XDECREF(__pyx_t_26);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_sequential_seek_to_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_seek_points);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_sp);
  __Pyx_XDECREF(__pyx_v_exptell);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":738
 * 
 * 
 * def test_random_seek(testfile, no_fds, nelems, niters, seed):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_39test_random_seek(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_39test_random_seek = {"test_random_seek", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_39test_random_seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_39test_random_seek(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  PyObject *__pyx_v_niters = 0;
  CYTHON_UNUSED PyObject *__pyx_v_seed = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_random_seek (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,&__pyx_mstate_global->__pyx_n_u_niters,&__pyx_mstate_global->__pyx_n_u_seed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 738, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 738, __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, "test_random_seek", 0) < (0)) __PYX_ERR(0, 738, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_random_seek", 1, 5, 5, i); __PYX_ERR(0, 738, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 738, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 738, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 738, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 738, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 738, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
    __pyx_v_niters = values[3];
    __pyx_v_seed = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_random_seek", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 738, __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("indexed_gzip.tests.ctest_zran.test_random_seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_38test_random_seek(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems, __pyx_v_niters, __pyx_v_seed);

  /* 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_12indexed_gzip_5tests_10ctest_zran_38test_random_seek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_niters, CYTHON_UNUSED PyObject *__pyx_v_seed) {
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_seekpoints = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_sp = NULL;
  uint64_t __pyx_v_zt;
  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  long __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  void *__pyx_t_16;
  PyObject *__pyx_t_17;
  uint32_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int64_t __pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_random_seek", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":742
 *     cdef zran.zran_index_t index
 * 
 *     filesize = nelems * 8             # <<<<<<<<<<<<<<
 * 
 *     seekpoints   = [random.randint(0, filesize) for i in range(niters)]
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":744
 *     filesize = nelems * 8
 * 
 *     seekpoints   = [random.randint(0, filesize) for i in range(niters)]             # <<<<<<<<<<<<<<
 *     indexSpacing = max(524288, filesize // 1000)
 * 
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_niters};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __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(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 744, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_randint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_int_0, __pyx_v_filesize};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_seekpoints = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":745
 * 
 *     seekpoints   = [random.randint(0, filesize) for i in range(niters)]
 *     indexSpacing = max(524288, filesize // 1000)             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = 0x80000;
  __pyx_t_2 = __Pyx_PyLong_From_long(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_10) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_8 = __Pyx_PyLong_From_long(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __pyx_t_8;
    __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":747
 *     indexSpacing = max(524288, filesize // 1000)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_4, (3-__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(0, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = NULL;
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":748
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_1 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_4 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L10_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_15, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":750
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":751
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 751, __pyx_L10_error)
            if (__pyx_t_10) {
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_16 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":752
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 752, __pyx_L10_error)
            if (__pyx_t_10) {
              __pyx_t_17 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_17 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":753
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_18 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_18 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L10_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":750
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_10 = (!(zran_init((&__pyx_v_index), __pyx_t_16, __pyx_t_17, __pyx_t_18, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
            if (unlikely(!__pyx_t_10)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 750, __pyx_L10_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 750, __pyx_L10_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":758
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         for sp in seekpoints:             # <<<<<<<<<<<<<<
 * 
 *             assert zran.zran_seek(&index, sp, SEEK_SET, NULL) == 0
*/
          __pyx_t_2 = __pyx_v_seekpoints; __Pyx_INCREF(__pyx_t_2);
          __pyx_t_19 = 0;
          for (;;) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 758, __pyx_L10_error)
              #endif
              if (__pyx_t_19 >= __pyx_temp) break;
            }
            __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_19, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_19;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_sp, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":760
 *         for sp in seekpoints:
 * 
 *             assert zran.zran_seek(&index, sp, SEEK_SET, NULL) == 0             # <<<<<<<<<<<<<<
 * 
 *             zt = zran.zran_tell(&index)
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_20 = __Pyx_PyLong_As_int64_t(__pyx_v_sp); if (unlikely((__pyx_t_20 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L10_error)
              __pyx_t_10 = (zran_seek((&__pyx_v_index), __pyx_t_20, SEEK_SET, NULL) == 0);
              if (unlikely(!__pyx_t_10)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 760, __pyx_L10_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 760, __pyx_L10_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":762
 *             assert zran.zran_seek(&index, sp, SEEK_SET, NULL) == 0
 * 
 *             zt = zran.zran_tell(&index)             # <<<<<<<<<<<<<<
 * 
 *             assert zt == sp
*/
            __pyx_v_zt = zran_tell((&__pyx_v_index));

            /* "indexed_gzip/tests/ctest_zran.pyx":764
 *             zt = zran.zran_tell(&index)
 * 
 *             assert zt == sp             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index)
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_zt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_sp, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L10_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 764, __pyx_L10_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_10)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 764, __pyx_L10_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 764, __pyx_L10_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":758
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         for sp in seekpoints:             # <<<<<<<<<<<<<<
 * 
 *             assert zran.zran_seek(&index, sp, SEEK_SET, NULL) == 0
*/
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":766
 *             assert zt == sp
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":747
 *     indexSpacing = max(524288, filesize // 1000)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L15_try_end;
        __pyx_L10_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_random_seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 747, __pyx_L12_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_8 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 747, __pyx_L12_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_8, NULL);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 747, __pyx_L12_except_error)
          __Pyx_GOTREF(__pyx_t_21);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_21);
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          if (__pyx_t_10 < (0)) __PYX_ERR(0, 747, __pyx_L12_except_error)
          __pyx_t_22 = (!__pyx_t_10);
          if (unlikely(__pyx_t_22)) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1);
            __pyx_t_2 = 0;  __pyx_t_3 = 0;  __pyx_t_1 = 0; 
            __PYX_ERR(0, 747, __pyx_L12_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L11_exception_handled;
        }
        __pyx_L12_except_error:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        goto __pyx_L1_error;
        __pyx_L11_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        __pyx_L15_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_11) {
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 747, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        goto __pyx_L9;
      }
      __pyx_L9:;
    }
    goto __pyx_L22;
    __pyx_L6_error:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L1_error;
    __pyx_L22:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":738
 * 
 * 
 * def test_random_seek(testfile, no_fds, nelems, niters, seed):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_random_seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_seekpoints);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_sp);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":769
 * 
 * 
 * def test_read_all(testfile, no_fds, nelems, use_mmap):             # <<<<<<<<<<<<<<
 * 
 *     filesize = nelems * 8
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_41test_read_all(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_41test_read_all = {"test_read_all", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_41test_read_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_41test_read_all(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  PyObject *__pyx_v_use_mmap = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_read_all (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,&__pyx_mstate_global->__pyx_n_u_use_mmap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 769, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 769, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 769, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 769, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 769, __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, "test_read_all", 0) < (0)) __PYX_ERR(0, 769, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_read_all", 1, 4, 4, i); __PYX_ERR(0, 769, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 769, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 769, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 769, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 769, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
    __pyx_v_use_mmap = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_read_all", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 769, __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("indexed_gzip.tests.ctest_zran.test_read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_40test_read_all(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems, __pyx_v_use_mmap);

  /* 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_12indexed_gzip_5tests_10ctest_zran_40test_read_all(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_use_mmap) {
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  zran_index_t __pyx_v_index;
  void *__pyx_v_buffer;
  npy_intp __pyx_v_nelemsp;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_buf = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_nbytes = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  void *__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14;
  uint32_t __pyx_t_15;
  uint64_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  npy_intp __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_read_all", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":771
 * def test_read_all(testfile, no_fds, nelems, use_mmap):
 * 
 *     filesize = nelems * 8             # <<<<<<<<<<<<<<
 *     indexSpacing = max(524288, filesize // 1000)
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":772
 * 
 *     filesize = nelems * 8
 *     indexSpacing = max(524288, filesize // 1000)             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0x80000;
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 772, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":778
 *     cdef np.npy_intp       nelemsp
 * 
 *     buf    = ReadBuffer(filesize, use_mmap=use_mmap)             # <<<<<<<<<<<<<<
 *     buffer = buf.buffer
 * 
*/
  __pyx_t_3 = NULL;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_v_filesize};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_mmap, __pyx_v_use_mmap, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 778, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 778, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":779
 * 
 *     buf    = ReadBuffer(filesize, use_mmap=use_mmap)
 *     buffer = buf.buffer             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __pyx_t_8 = __pyx_v_buf->buffer;
  __pyx_v_buffer = __pyx_t_8;

  /* "indexed_gzip/tests/ctest_zran.pyx":781
 *     buffer = buf.buffer
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_5 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 781, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_4 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":782
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_1 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_13 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_13, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":784
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":785
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 785, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_8 = NULL;
            } else {
              __pyx_t_8 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":786
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 786, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_14 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_14 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":787
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_15 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 787, __pyx_L7_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":784
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_6 = (!(zran_init((&__pyx_v_index), __pyx_t_8, __pyx_t_14, __pyx_t_15, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 784, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 784, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":792
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         nbytes = zran.zran_read(&index, buffer, filesize)             # <<<<<<<<<<<<<<
 * 
 *         assert nbytes                 == filesize
*/
          __pyx_t_16 = __Pyx_PyLong_As_uint64_t(__pyx_v_filesize); if (unlikely((__pyx_t_16 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 792, __pyx_L7_error)
          __pyx_t_4 = __Pyx_PyLong_From_int64_t(zran_read((&__pyx_v_index), __pyx_v_buffer, __pyx_t_16)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_v_nbytes = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":794
 *         nbytes = zran.zran_read(&index, buffer, filesize)
 * 
 *         assert nbytes                 == filesize             # <<<<<<<<<<<<<<
 *         assert zran.zran_tell(&index) == nbytes
 * 
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_4 = PyObject_RichCompare(__pyx_v_nbytes, __pyx_v_filesize, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L7_error)
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 794, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 794, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 794, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":795
 * 
 *         assert nbytes                 == filesize
 *         assert zran.zran_tell(&index) == nbytes             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index)
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_4 = __Pyx_PyLong_From_uint64_t(zran_tell((&__pyx_v_index))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_nbytes, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 795, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 795, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 795, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":797
 *         assert zran.zran_tell(&index) == nbytes
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *     nelemsp = int(nbytes / 8)
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":781
 *     buffer = buf.buffer
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 781, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_3 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 781, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (__pyx_t_6 < (0)) __PYX_ERR(0, 781, __pyx_L9_except_error)
          __pyx_t_18 = (!__pyx_t_6);
          if (unlikely(__pyx_t_18)) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_5);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_5);
            __pyx_t_1 = 0;  __pyx_t_4 = 0;  __pyx_t_5 = 0; 
            __PYX_ERR(0, 781, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_9) {
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 781, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":799
 *         zran.zran_free(&index)
 * 
 *     nelemsp = int(nbytes / 8)             # <<<<<<<<<<<<<<
 *     data    = np.PyArray_SimpleNewFromData(1, &nelemsp,  np.NPY_UINT64, buffer)
 * 
*/
  if (unlikely(!__pyx_v_nbytes)) { __Pyx_RaiseUnboundLocalError("nbytes"); __PYX_ERR(0, 799, __pyx_L1_error) }
  __pyx_t_5 = __Pyx_PyLong_TrueDivideObjC(__pyx_v_nbytes, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_19 = __Pyx_PyLong_As_npy_intp(__pyx_t_4); if (unlikely((__pyx_t_19 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_nelemsp = __pyx_t_19;

  /* "indexed_gzip/tests/ctest_zran.pyx":800
 * 
 *     nelemsp = int(nbytes / 8)
 *     data    = np.PyArray_SimpleNewFromData(1, &nelemsp,  np.NPY_UINT64, buffer)             # <<<<<<<<<<<<<<
 * 
 *     assert check_data_valid(data, 0)
*/
  __pyx_t_4 = PyArray_SimpleNewFromData(1, (&__pyx_v_nelemsp), NPY_UINT64, __pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_data = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":802
 *     data    = np.PyArray_SimpleNewFromData(1, &nelemsp,  np.NPY_UINT64, buffer)
 * 
 *     assert check_data_valid(data, 0)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_check_data_valid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __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_5 = PyMethod_GET_SELF(__pyx_t_1);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_data, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_18)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 802, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 802, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":769
 * 
 * 
 * def test_read_all(testfile, no_fds, nelems, use_mmap):             # <<<<<<<<<<<<<<
 * 
 *     filesize = nelems * 8
*/

  /* 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("indexed_gzip.tests.ctest_zran.test_read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_nbytes);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":805
 * 
 * 
 * def test_seek_then_read_block(testfile, no_fds, nelems, niters, seed, use_mmap):             # <<<<<<<<<<<<<<
 * 
 *     filesize  = nelems * 8
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_43test_seek_then_read_block(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_43test_seek_then_read_block = {"test_seek_then_read_block", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_43test_seek_then_read_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_43test_seek_then_read_block(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  PyObject *__pyx_v_niters = 0;
  CYTHON_UNUSED PyObject *__pyx_v_seed = 0;
  PyObject *__pyx_v_use_mmap = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_seek_then_read_block (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,&__pyx_mstate_global->__pyx_n_u_niters,&__pyx_mstate_global->__pyx_n_u_seed,&__pyx_mstate_global->__pyx_n_u_use_mmap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 805, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 805, __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, "test_seek_then_read_block", 0) < (0)) __PYX_ERR(0, 805, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_seek_then_read_block", 1, 6, 6, i); __PYX_ERR(0, 805, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 805, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 805, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 805, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 805, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 805, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 805, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
    __pyx_v_niters = values[3];
    __pyx_v_seed = values[4];
    __pyx_v_use_mmap = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_seek_then_read_block", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 805, __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("indexed_gzip.tests.ctest_zran.test_seek_then_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_42test_seek_then_read_block(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems, __pyx_v_niters, __pyx_v_seed, __pyx_v_use_mmap);

  /* 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_12indexed_gzip_5tests_10ctest_zran_42test_seek_then_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_niters, CYTHON_UNUSED PyObject *__pyx_v_seed, PyObject *__pyx_v_use_mmap) {
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_buf = NULL;
  PyObject *__pyx_v_seekelems = NULL;
  zran_index_t __pyx_v_index;
  void *__pyx_v_buffer;
  npy_intp __pyx_v_nelemsp;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  int __pyx_v_ret;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_se = NULL;
  PyObject *__pyx_v_readelems = NULL;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_nbytes = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  void *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16;
  uint32_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  PyObject *(*__pyx_t_19)(PyObject *);
  Py_ssize_t __pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  int64_t __pyx_t_22;
  uint64_t __pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  PyObject *__pyx_t_30 = NULL;
  npy_intp __pyx_t_31;
  int __pyx_t_32;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_seek_then_read_block", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":807
 * def test_seek_then_read_block(testfile, no_fds, nelems, niters, seed, use_mmap):
 * 
 *     filesize  = nelems * 8             # <<<<<<<<<<<<<<
 * 
 *     indexSpacing = max(524288, filesize // 1000)
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":809
 *     filesize  = nelems * 8
 * 
 *     indexSpacing = max(524288, filesize // 1000)             # <<<<<<<<<<<<<<
 *     buf          = ReadBuffer(filesize, use_mmap=use_mmap)
 *     seekelems    = np.random.randint(0, nelems - 1, niters, dtype=np.uint64)
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0x80000;
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":810
 * 
 *     indexSpacing = max(524288, filesize // 1000)
 *     buf          = ReadBuffer(filesize, use_mmap=use_mmap)             # <<<<<<<<<<<<<<
 *     seekelems    = np.random.randint(0, nelems - 1, niters, dtype=np.uint64)
 * 
*/
  __pyx_t_3 = NULL;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_v_filesize};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_mmap, __pyx_v_use_mmap, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 810, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":811
 *     indexSpacing = max(524288, filesize // 1000)
 *     buf          = ReadBuffer(filesize, use_mmap=use_mmap)
 *     seekelems    = np.random.randint(0, nelems - 1, niters, dtype=np.uint64)             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyLong_SubtractObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_0, __pyx_t_3, __pyx_v_niters};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_9, __pyx_t_8, __pyx_callargs+4, 0) < (0)) __PYX_ERR(0, 811, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_seekelems = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":814
 * 
 *     cdef zran.zran_index_t index
 *     cdef void             *buffer = buf.buffer             # <<<<<<<<<<<<<<
 *     cdef np.npy_intp       nelemsp
 * 
*/
  __pyx_t_10 = __pyx_v_buf->buffer;
  __pyx_v_buffer = __pyx_t_10;

  /* "indexed_gzip/tests/ctest_zran.pyx":817
 *     cdef np.npy_intp       nelemsp
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_4 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = NULL;
    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 817, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_9 = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":818
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         ret = zran.zran_init(&index,
*/
          __pyx_t_1 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 818, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_9); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_15, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":821
 * 
 *         ret = zran.zran_init(&index,
 *                              NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                              <PyObject*>pyfid if no_fds else NULL,
 *                              indexSpacing,
*/
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 821, __pyx_L7_error)
          if (__pyx_t_6) {
            __pyx_t_10 = NULL;
          } else {
            __pyx_t_10 = __pyx_v_cfid;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":822
 *         ret = zran.zran_init(&index,
 *                              NULL if no_fds else cfid,
 *                              <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                              indexSpacing,
 *                              32768,
*/
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 822, __pyx_L7_error)
          if (__pyx_t_6) {
            __pyx_t_16 = ((PyObject *)__pyx_v_pyfid);
          } else {
            __pyx_t_16 = NULL;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":823
 *                              NULL if no_fds else cfid,
 *                              <PyObject*>pyfid if no_fds else NULL,
 *                              indexSpacing,             # <<<<<<<<<<<<<<
 *                              32768,
 *                              131072,
*/
          __pyx_t_17 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_17 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L7_error)

          /* "indexed_gzip/tests/ctest_zran.pyx":820
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         ret = zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                              NULL if no_fds else cfid,
 *                              <PyObject*>pyfid if no_fds else NULL,
*/
          __pyx_v_ret = zran_init((&__pyx_v_index), __pyx_t_10, __pyx_t_16, __pyx_t_17, 0x8000, 0x20000, ZRAN_AUTO_BUILD);

          /* "indexed_gzip/tests/ctest_zran.pyx":827
 *                              131072,
 *                              zran.ZRAN_AUTO_BUILD)
 *         assert not ret, ret             # <<<<<<<<<<<<<<
 * 
 *         for i, se in enumerate(seekelems):
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (!(__pyx_v_ret != 0));
            if (unlikely(!__pyx_t_6)) {
              __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 827, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_1 = PyTuple_Pack(1, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_1, 0, 0);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __PYX_ERR(0, 827, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 827, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":829
 *         assert not ret, ret
 * 
 *         for i, se in enumerate(seekelems):             # <<<<<<<<<<<<<<
 * 
 * 
*/
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
          if (likely(PyList_CheckExact(__pyx_v_seekelems)) || PyTuple_CheckExact(__pyx_v_seekelems)) {
            __pyx_t_9 = __pyx_v_seekelems; __Pyx_INCREF(__pyx_t_9);
            __pyx_t_18 = 0;
            __pyx_t_19 = NULL;
          } else {
            __pyx_t_18 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_seekelems); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 829, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 829, __pyx_L7_error)
          }
          for (;;) {
            if (likely(!__pyx_t_19)) {
              if (likely(PyList_CheckExact(__pyx_t_9))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 829, __pyx_L7_error)
                  #endif
                  if (__pyx_t_18 >= __pyx_temp) break;
                }
                __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference);
                ++__pyx_t_18;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 829, __pyx_L7_error)
                  #endif
                  if (__pyx_t_18 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_18));
                #else
                __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_18);
                #endif
                ++__pyx_t_18;
              }
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 829, __pyx_L7_error)
            } else {
              __pyx_t_4 = __pyx_t_19(__pyx_t_9);
              if (unlikely(!__pyx_t_4)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 829, __pyx_L7_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_XDECREF_SET(__pyx_v_se, __pyx_t_4);
            __pyx_t_4 = 0;
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
            __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 829, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_1);
            __pyx_t_1 = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":832
 * 
 * 
 *             if se == nelems - 1:             # <<<<<<<<<<<<<<
 *                 readelems = 1
 *             else:
*/
            __pyx_t_4 = __Pyx_PyLong_SubtractObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_8 = PyObject_RichCompare(__pyx_v_se, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 832, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (__pyx_t_6) {

              /* "indexed_gzip/tests/ctest_zran.pyx":833
 * 
 *             if se == nelems - 1:
 *                 readelems = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 readelems = np.random.randint(1, nelems - se)
*/
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
              __Pyx_XDECREF_SET(__pyx_v_readelems, __pyx_mstate_global->__pyx_int_1);

              /* "indexed_gzip/tests/ctest_zran.pyx":832
 * 
 * 
 *             if se == nelems - 1:             # <<<<<<<<<<<<<<
 *                 readelems = 1
 *             else:
*/
              goto __pyx_L15;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":835
 *                 readelems = 1
 *             else:
 *                 readelems = np.random.randint(1, nelems - se)             # <<<<<<<<<<<<<<
 * 
 *             start = time.time()
*/
            /*else*/ {
              __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __pyx_t_4 = __pyx_t_5;
              __Pyx_INCREF(__pyx_t_4);
              __pyx_t_3 = PyNumber_Subtract(__pyx_v_nelems, __pyx_v_se); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_7 = 0;
              {
                PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_1, __pyx_t_3};
                __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 835, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_8);
              }
              __Pyx_XDECREF_SET(__pyx_v_readelems, __pyx_t_8);
              __pyx_t_8 = 0;
            }
            __pyx_L15:;

            /* "indexed_gzip/tests/ctest_zran.pyx":837
 *                 readelems = np.random.randint(1, nelems - se)
 * 
 *             start = time.time()             # <<<<<<<<<<<<<<
 * 
 *             print("{} / {}: reading {} elements from {} ... ".format(
*/
            __pyx_t_5 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_7 = 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_7 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
              __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__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_8)) __PYX_ERR(0, 837, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_8);
            }
            __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_8);
            __pyx_t_8 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":839
 *             start = time.time()
 * 
 *             print("{} / {}: reading {} elements from {} ... ".format(             # <<<<<<<<<<<<<<
 *                 i, len(seekelems), readelems, se), end='')
 * 
*/
            __pyx_t_4 = NULL;
            __pyx_t_3 = __pyx_mstate_global->__pyx_kp_u_reading_elements_from;
            __Pyx_INCREF(__pyx_t_3);

            /* "indexed_gzip/tests/ctest_zran.pyx":840
 * 
 *             print("{} / {}: reading {} elements from {} ... ".format(
 *                 i, len(seekelems), readelems, se), end='')             # <<<<<<<<<<<<<<
 * 
 *             assert zran.zran_seek(&index, se * 8, SEEK_SET, NULL) == zran.ZRAN_SEEK_OK
*/
            __pyx_t_20 = PyObject_Length(__pyx_v_seekelems); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(0, 840, __pyx_L7_error)
            __pyx_t_21 = PyLong_FromSsize_t(__pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 840, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_21);
            __pyx_t_7 = 0;
            {
              PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_i, __pyx_t_21, __pyx_v_readelems, __pyx_v_se};
              __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (5-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 839, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
            }
            __pyx_t_7 = 1;
            {
              PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
              __pyx_t_21 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 839, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_21);
              if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_kp_u__2, __pyx_t_21, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 839, __pyx_L7_error)
              __pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_21);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
              if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 839, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_8);
            }
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":842
 *                 i, len(seekelems), readelems, se), end='')
 * 
 *             assert zran.zran_seek(&index, se * 8, SEEK_SET, NULL) == zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 * 
 *             nbytes = zran.zran_read(&index, buffer, readelems * 8)
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_8 = __Pyx_PyLong_MultiplyObjC(__pyx_v_se, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 842, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_22 = __Pyx_PyLong_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_22 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_6 = (zran_seek((&__pyx_v_index), __pyx_t_22, SEEK_SET, NULL) == ZRAN_SEEK_OK);
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 842, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 842, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":844
 *             assert zran.zran_seek(&index, se * 8, SEEK_SET, NULL) == zran.ZRAN_SEEK_OK
 * 
 *             nbytes = zran.zran_read(&index, buffer, readelems * 8)             # <<<<<<<<<<<<<<
 * 
 *             try:
*/
            __pyx_t_8 = __Pyx_PyLong_MultiplyObjC(__pyx_v_readelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 844, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_23 = __Pyx_PyLong_As_uint64_t(__pyx_t_8); if (unlikely((__pyx_t_23 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_8 = __Pyx_PyLong_From_int64_t(zran_read((&__pyx_v_index), __pyx_v_buffer, __pyx_t_23)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 844, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_XDECREF_SET(__pyx_v_nbytes, __pyx_t_8);
            __pyx_t_8 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":846
 *             nbytes = zran.zran_read(&index, buffer, readelems * 8)
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert nbytes                 == readelems * 8
 *                 assert zran.zran_tell(&index) == (se + readelems) * 8
*/
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_26);
              /*try:*/ {

                /* "indexed_gzip/tests/ctest_zran.pyx":847
 * 
 *             try:
 *                 assert nbytes                 == readelems * 8             # <<<<<<<<<<<<<<
 *                 assert zran.zran_tell(&index) == (se + readelems) * 8
 *             except:
*/
                #ifndef CYTHON_WITHOUT_ASSERTIONS
                if (unlikely(__pyx_assertions_enabled())) {
                  __pyx_t_8 = __Pyx_PyLong_MultiplyObjC(__pyx_v_readelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 847, __pyx_L16_error)
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_21 = PyObject_RichCompare(__pyx_v_nbytes, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_21); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 847, __pyx_L16_error)
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_21); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 847, __pyx_L16_error)
                  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                  if (unlikely(!__pyx_t_6)) {
                    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                    __PYX_ERR(0, 847, __pyx_L16_error)
                  }
                }
                #else
                if ((1)); else __PYX_ERR(0, 847, __pyx_L16_error)
                #endif

                /* "indexed_gzip/tests/ctest_zran.pyx":848
 *             try:
 *                 assert nbytes                 == readelems * 8
 *                 assert zran.zran_tell(&index) == (se + readelems) * 8             # <<<<<<<<<<<<<<
 *             except:
 *                 print('seekelem:    {}'.format(se))
*/
                #ifndef CYTHON_WITHOUT_ASSERTIONS
                if (unlikely(__pyx_assertions_enabled())) {
                  __pyx_t_21 = __Pyx_PyLong_From_uint64_t(zran_tell((&__pyx_v_index))); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 848, __pyx_L16_error)
                  __Pyx_GOTREF(__pyx_t_21);
                  __pyx_t_8 = PyNumber_Add(__pyx_v_se, __pyx_v_readelems); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 848, __pyx_L16_error)
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_5 = __Pyx_PyLong_MultiplyObjC(__pyx_t_8, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L16_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = PyObject_RichCompare(__pyx_t_21, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 848, __pyx_L16_error)
                  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 848, __pyx_L16_error)
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  if (unlikely(!__pyx_t_6)) {
                    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                    __PYX_ERR(0, 848, __pyx_L16_error)
                  }
                }
                #else
                if ((1)); else __PYX_ERR(0, 848, __pyx_L16_error)
                #endif

                /* "indexed_gzip/tests/ctest_zran.pyx":846
 *             nbytes = zran.zran_read(&index, buffer, readelems * 8)
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert nbytes                 == readelems * 8
 *                 assert zran.zran_tell(&index) == (se + readelems) * 8
*/
              }
              __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
              __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
              __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
              goto __pyx_L23_try_end;
              __pyx_L16_error:;
              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":849
 *                 assert nbytes                 == readelems * 8
 *                 assert zran.zran_tell(&index) == (se + readelems) * 8
 *             except:             # <<<<<<<<<<<<<<
 *                 print('seekelem:    {}'.format(se))
 *                 print('readelems:   {}'.format(readelems))
*/
              /*except:*/ {
                __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seek_then_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_5, &__pyx_t_21) < 0) __PYX_ERR(0, 849, __pyx_L18_except_error)
                __Pyx_XGOTREF(__pyx_t_8);
                __Pyx_XGOTREF(__pyx_t_5);
                __Pyx_XGOTREF(__pyx_t_21);

                /* "indexed_gzip/tests/ctest_zran.pyx":850
 *                 assert zran.zran_tell(&index) == (se + readelems) * 8
 *             except:
 *                 print('seekelem:    {}'.format(se))             # <<<<<<<<<<<<<<
 *                 print('readelems:   {}'.format(readelems))
 *                 print('nbytes:      {}'.format(nbytes))
*/
                __pyx_t_3 = NULL;
                __pyx_t_28 = __pyx_mstate_global->__pyx_kp_u_seekelem;
                __Pyx_INCREF(__pyx_t_28);
                __pyx_t_7 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_28, __pyx_v_se};
                  __pyx_t_27 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
                  if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 850, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_27);
                }
                __pyx_t_7 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_27};
                  __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __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_27); __pyx_t_27 = 0;
                  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_4);
                }
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":851
 *             except:
 *                 print('seekelem:    {}'.format(se))
 *                 print('readelems:   {}'.format(readelems))             # <<<<<<<<<<<<<<
 *                 print('nbytes:      {}'.format(nbytes))
 *                 print('  should be: {}'.format(readelems * 8))
*/
                __pyx_t_27 = NULL;
                __pyx_t_28 = __pyx_mstate_global->__pyx_kp_u_readelems;
                __Pyx_INCREF(__pyx_t_28);
                __pyx_t_7 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_28, __pyx_v_readelems};
                  __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                }
                __pyx_t_7 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_27, __pyx_t_3};
                  __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_4);
                }
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":852
 *                 print('seekelem:    {}'.format(se))
 *                 print('readelems:   {}'.format(readelems))
 *                 print('nbytes:      {}'.format(nbytes))             # <<<<<<<<<<<<<<
 *                 print('  should be: {}'.format(readelems * 8))
 *                 print('ftell:       {}'.format(zran.zran_tell(&index)))
*/
                __pyx_t_3 = NULL;
                __pyx_t_28 = __pyx_mstate_global->__pyx_kp_u_nbytes;
                __Pyx_INCREF(__pyx_t_28);
                __pyx_t_7 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_28, __pyx_v_nbytes};
                  __pyx_t_27 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
                  if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 852, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_27);
                }
                __pyx_t_7 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_27};
                  __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __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_27); __pyx_t_27 = 0;
                  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_4);
                }
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":853
 *                 print('readelems:   {}'.format(readelems))
 *                 print('nbytes:      {}'.format(nbytes))
 *                 print('  should be: {}'.format(readelems * 8))             # <<<<<<<<<<<<<<
 *                 print('ftell:       {}'.format(zran.zran_tell(&index)))
 *                 print('  should be: {}'.format((se + readelems) * 8))
*/
                __pyx_t_27 = NULL;
                __pyx_t_28 = __pyx_mstate_global->__pyx_kp_u_should_be;
                __Pyx_INCREF(__pyx_t_28);
                __pyx_t_29 = __Pyx_PyLong_MultiplyObjC(__pyx_v_readelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 853, __pyx_L18_except_error)
                __Pyx_GOTREF(__pyx_t_29);
                __pyx_t_7 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_28, __pyx_t_29};
                  __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
                  __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                }
                __pyx_t_7 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_27, __pyx_t_3};
                  __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_4);
                }
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":854
 *                 print('nbytes:      {}'.format(nbytes))
 *                 print('  should be: {}'.format(readelems * 8))
 *                 print('ftell:       {}'.format(zran.zran_tell(&index)))             # <<<<<<<<<<<<<<
 *                 print('  should be: {}'.format((se + readelems) * 8))
 *                 raise
*/
                __pyx_t_3 = NULL;
                __pyx_t_29 = __pyx_mstate_global->__pyx_kp_u_ftell;
                __Pyx_INCREF(__pyx_t_29);
                __pyx_t_28 = __Pyx_PyLong_From_uint64_t(zran_tell((&__pyx_v_index))); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 854, __pyx_L18_except_error)
                __Pyx_GOTREF(__pyx_t_28);
                __pyx_t_7 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_29, __pyx_t_28};
                  __pyx_t_27 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
                  __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
                  if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 854, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_27);
                }
                __pyx_t_7 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_27};
                  __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __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_27); __pyx_t_27 = 0;
                  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_4);
                }
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":855
 *                 print('  should be: {}'.format(readelems * 8))
 *                 print('ftell:       {}'.format(zran.zran_tell(&index)))
 *                 print('  should be: {}'.format((se + readelems) * 8))             # <<<<<<<<<<<<<<
 *                 raise
 * 
*/
                __pyx_t_27 = NULL;
                __pyx_t_28 = __pyx_mstate_global->__pyx_kp_u_should_be;
                __Pyx_INCREF(__pyx_t_28);
                __pyx_t_29 = PyNumber_Add(__pyx_v_se, __pyx_v_readelems); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 855, __pyx_L18_except_error)
                __Pyx_GOTREF(__pyx_t_29);
                __pyx_t_30 = __Pyx_PyLong_MultiplyObjC(__pyx_t_29, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 855, __pyx_L18_except_error)
                __Pyx_GOTREF(__pyx_t_30);
                __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
                __pyx_t_7 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_28, __pyx_t_30};
                  __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
                  __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                }
                __pyx_t_7 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_27, __pyx_t_3};
                  __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_4);
                }
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":856
 *                 print('ftell:       {}'.format(zran.zran_tell(&index)))
 *                 print('  should be: {}'.format((se + readelems) * 8))
 *                 raise             # <<<<<<<<<<<<<<
 * 
 *             nelemsp = int(nbytes / 8)
*/
                __Pyx_GIVEREF(__pyx_t_8);
                __Pyx_GIVEREF(__pyx_t_5);
                __Pyx_XGIVEREF(__pyx_t_21);
                __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_5, __pyx_t_21);
                __pyx_t_8 = 0;  __pyx_t_5 = 0;  __pyx_t_21 = 0; 
                __PYX_ERR(0, 856, __pyx_L18_except_error)
              }

              /* "indexed_gzip/tests/ctest_zran.pyx":846
 *             nbytes = zran.zran_read(&index, buffer, readelems * 8)
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert nbytes                 == readelems * 8
 *                 assert zran.zran_tell(&index) == (se + readelems) * 8
*/
              __pyx_L18_except_error:;
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_25);
              __Pyx_XGIVEREF(__pyx_t_26);
              __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
              goto __pyx_L7_error;
              __pyx_L23_try_end:;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":858
 *                 raise
 * 
 *             nelemsp = int(nbytes / 8)             # <<<<<<<<<<<<<<
 *             data    = np.PyArray_SimpleNewFromData(1, &nelemsp,  np.NPY_UINT64, buffer)
 * 
*/
            __pyx_t_21 = __Pyx_PyLong_TrueDivideObjC(__pyx_v_nbytes, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 858, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_21);
            __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_21); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 858, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
            __pyx_t_31 = __Pyx_PyLong_As_npy_intp(__pyx_t_5); if (unlikely((__pyx_t_31 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_v_nelemsp = __pyx_t_31;

            /* "indexed_gzip/tests/ctest_zran.pyx":859
 * 
 *             nelemsp = int(nbytes / 8)
 *             data    = np.PyArray_SimpleNewFromData(1, &nelemsp,  np.NPY_UINT64, buffer)             # <<<<<<<<<<<<<<
 * 
 *             assert check_data_valid(data, se, se + readelems)
*/
            __pyx_t_5 = PyArray_SimpleNewFromData(1, (&__pyx_v_nelemsp), NPY_UINT64, __pyx_v_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_5);
            __pyx_t_5 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":861
 *             data    = np.PyArray_SimpleNewFromData(1, &nelemsp,  np.NPY_UINT64, buffer)
 * 
 *             assert check_data_valid(data, se, se + readelems)             # <<<<<<<<<<<<<<
 * 
 *             end = time.time()
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_21 = NULL;
              __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_check_data_valid); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 861, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_4 = PyNumber_Add(__pyx_v_se, __pyx_v_readelems); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_7 = 1;
              #if CYTHON_UNPACK_METHODS
              if (unlikely(PyMethod_Check(__pyx_t_8))) {
                __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_8);
                assert(__pyx_t_21);
                PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
                __Pyx_INCREF(__pyx_t_21);
                __Pyx_INCREF(__pyx__function);
                __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
                __pyx_t_7 = 0;
              }
              #endif
              {
                PyObject *__pyx_callargs[4] = {__pyx_t_21, __pyx_v_data, __pyx_v_se, __pyx_t_4};
                __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_5);
              }
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 861, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 861, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 861, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":863
 *             assert check_data_valid(data, se, se + readelems)
 * 
 *             end = time.time()             # <<<<<<<<<<<<<<
 * 
 *             print("{:0.2f} seconds".format(end - start))
*/
            __pyx_t_8 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 863, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_21);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_7 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_21))) {
              __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_21);
              assert(__pyx_t_8);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_21);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_21, __pyx__function);
              __pyx_t_7 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
              __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_21, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
            }
            __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_5);
            __pyx_t_5 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":865
 *             end = time.time()
 * 
 *             print("{:0.2f} seconds".format(end - start))             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index)
*/
            __pyx_t_21 = NULL;
            __pyx_t_4 = __pyx_mstate_global->__pyx_kp_u_0_2f_seconds;
            __Pyx_INCREF(__pyx_t_4);
            __pyx_t_3 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_7 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
              __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 865, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_8);
            }
            __pyx_t_7 = 1;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_t_8};
              __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":829
 *         assert not ret, ret
 * 
 *         for i, se in enumerate(seekelems):             # <<<<<<<<<<<<<<
 * 
 * 
*/
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":867
 *             print("{:0.2f} seconds".format(end - start))
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":817
 *     cdef np.npy_intp       nelemsp
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
        __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
        __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seek_then_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_5) < 0) __PYX_ERR(0, 817, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_8 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 817, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_8, NULL);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 817, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_26);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_26);
          __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
          if (__pyx_t_6 < (0)) __PYX_ERR(0, 817, __pyx_L9_except_error)
          __pyx_t_32 = (!__pyx_t_6);
          if (unlikely(__pyx_t_32)) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_5);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_9, __pyx_t_5);
            __pyx_t_1 = 0;  __pyx_t_9 = 0;  __pyx_t_5 = 0; 
            __PYX_ERR(0, 817, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_11) {
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 817, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L30;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L1_error;
    __pyx_L30:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":805
 * 
 * 
 * def test_seek_then_read_block(testfile, no_fds, nelems, niters, seed, use_mmap):             # <<<<<<<<<<<<<<
 * 
 *     filesize  = nelems * 8
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_27);
  __Pyx_XDECREF(__pyx_t_28);
  __Pyx_XDECREF(__pyx_t_29);
  __Pyx_XDECREF(__pyx_t_30);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_seek_then_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_seekelems);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_se);
  __Pyx_XDECREF(__pyx_v_readelems);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_nbytes);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":870
 * 
 * 
 * def test_random_seek_and_read(testfile, no_fds, nelems, niters, seed):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_45test_random_seek_and_read(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_45test_random_seek_and_read = {"test_random_seek_and_read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_45test_random_seek_and_read, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_45test_random_seek_and_read(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  PyObject *__pyx_v_niters = 0;
  CYTHON_UNUSED PyObject *__pyx_v_seed = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_random_seek_and_read (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,&__pyx_mstate_global->__pyx_n_u_niters,&__pyx_mstate_global->__pyx_n_u_seed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 870, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 870, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 870, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 870, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 870, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 870, __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, "test_random_seek_and_read", 0) < (0)) __PYX_ERR(0, 870, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_random_seek_and_read", 1, 5, 5, i); __PYX_ERR(0, 870, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 870, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 870, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 870, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 870, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 870, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
    __pyx_v_niters = values[3];
    __pyx_v_seed = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_random_seek_and_read", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 870, __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("indexed_gzip.tests.ctest_zran.test_random_seek_and_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_44test_random_seek_and_read(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems, __pyx_v_niters, __pyx_v_seed);

  /* 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_12indexed_gzip_5tests_10ctest_zran_44test_random_seek_and_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_niters, CYTHON_UNUSED PyObject *__pyx_v_seed) {
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_seekelems = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_se = NULL;
  PyObject *__pyx_v_expval = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  long __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  void *__pyx_t_13;
  PyObject *__pyx_t_14;
  uint32_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  struct __pyx_opt_args_12indexed_gzip_5tests_10ctest_zran_read_element __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  int __pyx_t_26;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_random_seek_and_read", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":874
 *     cdef zran.zran_index_t index
 * 
 *     filesize = nelems * 8             # <<<<<<<<<<<<<<
 * 
 *     seekelems    = np.random.randint(0, nelems, niters)
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":876
 *     filesize = nelems * 8
 * 
 *     seekelems    = np.random.randint(0, nelems, niters)             # <<<<<<<<<<<<<<
 *     indexSpacing = max(524288, filesize // 1000)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0, __pyx_v_nelems, __pyx_v_niters};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_seekelems = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":877
 * 
 *     seekelems    = np.random.randint(0, nelems, niters)
 *     indexSpacing = max(524288, filesize // 1000)             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = 0x80000;
  __pyx_t_2 = __Pyx_PyLong_From_long(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 877, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":879
 *     indexSpacing = max(524288, filesize // 1000)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = NULL;
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __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_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":880
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_1 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_12, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":882
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":883
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 883, __pyx_L7_error)
            if (__pyx_t_7) {
              __pyx_t_13 = NULL;
            } else {
              __pyx_t_13 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":884
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 884, __pyx_L7_error)
            if (__pyx_t_7) {
              __pyx_t_14 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_14 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":885
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_15 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L7_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":882
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_7 = (!(zran_init((&__pyx_v_index), __pyx_t_13, __pyx_t_14, __pyx_t_15, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
            if (unlikely(!__pyx_t_7)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 882, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 882, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":890
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         for se in seekelems:             # <<<<<<<<<<<<<<
 * 
 *             # Should never happen
*/
          if (likely(PyList_CheckExact(__pyx_v_seekelems)) || PyTuple_CheckExact(__pyx_v_seekelems)) {
            __pyx_t_2 = __pyx_v_seekelems; __Pyx_INCREF(__pyx_t_2);
            __pyx_t_16 = 0;
            __pyx_t_17 = NULL;
          } else {
            __pyx_t_16 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_seekelems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 890, __pyx_L7_error)
          }
          for (;;) {
            if (likely(!__pyx_t_17)) {
              if (likely(PyList_CheckExact(__pyx_t_2))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 890, __pyx_L7_error)
                  #endif
                  if (__pyx_t_16 >= __pyx_temp) break;
                }
                __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference);
                ++__pyx_t_16;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 890, __pyx_L7_error)
                  #endif
                  if (__pyx_t_16 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_16));
                #else
                __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_16);
                #endif
                ++__pyx_t_16;
              }
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L7_error)
            } else {
              __pyx_t_1 = __pyx_t_17(__pyx_t_2);
              if (unlikely(!__pyx_t_1)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 890, __pyx_L7_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_se, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":893
 * 
 *             # Should never happen
 *             if se >= nelems: expval = None             # <<<<<<<<<<<<<<
 *             else:            expval = se
 * 
*/
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_se, __pyx_v_nelems, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L7_error)
            __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 893, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_7) {
              __Pyx_INCREF(Py_None);
              __Pyx_XDECREF_SET(__pyx_v_expval, Py_None);
              goto __pyx_L15;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":894
 *             # Should never happen
 *             if se >= nelems: expval = None
 *             else:            expval = se             # <<<<<<<<<<<<<<
 * 
 *             val = read_element(&index, se, nelems, True)
*/
            /*else*/ {
              __Pyx_INCREF(__pyx_v_se);
              __Pyx_XDECREF_SET(__pyx_v_expval, __pyx_v_se);
            }
            __pyx_L15:;

            /* "indexed_gzip/tests/ctest_zran.pyx":896
 *             else:            expval = se
 * 
 *             val = read_element(&index, se, nelems, True)             # <<<<<<<<<<<<<<
 * 
 *             try:
*/
            __pyx_t_18.__pyx_n = 1;
            __pyx_t_18.seek = Py_True;
            __pyx_t_1 = __pyx_f_12indexed_gzip_5tests_10ctest_zran_read_element((&__pyx_v_index), __pyx_v_se, __pyx_v_nelems, &__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":898
 *             val = read_element(&index, se, nelems, True)
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert val == expval
 *             except:
*/
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_19);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_21);
              /*try:*/ {

                /* "indexed_gzip/tests/ctest_zran.pyx":899
 * 
 *             try:
 *                 assert val == expval             # <<<<<<<<<<<<<<
 *             except:
 *                 print("{} != {}".format(val, se))
*/
                #ifndef CYTHON_WITHOUT_ASSERTIONS
                if (unlikely(__pyx_assertions_enabled())) {
                  __pyx_t_1 = PyObject_RichCompare(__pyx_v_val, __pyx_v_expval, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L16_error)
                  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 899, __pyx_L16_error)
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  if (unlikely(!__pyx_t_7)) {
                    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                    __PYX_ERR(0, 899, __pyx_L16_error)
                  }
                }
                #else
                if ((1)); else __PYX_ERR(0, 899, __pyx_L16_error)
                #endif

                /* "indexed_gzip/tests/ctest_zran.pyx":898
 *             val = read_element(&index, se, nelems, True)
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert val == expval
 *             except:
*/
              }
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
              goto __pyx_L23_try_end;
              __pyx_L16_error:;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":900
 *             try:
 *                 assert val == expval
 *             except:             # <<<<<<<<<<<<<<
 *                 print("{} != {}".format(val, se))
 *                 raise
*/
              /*except:*/ {
                __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_random_seek_and_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 900, __pyx_L18_except_error)
                __Pyx_XGOTREF(__pyx_t_1);
                __Pyx_XGOTREF(__pyx_t_4);
                __Pyx_XGOTREF(__pyx_t_3);

                /* "indexed_gzip/tests/ctest_zran.pyx":901
 *                 assert val == expval
 *             except:
 *                 print("{} != {}".format(val, se))             # <<<<<<<<<<<<<<
 *                 raise
 * 
*/
                __pyx_t_23 = NULL;
                __pyx_t_25 = __pyx_mstate_global->__pyx_kp_u_;
                __Pyx_INCREF(__pyx_t_25);
                __pyx_t_5 = 0;
                {
                  PyObject *__pyx_callargs[3] = {__pyx_t_25, __pyx_v_val, __pyx_v_se};
                  __pyx_t_24 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
                  if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 901, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_24);
                }
                __pyx_t_5 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_t_24};
                  __pyx_t_22 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
                  __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                  if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 901, __pyx_L18_except_error)
                  __Pyx_GOTREF(__pyx_t_22);
                }
                __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":902
 *             except:
 *                 print("{} != {}".format(val, se))
 *                 raise             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index)
*/
                __Pyx_GIVEREF(__pyx_t_1);
                __Pyx_GIVEREF(__pyx_t_4);
                __Pyx_XGIVEREF(__pyx_t_3);
                __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_3);
                __pyx_t_1 = 0;  __pyx_t_4 = 0;  __pyx_t_3 = 0; 
                __PYX_ERR(0, 902, __pyx_L18_except_error)
              }

              /* "indexed_gzip/tests/ctest_zran.pyx":898
 *             val = read_element(&index, se, nelems, True)
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 assert val == expval
 *             except:
*/
              __pyx_L18_except_error:;
              __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);
              goto __pyx_L7_error;
              __pyx_L23_try_end:;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":890
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         for se in seekelems:             # <<<<<<<<<<<<<<
 * 
 *             # Should never happen
*/
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":904
 *                 raise
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":879
 *     indexSpacing = max(524288, filesize // 1000)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
        __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
        __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
        __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_random_seek_and_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 879, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 879, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_21);
          __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_21);
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          if (__pyx_t_7 < (0)) __PYX_ERR(0, 879, __pyx_L9_except_error)
          __pyx_t_26 = (!__pyx_t_7);
          if (unlikely(__pyx_t_26)) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_4);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_4);
            __pyx_t_2 = 0;  __pyx_t_3 = 0;  __pyx_t_4 = 0; 
            __PYX_ERR(0, 879, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_8) {
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 879, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L30;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L1_error;
    __pyx_L30:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":870
 * 
 * 
 * def test_random_seek_and_read(testfile, no_fds, nelems, niters, seed):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_XDECREF(__pyx_t_25);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_random_seek_and_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_seekelems);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_se);
  __Pyx_XDECREF(__pyx_v_expval);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":907
 * 
 * 
 * def test_read_all_sequential(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_47test_read_all_sequential(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_47test_read_all_sequential = {"test_read_all_sequential", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_47test_read_all_sequential, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_47test_read_all_sequential(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_read_all_sequential (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 907, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 907, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 907, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 907, __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, "test_read_all_sequential", 0) < (0)) __PYX_ERR(0, 907, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_read_all_sequential", 1, 3, 3, i); __PYX_ERR(0, 907, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 907, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 907, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 907, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_read_all_sequential", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 907, __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("indexed_gzip.tests.ctest_zran.test_read_all_sequential", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_46test_read_all_sequential(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems);

  /* 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_12indexed_gzip_5tests_10ctest_zran_46test_read_all_sequential(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems) {
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  PyObject *__pyx_v_seekelems = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_se = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __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;
  void *__pyx_t_15;
  PyObject *__pyx_t_16;
  uint32_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  PyObject *(*__pyx_t_19)(PyObject *);
  struct __pyx_opt_args_12indexed_gzip_5tests_10ctest_zran_read_element __pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  int __pyx_t_26;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_read_all_sequential", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":911
 *     cdef zran.zran_index_t index
 * 
 *     filesize = nelems * 8             # <<<<<<<<<<<<<<
 * 
 *     indexSpacing = max(524288, filesize // 1000)
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":913
 *     filesize = nelems * 8
 * 
 *     indexSpacing = max(524288, filesize // 1000)             # <<<<<<<<<<<<<<
 * 
 *     # Takes too long to read all elements
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0x80000;
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":916
 * 
 *     # Takes too long to read all elements
 *     seekelems = np.random.randint(0, nelems - 1, 10000, dtype=np.uint64)             # <<<<<<<<<<<<<<
 *     seekelems = np.sort(seekelems)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_0, __pyx_t_5, __pyx_mstate_global->__pyx_int_10000};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_7, __pyx_callargs+4, 0) < (0)) __PYX_ERR(0, 916, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_seekelems = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":917
 *     # Takes too long to read all elements
 *     seekelems = np.random.randint(0, nelems - 1, 10000, dtype=np.uint64)
 *     seekelems = np.sort(seekelems)             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sort); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_seekelems};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_seekelems, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":919
 *     seekelems = np.sort(seekelems)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_8 = NULL;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = NULL;
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 919, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 919, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_7 = __pyx_t_8;
    __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":920
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_1 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_9 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 920, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_7); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_14, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":922
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":923
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 923, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_15 = NULL;
            } else {
              __pyx_t_15 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":924
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 924, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_16 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_16 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":925
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_17 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_17 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 925, __pyx_L7_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":922
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_6 = (!(zran_init((&__pyx_v_index), __pyx_t_15, __pyx_t_16, __pyx_t_17, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 922, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 922, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":930
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         for se in seekelems:             # <<<<<<<<<<<<<<
 * 
 *             val = read_element(&index, se, nelems, True)
*/
          if (likely(PyList_CheckExact(__pyx_v_seekelems)) || PyTuple_CheckExact(__pyx_v_seekelems)) {
            __pyx_t_7 = __pyx_v_seekelems; __Pyx_INCREF(__pyx_t_7);
            __pyx_t_18 = 0;
            __pyx_t_19 = NULL;
          } else {
            __pyx_t_18 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_seekelems); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 930, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 930, __pyx_L7_error)
          }
          for (;;) {
            if (likely(!__pyx_t_19)) {
              if (likely(PyList_CheckExact(__pyx_t_7))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 930, __pyx_L7_error)
                  #endif
                  if (__pyx_t_18 >= __pyx_temp) break;
                }
                __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference);
                ++__pyx_t_18;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 930, __pyx_L7_error)
                  #endif
                  if (__pyx_t_18 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_18));
                #else
                __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_18);
                #endif
                ++__pyx_t_18;
              }
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L7_error)
            } else {
              __pyx_t_1 = __pyx_t_19(__pyx_t_7);
              if (unlikely(!__pyx_t_1)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 930, __pyx_L7_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_se, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":932
 *         for se in seekelems:
 * 
 *             val = read_element(&index, se, nelems, True)             # <<<<<<<<<<<<<<
 *             try:
 *                 assert val == se
*/
            __pyx_t_20.__pyx_n = 1;
            __pyx_t_20.seek = Py_True;
            __pyx_t_1 = __pyx_f_12indexed_gzip_5tests_10ctest_zran_read_element((&__pyx_v_index), __pyx_v_se, __pyx_v_nelems, &__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":933
 * 
 *             val = read_element(&index, se, nelems, True)
 *             try:             # <<<<<<<<<<<<<<
 *                 assert val == se
 *             except:
*/
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_23);
              /*try:*/ {

                /* "indexed_gzip/tests/ctest_zran.pyx":934
 *             val = read_element(&index, se, nelems, True)
 *             try:
 *                 assert val == se             # <<<<<<<<<<<<<<
 *             except:
 *                 print("{} != {}".format(val, se))
*/
                #ifndef CYTHON_WITHOUT_ASSERTIONS
                if (unlikely(__pyx_assertions_enabled())) {
                  __pyx_t_1 = PyObject_RichCompare(__pyx_v_val, __pyx_v_se, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L15_error)
                  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 934, __pyx_L15_error)
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  if (unlikely(!__pyx_t_6)) {
                    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                    __PYX_ERR(0, 934, __pyx_L15_error)
                  }
                }
                #else
                if ((1)); else __PYX_ERR(0, 934, __pyx_L15_error)
                #endif

                /* "indexed_gzip/tests/ctest_zran.pyx":933
 * 
 *             val = read_element(&index, se, nelems, True)
 *             try:             # <<<<<<<<<<<<<<
 *                 assert val == se
 *             except:
*/
              }
              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
              __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
              __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
              goto __pyx_L22_try_end;
              __pyx_L15_error:;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":935
 *             try:
 *                 assert val == se
 *             except:             # <<<<<<<<<<<<<<
 *                 print("{} != {}".format(val, se))
 *                 print("{:x} != {:x}".format(val, se))
*/
              /*except:*/ {
                __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_read_all_sequential", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_4) < 0) __PYX_ERR(0, 935, __pyx_L17_except_error)
                __Pyx_XGOTREF(__pyx_t_1);
                __Pyx_XGOTREF(__pyx_t_8);
                __Pyx_XGOTREF(__pyx_t_4);

                /* "indexed_gzip/tests/ctest_zran.pyx":936
 *                 assert val == se
 *             except:
 *                 print("{} != {}".format(val, se))             # <<<<<<<<<<<<<<
 *                 print("{:x} != {:x}".format(val, se))
 *                 raise
*/
                __pyx_t_3 = NULL;
                __pyx_t_25 = __pyx_mstate_global->__pyx_kp_u_;
                __Pyx_INCREF(__pyx_t_25);
                __pyx_t_9 = 0;
                {
                  PyObject *__pyx_callargs[3] = {__pyx_t_25, __pyx_v_val, __pyx_v_se};
                  __pyx_t_24 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
                  if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 936, __pyx_L17_except_error)
                  __Pyx_GOTREF(__pyx_t_24);
                }
                __pyx_t_9 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_24};
                  __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 936, __pyx_L17_except_error)
                  __Pyx_GOTREF(__pyx_t_5);
                }
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":937
 *             except:
 *                 print("{} != {}".format(val, se))
 *                 print("{:x} != {:x}".format(val, se))             # <<<<<<<<<<<<<<
 *                 raise
 * 
*/
                __pyx_t_24 = NULL;
                __pyx_t_25 = __pyx_mstate_global->__pyx_kp_u_x_x;
                __Pyx_INCREF(__pyx_t_25);
                __pyx_t_9 = 0;
                {
                  PyObject *__pyx_callargs[3] = {__pyx_t_25, __pyx_v_val, __pyx_v_se};
                  __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L17_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                }
                __pyx_t_9 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_24, __pyx_t_3};
                  __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 937, __pyx_L17_except_error)
                  __Pyx_GOTREF(__pyx_t_5);
                }
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":938
 *                 print("{} != {}".format(val, se))
 *                 print("{:x} != {:x}".format(val, se))
 *                 raise             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index)
*/
                __Pyx_GIVEREF(__pyx_t_1);
                __Pyx_GIVEREF(__pyx_t_8);
                __Pyx_XGIVEREF(__pyx_t_4);
                __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_8, __pyx_t_4);
                __pyx_t_1 = 0;  __pyx_t_8 = 0;  __pyx_t_4 = 0; 
                __PYX_ERR(0, 938, __pyx_L17_except_error)
              }

              /* "indexed_gzip/tests/ctest_zran.pyx":933
 * 
 *             val = read_element(&index, se, nelems, True)
 *             try:             # <<<<<<<<<<<<<<
 *                 assert val == se
 *             except:
*/
              __pyx_L17_except_error:;
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
              goto __pyx_L7_error;
              __pyx_L22_try_end:;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":930
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         for se in seekelems:             # <<<<<<<<<<<<<<
 * 
 *             val = read_element(&index, se, nelems, True)
*/
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":940
 *                 raise
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":919
 *     seekelems = np.sort(seekelems)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
        __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_read_all_sequential", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(0, 919, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_8);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 919, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_23);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_23);
          __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
          if (__pyx_t_6 < (0)) __PYX_ERR(0, 919, __pyx_L9_except_error)
          __pyx_t_26 = (!__pyx_t_6);
          if (unlikely(__pyx_t_26)) {
            __Pyx_GIVEREF(__pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_4, __pyx_t_8);
            __pyx_t_7 = 0;  __pyx_t_4 = 0;  __pyx_t_8 = 0; 
            __PYX_ERR(0, 919, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_10) {
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 919, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L29;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L1_error;
    __pyx_L29:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":907
 * 
 * 
 * def test_read_all_sequential(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_XDECREF(__pyx_t_25);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_read_all_sequential", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF(__pyx_v_seekelems);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_se);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":943
 * 
 * 
 * def test_build_then_read(testfile, no_fds, nelems, seed, use_mmap):             # <<<<<<<<<<<<<<
 * 
 *     filesize = nelems * 8
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_49test_build_then_read(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_49test_build_then_read = {"test_build_then_read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_49test_build_then_read, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_49test_build_then_read(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  CYTHON_UNUSED PyObject *__pyx_v_seed = 0;
  PyObject *__pyx_v_use_mmap = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_build_then_read (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,&__pyx_mstate_global->__pyx_n_u_seed,&__pyx_mstate_global->__pyx_n_u_use_mmap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 943, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 943, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 943, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 943, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 943, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 943, __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, "test_build_then_read", 0) < (0)) __PYX_ERR(0, 943, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_build_then_read", 1, 5, 5, i); __PYX_ERR(0, 943, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 943, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 943, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 943, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 943, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 943, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
    __pyx_v_seed = values[3];
    __pyx_v_use_mmap = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_build_then_read", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 943, __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("indexed_gzip.tests.ctest_zran.test_build_then_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_48test_build_then_read(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems, __pyx_v_seed, __pyx_v_use_mmap);

  /* 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_12indexed_gzip_5tests_10ctest_zran_48test_build_then_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, CYTHON_UNUSED PyObject *__pyx_v_seed, PyObject *__pyx_v_use_mmap) {
  PyObject *__pyx_v_filesize = NULL;
  PyObject *__pyx_v_indexSpacing = NULL;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_buf = NULL;
  PyObject *__pyx_v_seekelems = NULL;
  zran_index_t __pyx_v_index;
  void *__pyx_v_buffer;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_se = NULL;
  PyObject *__pyx_v_readelems = NULL;
  PyObject *__pyx_v_nbytes = NULL;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  void *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16;
  uint32_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  PyObject *(*__pyx_t_19)(PyObject *);
  int64_t __pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  uint64_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  PyObject *(*__pyx_t_26)(PyObject *);
  PyObject *__pyx_t_27 = NULL;
  int __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_build_then_read", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":945
 * def test_build_then_read(testfile, no_fds, nelems, seed, use_mmap):
 * 
 *     filesize = nelems * 8             # <<<<<<<<<<<<<<
 * 
 *     indexSpacing = max(524288, filesize // 1000)
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filesize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":947
 *     filesize = nelems * 8
 * 
 *     indexSpacing = max(524288, filesize // 1000)             # <<<<<<<<<<<<<<
 *     buf          = ReadBuffer(filesize, use_mmap)
 *     seekelems    = np.random.randint(0, nelems - 1, 5000, dtype=np.uint64)
*/
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_filesize, __pyx_mstate_global->__pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0x80000;
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_indexSpacing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":948
 * 
 *     indexSpacing = max(524288, filesize // 1000)
 *     buf          = ReadBuffer(filesize, use_mmap)             # <<<<<<<<<<<<<<
 *     seekelems    = np.random.randint(0, nelems - 1, 5000, dtype=np.uint64)
 * 
*/
  __pyx_t_3 = NULL;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_filesize, __pyx_v_use_mmap};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":949
 *     indexSpacing = max(524288, filesize // 1000)
 *     buf          = ReadBuffer(filesize, use_mmap)
 *     seekelems    = np.random.randint(0, nelems - 1, 5000, dtype=np.uint64)             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_0, __pyx_t_5, __pyx_mstate_global->__pyx_int_5000};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_9, __pyx_t_8, __pyx_callargs+4, 0) < (0)) __PYX_ERR(0, 949, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_seekelems = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":952
 * 
 *     cdef zran.zran_index_t index
 *     cdef void             *buffer = buf.buffer             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __pyx_t_10 = __pyx_v_buf->buffer;
  __pyx_v_buffer = __pyx_t_10;

  /* "indexed_gzip/tests/ctest_zran.pyx":954
 *     cdef void             *buffer = buf.buffer
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_4 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 954, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = NULL;
    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 954, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_9 = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":955
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index,
*/
          __pyx_t_1 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 955, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_9); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_15, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":957
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":958
 * 
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 958, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_10 = NULL;
            } else {
              __pyx_t_10 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":959
 *         assert not zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   32768,
*/
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 959, __pyx_L7_error)
            if (__pyx_t_6) {
              __pyx_t_16 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_16 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":960
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,             # <<<<<<<<<<<<<<
 *                                   32768,
 *                                   131072,
*/
            __pyx_t_17 = __Pyx_PyLong_As_uint32_t(__pyx_v_indexSpacing); if (unlikely((__pyx_t_17 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 960, __pyx_L7_error)

            /* "indexed_gzip/tests/ctest_zran.pyx":957
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_6 = (!(zran_init((&__pyx_v_index), __pyx_t_10, __pyx_t_16, __pyx_t_17, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 957, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 957, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":965
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *         assert not zran.zran_build_index(&index, 0, 0)             # <<<<<<<<<<<<<<
 * 
 *         for se in seekelems:
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_6 = (!(zran_build_index((&__pyx_v_index), 0, 0) != 0));
            if (unlikely(!__pyx_t_6)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 965, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 965, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":967
 *         assert not zran.zran_build_index(&index, 0, 0)
 * 
 *         for se in seekelems:             # <<<<<<<<<<<<<<
 * 
 *             assert zran.zran_seek(&index, se * 8, SEEK_SET, NULL) == 0
*/
          if (likely(PyList_CheckExact(__pyx_v_seekelems)) || PyTuple_CheckExact(__pyx_v_seekelems)) {
            __pyx_t_9 = __pyx_v_seekelems; __Pyx_INCREF(__pyx_t_9);
            __pyx_t_18 = 0;
            __pyx_t_19 = NULL;
          } else {
            __pyx_t_18 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_seekelems); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 967, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 967, __pyx_L7_error)
          }
          for (;;) {
            if (likely(!__pyx_t_19)) {
              if (likely(PyList_CheckExact(__pyx_t_9))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 967, __pyx_L7_error)
                  #endif
                  if (__pyx_t_18 >= __pyx_temp) break;
                }
                __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference);
                ++__pyx_t_18;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 967, __pyx_L7_error)
                  #endif
                  if (__pyx_t_18 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_18));
                #else
                __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_18);
                #endif
                ++__pyx_t_18;
              }
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L7_error)
            } else {
              __pyx_t_1 = __pyx_t_19(__pyx_t_9);
              if (unlikely(!__pyx_t_1)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 967, __pyx_L7_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_se, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":969
 *         for se in seekelems:
 * 
 *             assert zran.zran_seek(&index, se * 8, SEEK_SET, NULL) == 0             # <<<<<<<<<<<<<<
 * 
 *             if se == nelems - 1:
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_v_se, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_20 = __Pyx_PyLong_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_20 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_6 = (zran_seek((&__pyx_v_index), __pyx_t_20, SEEK_SET, NULL) == 0);
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 969, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 969, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":971
 *             assert zran.zran_seek(&index, se * 8, SEEK_SET, NULL) == 0
 * 
 *             if se == nelems - 1:             # <<<<<<<<<<<<<<
 *                 readelems = 1
 *             else:
*/
            __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = PyObject_RichCompare(__pyx_v_se, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 971, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (__pyx_t_6) {

              /* "indexed_gzip/tests/ctest_zran.pyx":972
 * 
 *             if se == nelems - 1:
 *                 readelems = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 readelems = np.random.randint(1, min(nelems - se, 5000))
*/
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
              __Pyx_XDECREF_SET(__pyx_v_readelems, __pyx_mstate_global->__pyx_int_1);

              /* "indexed_gzip/tests/ctest_zran.pyx":971
 *             assert zran.zran_seek(&index, se * 8, SEEK_SET, NULL) == 0
 * 
 *             if se == nelems - 1:             # <<<<<<<<<<<<<<
 *                 readelems = 1
 *             else:
*/
              goto __pyx_L15;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":974
 *                 readelems = 1
 *             else:
 *                 readelems = np.random.randint(1, min(nelems - se, 5000))             # <<<<<<<<<<<<<<
 * 
 *             nbytes = zran.zran_read(&index, buffer, readelems * 8)
*/
            /*else*/ {
              __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 974, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_1 = __pyx_t_5;
              __Pyx_INCREF(__pyx_t_1);
              __pyx_t_2 = 0x1388;
              __pyx_t_8 = PyNumber_Subtract(__pyx_v_nelems, __pyx_v_se); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 974, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_21 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 974, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_21);
              __pyx_t_22 = PyObject_RichCompare(__pyx_t_21, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_22); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 974, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_22); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 974, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
              if (__pyx_t_6) {
                __pyx_t_22 = __Pyx_PyLong_From_long(__pyx_t_2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 974, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_22);
                __pyx_t_3 = __pyx_t_22;
                __pyx_t_22 = 0;
              } else {
                __Pyx_INCREF(__pyx_t_8);
                __pyx_t_3 = __pyx_t_8;
              }
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_7 = 0;
              {
                PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_int_1, __pyx_t_3};
                __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_4);
              }
              __Pyx_XDECREF_SET(__pyx_v_readelems, __pyx_t_4);
              __pyx_t_4 = 0;
            }
            __pyx_L15:;

            /* "indexed_gzip/tests/ctest_zran.pyx":976
 *                 readelems = np.random.randint(1, min(nelems - se, 5000))
 * 
 *             nbytes = zran.zran_read(&index, buffer, readelems * 8)             # <<<<<<<<<<<<<<
 * 
 *             assert nbytes                 == readelems * 8
*/
            __pyx_t_4 = __Pyx_PyLong_MultiplyObjC(__pyx_v_readelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_23 = __Pyx_PyLong_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_23 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_PyLong_From_int64_t(zran_read((&__pyx_v_index), __pyx_v_buffer, __pyx_t_23)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_XDECREF_SET(__pyx_v_nbytes, __pyx_t_4);
            __pyx_t_4 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":978
 *             nbytes = zran.zran_read(&index, buffer, readelems * 8)
 * 
 *             assert nbytes                 == readelems * 8             # <<<<<<<<<<<<<<
 *             assert zran.zran_tell(&index) == (se + readelems) * 8
 * 
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_4 = __Pyx_PyLong_MultiplyObjC(__pyx_v_readelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_5 = PyObject_RichCompare(__pyx_v_nbytes, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 978, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 978, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 978, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":979
 * 
 *             assert nbytes                 == readelems * 8
 *             assert zran.zran_tell(&index) == (se + readelems) * 8             # <<<<<<<<<<<<<<
 * 
 *             pybuf = <bytes>(<char *>buffer)[:nbytes]
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_5 = __Pyx_PyLong_From_uint64_t(zran_tell((&__pyx_v_index))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_4 = PyNumber_Add(__pyx_v_se, __pyx_v_readelems); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 979, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_3 = __Pyx_PyLong_MultiplyObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 979, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 979, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 979, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_6)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 979, __pyx_L7_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 979, __pyx_L7_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":981
 *             assert zran.zran_tell(&index) == (se + readelems) * 8
 * 
 *             pybuf = <bytes>(<char *>buffer)[:nbytes]             # <<<<<<<<<<<<<<
 *             data  = np.ndarray(nbytes // 8, np.uint64, pybuf)
 * 
*/
            __Pyx_INCREF(__pyx_v_nbytes);
            __pyx_t_4 = __pyx_v_nbytes;
            __pyx_t_6 = (__pyx_t_4 == Py_None);
            if (__pyx_t_6) {
              __pyx_t_24 = PY_SSIZE_T_MAX;
            } else {
              __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L7_error)
              __pyx_t_24 = __pyx_t_25;
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_buffer) + 0, __pyx_t_24 - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_3 = __pyx_t_4;
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF_SET(__pyx_v_pybuf, ((PyObject*)__pyx_t_3));
            __pyx_t_3 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":982
 * 
 *             pybuf = <bytes>(<char *>buffer)[:nbytes]
 *             data  = np.ndarray(nbytes // 8, np.uint64, pybuf)             # <<<<<<<<<<<<<<
 * 
 *             for i, val in enumerate(data, se):
*/
            __pyx_t_4 = NULL;
            __pyx_t_5 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_nbytes, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 982, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_7 = 1;
            {
              PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_5, __pyx_t_8, __pyx_v_pybuf};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5numpy_ndarray, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L7_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_3);
            }
            __Pyx_XDECREF_SET(__pyx_v_data, ((PyObject *)__pyx_t_3));
            __pyx_t_3 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":984
 *             data  = np.ndarray(nbytes // 8, np.uint64, pybuf)
 * 
 *             for i, val in enumerate(data, se):             # <<<<<<<<<<<<<<
 *                 assert val == i
 * 
*/
            __Pyx_INCREF(__pyx_v_se);
            __pyx_t_3 = __pyx_v_se;
            if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
              __pyx_t_8 = __pyx_v_data; __Pyx_INCREF(__pyx_t_8);
              __pyx_t_24 = 0;
              __pyx_t_26 = NULL;
            } else {
              __pyx_t_24 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 984, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_26 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 984, __pyx_L7_error)
            }
            for (;;) {
              if (likely(!__pyx_t_26)) {
                if (likely(PyList_CheckExact(__pyx_t_8))) {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
                    #if !CYTHON_ASSUME_SAFE_SIZE
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 984, __pyx_L7_error)
                    #endif
                    if (__pyx_t_24 >= __pyx_temp) break;
                  }
                  __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_24, __Pyx_ReferenceSharing_OwnStrongReference);
                  ++__pyx_t_24;
                } else {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
                    #if !CYTHON_ASSUME_SAFE_SIZE
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 984, __pyx_L7_error)
                    #endif
                    if (__pyx_t_24 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_24));
                  #else
                  __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_24);
                  #endif
                  ++__pyx_t_24;
                }
                if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L7_error)
              } else {
                __pyx_t_5 = __pyx_t_26(__pyx_t_8);
                if (unlikely(!__pyx_t_5)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 984, __pyx_L7_error)
                    PyErr_Clear();
                  }
                  break;
                }
              }
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
              __pyx_t_5 = 0;
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
              __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_3);
              __pyx_t_3 = __pyx_t_5;
              __pyx_t_5 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":985
 * 
 *             for i, val in enumerate(data, se):
 *                 assert val == i             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index)
*/
              #ifndef CYTHON_WITHOUT_ASSERTIONS
              if (unlikely(__pyx_assertions_enabled())) {
                __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 985, __pyx_L7_error)
                __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 985, __pyx_L7_error)
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (unlikely(!__pyx_t_6)) {
                  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                  __PYX_ERR(0, 985, __pyx_L7_error)
                }
              }
              #else
              if ((1)); else __PYX_ERR(0, 985, __pyx_L7_error)
              #endif

              /* "indexed_gzip/tests/ctest_zran.pyx":984
 *             data  = np.ndarray(nbytes // 8, np.uint64, pybuf)
 * 
 *             for i, val in enumerate(data, se):             # <<<<<<<<<<<<<<
 *                 assert val == i
 * 
*/
            }
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":967
 *         assert not zran.zran_build_index(&index, 0, 0)
 * 
 *         for se in seekelems:             # <<<<<<<<<<<<<<
 * 
 *             assert zran.zran_seek(&index, se * 8, SEEK_SET, NULL) == 0
*/
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":987
 *                 assert val == i
 * 
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index));

          /* "indexed_gzip/tests/ctest_zran.pyx":954
 *     cdef void             *buffer = buf.buffer
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_build_then_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_3, &__pyx_t_8) < 0) __PYX_ERR(0, 954, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_8);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_9, __pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 954, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 954, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_27);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_27);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
          if (__pyx_t_6 < (0)) __PYX_ERR(0, 954, __pyx_L9_except_error)
          __pyx_t_28 = (!__pyx_t_6);
          if (unlikely(__pyx_t_28)) {
            __Pyx_GIVEREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_ErrRestoreWithState(__pyx_t_9, __pyx_t_3, __pyx_t_8);
            __pyx_t_9 = 0;  __pyx_t_3 = 0;  __pyx_t_8 = 0; 
            __PYX_ERR(0, 954, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_11) {
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 954, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L23;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L1_error;
    __pyx_L23:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":943
 * 
 * 
 * def test_build_then_read(testfile, no_fds, nelems, seed, use_mmap):             # <<<<<<<<<<<<<<
 * 
 *     filesize = nelems * 8
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_build_then_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filesize);
  __Pyx_XDECREF(__pyx_v_indexSpacing);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_seekelems);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_se);
  __Pyx_XDECREF(__pyx_v_readelems);
  __Pyx_XDECREF(__pyx_v_nbytes);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":990
 * 
 * 
 * def test_readbuf_spacing_sizes(testfile, no_fds, nelems, niters, seed):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_51test_readbuf_spacing_sizes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_51test_readbuf_spacing_sizes = {"test_readbuf_spacing_sizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_51test_readbuf_spacing_sizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_51test_readbuf_spacing_sizes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  PyObject *__pyx_v_nelems = 0;
  PyObject *__pyx_v_niters = 0;
  CYTHON_UNUSED PyObject *__pyx_v_seed = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_readbuf_spacing_sizes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,&__pyx_mstate_global->__pyx_n_u_nelems_2,&__pyx_mstate_global->__pyx_n_u_niters,&__pyx_mstate_global->__pyx_n_u_seed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 990, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 990, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 990, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 990, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 990, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 990, __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, "test_readbuf_spacing_sizes", 0) < (0)) __PYX_ERR(0, 990, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_readbuf_spacing_sizes", 1, 5, 5, i); __PYX_ERR(0, 990, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 990, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 990, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 990, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 990, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 990, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
    __pyx_v_nelems = values[2];
    __pyx_v_niters = values[3];
    __pyx_v_seed = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_readbuf_spacing_sizes", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 990, __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("indexed_gzip.tests.ctest_zran.test_readbuf_spacing_sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_50test_readbuf_spacing_sizes(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds, __pyx_v_nelems, __pyx_v_niters, __pyx_v_seed);

  /* 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_12indexed_gzip_5tests_10ctest_zran_50test_readbuf_spacing_sizes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds, PyObject *__pyx_v_nelems, PyObject *__pyx_v_niters, CYTHON_UNUSED PyObject *__pyx_v_seed) {
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_spacings = NULL;
  PyObject *__pyx_v_bufsizes = NULL;
  PyObject *__pyx_v_seekelems = NULL;
  PyObject *__pyx_v_sbi = NULL;
  PyObject *__pyx_v_spacing = NULL;
  PyObject *__pyx_v_bufsize = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_se = NULL;
  PyObject *__pyx_v_expval = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  void *__pyx_t_19;
  int __pyx_t_20;
  PyObject *__pyx_t_21;
  uint32_t __pyx_t_22;
  uint32_t __pyx_t_23;
  PyObject *(*__pyx_t_24)(PyObject *);
  struct __pyx_opt_args_12indexed_gzip_5tests_10ctest_zran_read_element __pyx_t_25;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  PyObject *__pyx_t_30 = NULL;
  PyObject *__pyx_t_31 = NULL;
  PyObject *__pyx_t_32 = NULL;
  int __pyx_t_33;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_readbuf_spacing_sizes", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":994
 *     cdef zran.zran_index_t index
 * 
 *     spacings = [262144,  524288,  1048576,             # <<<<<<<<<<<<<<
 *                 2097152, 4194304, 8388608]
 *     bufsizes = [16384,   65536,   131072,  262144,
*/
  __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_262144);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_262144);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_262144) != (0)) __PYX_ERR(0, 994, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_524288);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_524288);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_524288) != (0)) __PYX_ERR(0, 994, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1048576);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1048576);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_1048576) != (0)) __PYX_ERR(0, 994, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2097152);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2097152);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_2097152) != (0)) __PYX_ERR(0, 994, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4194304);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4194304);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_4194304) != (0)) __PYX_ERR(0, 994, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_8388608);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_8388608);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_int_8388608) != (0)) __PYX_ERR(0, 994, __pyx_L1_error);
  __pyx_v_spacings = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":996
 *     spacings = [262144,  524288,  1048576,
 *                 2097152, 4194304, 8388608]
 *     bufsizes = [16384,   65536,   131072,  262144,             # <<<<<<<<<<<<<<
 *                 524288,  1048575, 1048576, 1048577,
 *                 2097152, 4194304, 8388608]
*/
  __pyx_t_1 = PyList_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_16384);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_16384);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_16384) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_65536);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_65536);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_65536) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_131072);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_131072);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_131072) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_262144);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_262144);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_262144) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_524288);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_524288);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_524288) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1048575);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1048575);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_int_1048575) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1048576);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1048576);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_mstate_global->__pyx_int_1048576) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1048577);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1048577);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 7, __pyx_mstate_global->__pyx_int_1048577) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2097152);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2097152);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 8, __pyx_mstate_global->__pyx_int_2097152) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4194304);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4194304);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 9, __pyx_mstate_global->__pyx_int_4194304) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_8388608);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_8388608);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 10, __pyx_mstate_global->__pyx_int_8388608) != (0)) __PYX_ERR(0, 996, __pyx_L1_error);
  __pyx_v_bufsizes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1000
 *                 2097152, 4194304, 8388608]
 * 
 *     seekelems = np.random.randint(0, nelems, niters // 2)             # <<<<<<<<<<<<<<
 *     seekelems = np.concatenate((spacings, bufsizes, seekelems))
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_niters, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0, __pyx_v_nelems, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_seekelems = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1001
 * 
 *     seekelems = np.random.randint(0, nelems, niters // 2)
 *     seekelems = np.concatenate((spacings, bufsizes, seekelems))             # <<<<<<<<<<<<<<
 * 
 *     for sbi, (spacing, bufsize) in enumerate(it.product(spacings, bufsizes)):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_concatenate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_spacings);
  __Pyx_GIVEREF(__pyx_v_spacings);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_spacings) != (0)) __PYX_ERR(0, 1001, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_bufsizes);
  __Pyx_GIVEREF(__pyx_v_bufsizes);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_bufsizes) != (0)) __PYX_ERR(0, 1001, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_seekelems);
  __Pyx_GIVEREF(__pyx_v_seekelems);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_seekelems) != (0)) __PYX_ERR(0, 1001, __pyx_L1_error);
  __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(0, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_seekelems, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1003
 *     seekelems = np.concatenate((spacings, bufsizes, seekelems))
 * 
 *     for sbi, (spacing, bufsize) in enumerate(it.product(spacings, bufsizes)):             # <<<<<<<<<<<<<<
 * 
 *         with open(testfile, 'rb') as pyfid:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = 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_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_spacings, __pyx_v_bufsizes};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1003, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1003, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1003, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_8(__pyx_t_6);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1003, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1003, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1003, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_spacing, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_bufsize, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_sbi, __pyx_t_1);
    __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1005
 *     for sbi, (spacing, bufsize) in enumerate(it.product(spacings, bufsizes)):
 * 
 *         with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 * 
 *             print('{} / {}: spacing={}, bufsize={} ... '.format(
*/
    /*with:*/ {
      __pyx_t_4 = NULL;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1005, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_3 = NULL;
      __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1005, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1005, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_9 = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          /*try:*/ {
            __Pyx_XDECREF_SET(__pyx_v_pyfid, __pyx_t_9);
            __pyx_t_9 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":1007
 *         with open(testfile, 'rb') as pyfid:
 * 
 *             print('{} / {}: spacing={}, bufsize={} ... '.format(             # <<<<<<<<<<<<<<
 *                 sbi,
 *                 len(spacings) * len(bufsizes),
*/
            __pyx_t_2 = NULL;
            __pyx_t_3 = __pyx_mstate_global->__pyx_kp_u_spacing_bufsize;
            __Pyx_INCREF(__pyx_t_3);

            /* "indexed_gzip/tests/ctest_zran.pyx":1009
 *             print('{} / {}: spacing={}, bufsize={} ... '.format(
 *                 sbi,
 *                 len(spacings) * len(bufsizes),             # <<<<<<<<<<<<<<
 *                 spacing, bufsize), end='')
 * 
*/
            __pyx_t_15 = __Pyx_PyList_GET_SIZE(__pyx_v_spacings); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1009, __pyx_L13_error)
            __pyx_t_16 = __Pyx_PyList_GET_SIZE(__pyx_v_bufsizes); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1009, __pyx_L13_error)
            __pyx_t_17 = PyLong_FromSsize_t((__pyx_t_15 * __pyx_t_16)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1009, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_17);

            /* "indexed_gzip/tests/ctest_zran.pyx":1010
 *                 sbi,
 *                 len(spacings) * len(bufsizes),
 *                 spacing, bufsize), end='')             # <<<<<<<<<<<<<<
 * 
 *             cfid = fdopen(pyfid.fileno(), 'rb')
*/
            __pyx_t_5 = 0;
            {
              PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_sbi, __pyx_t_17, __pyx_v_spacing, __pyx_v_bufsize};
              __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1007, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
            }
            __pyx_t_5 = 1;
            {
              PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_4};
              __pyx_t_17 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1007, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_17);
              if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_kp_u__2, __pyx_t_17, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1007, __pyx_L13_error)
              __pyx_t_9 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_17);
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1007, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_9);
            }
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":1012
 *                 spacing, bufsize), end='')
 * 
 *             cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *             assert not zran.zran_init(&index,
*/
            __pyx_t_17 = __pyx_v_pyfid;
            __Pyx_INCREF(__pyx_t_17);
            __pyx_t_5 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_17, NULL};
              __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1012, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_9);
            }
            __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_t_9); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1012, __pyx_L13_error)
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_v_cfid = fdopen(__pyx_t_18, __pyx_k_rb);

            /* "indexed_gzip/tests/ctest_zran.pyx":1014
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *             assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                       NULL if no_fds else cfid,
 *                                       <PyObject*>pyfid if no_fds else NULL,
*/
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {

              /* "indexed_gzip/tests/ctest_zran.pyx":1015
 * 
 *             assert not zran.zran_init(&index,
 *                                       NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                       <PyObject*>pyfid if no_fds else NULL,
 *                                       spacing,
*/
              __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 1015, __pyx_L13_error)
              if (__pyx_t_20) {
                __pyx_t_19 = NULL;
              } else {
                __pyx_t_19 = __pyx_v_cfid;
              }

              /* "indexed_gzip/tests/ctest_zran.pyx":1016
 *             assert not zran.zran_init(&index,
 *                                       NULL if no_fds else cfid,
 *                                       <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                       spacing,
 *                                       32768,
*/
              __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 1016, __pyx_L13_error)
              if (__pyx_t_20) {
                __pyx_t_21 = ((PyObject *)__pyx_v_pyfid);
              } else {
                __pyx_t_21 = NULL;
              }

              /* "indexed_gzip/tests/ctest_zran.pyx":1017
 *                                       NULL if no_fds else cfid,
 *                                       <PyObject*>pyfid if no_fds else NULL,
 *                                       spacing,             # <<<<<<<<<<<<<<
 *                                       32768,
 *                                       bufsize,
*/
              __pyx_t_22 = __Pyx_PyLong_As_uint32_t(__pyx_v_spacing); if (unlikely((__pyx_t_22 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1017, __pyx_L13_error)

              /* "indexed_gzip/tests/ctest_zran.pyx":1019
 *                                       spacing,
 *                                       32768,
 *                                       bufsize,             # <<<<<<<<<<<<<<
 *                                       zran.ZRAN_AUTO_BUILD)
 * 
*/
              __pyx_t_23 = __Pyx_PyLong_As_uint32_t(__pyx_v_bufsize); if (unlikely((__pyx_t_23 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L13_error)

              /* "indexed_gzip/tests/ctest_zran.pyx":1014
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *             assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                       NULL if no_fds else cfid,
 *                                       <PyObject*>pyfid if no_fds else NULL,
*/
              __pyx_t_20 = (!(zran_init((&__pyx_v_index), __pyx_t_19, __pyx_t_21, __pyx_t_22, 0x8000, __pyx_t_23, ZRAN_AUTO_BUILD) != 0));
              if (unlikely(!__pyx_t_20)) {
                __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                __PYX_ERR(0, 1014, __pyx_L13_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 1014, __pyx_L13_error)
            #endif

            /* "indexed_gzip/tests/ctest_zran.pyx":1022
 *                                       zran.ZRAN_AUTO_BUILD)
 * 
 *             for i, se in enumerate(seekelems):             # <<<<<<<<<<<<<<
 * 
 *                 # print('{} / {}: {}'.format(i, len(seekelems), se))
*/
            __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
            __pyx_t_9 = __pyx_mstate_global->__pyx_int_0;
            if (likely(PyList_CheckExact(__pyx_v_seekelems)) || PyTuple_CheckExact(__pyx_v_seekelems)) {
              __pyx_t_17 = __pyx_v_seekelems; __Pyx_INCREF(__pyx_t_17);
              __pyx_t_16 = 0;
              __pyx_t_24 = NULL;
            } else {
              __pyx_t_16 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_v_seekelems); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1022, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_17);
              __pyx_t_24 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_17); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 1022, __pyx_L13_error)
            }
            for (;;) {
              if (likely(!__pyx_t_24)) {
                if (likely(PyList_CheckExact(__pyx_t_17))) {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_17);
                    #if !CYTHON_ASSUME_SAFE_SIZE
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1022, __pyx_L13_error)
                    #endif
                    if (__pyx_t_16 >= __pyx_temp) break;
                  }
                  __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_17, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference);
                  ++__pyx_t_16;
                } else {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_17);
                    #if !CYTHON_ASSUME_SAFE_SIZE
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1022, __pyx_L13_error)
                    #endif
                    if (__pyx_t_16 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_16));
                  #else
                  __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_17, __pyx_t_16);
                  #endif
                  ++__pyx_t_16;
                }
                if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L13_error)
              } else {
                __pyx_t_4 = __pyx_t_24(__pyx_t_17);
                if (unlikely(!__pyx_t_4)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1022, __pyx_L13_error)
                    PyErr_Clear();
                  }
                  break;
                }
              }
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_XDECREF_SET(__pyx_v_se, __pyx_t_4);
              __pyx_t_4 = 0;
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_9);
              __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_9, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_9);
              __pyx_t_9 = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":1026
 *                 # print('{} / {}: {}'.format(i, len(seekelems), se))
 * 
 *                 if se >= nelems: expval = None             # <<<<<<<<<<<<<<
 *                 else:            expval = se
 * 
*/
              __pyx_t_4 = PyObject_RichCompare(__pyx_v_se, __pyx_v_nelems, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L13_error)
              __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 1026, __pyx_L13_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (__pyx_t_20) {
                __Pyx_INCREF(Py_None);
                __Pyx_XDECREF_SET(__pyx_v_expval, Py_None);
                goto __pyx_L23;
              }

              /* "indexed_gzip/tests/ctest_zran.pyx":1027
 * 
 *                 if se >= nelems: expval = None
 *                 else:            expval = se             # <<<<<<<<<<<<<<
 * 
 *                 val = read_element(&index, se, nelems, seek=True)
*/
              /*else*/ {
                __Pyx_INCREF(__pyx_v_se);
                __Pyx_XDECREF_SET(__pyx_v_expval, __pyx_v_se);
              }
              __pyx_L23:;

              /* "indexed_gzip/tests/ctest_zran.pyx":1029
 *                 else:            expval = se
 * 
 *                 val = read_element(&index, se, nelems, seek=True)             # <<<<<<<<<<<<<<
 * 
 *                 try:
*/
              __pyx_t_25.__pyx_n = 1;
              __pyx_t_25.seek = Py_True;
              __pyx_t_4 = __pyx_f_12indexed_gzip_5tests_10ctest_zran_read_element((&__pyx_v_index), __pyx_v_se, __pyx_v_nelems, &__pyx_t_25); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4);
              __pyx_t_4 = 0;

              /* "indexed_gzip/tests/ctest_zran.pyx":1031
 *                 val = read_element(&index, se, nelems, seek=True)
 * 
 *                 try:             # <<<<<<<<<<<<<<
 *                     assert val == expval
 *                 except:
*/
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_26, &__pyx_t_27, &__pyx_t_28);
                __Pyx_XGOTREF(__pyx_t_26);
                __Pyx_XGOTREF(__pyx_t_27);
                __Pyx_XGOTREF(__pyx_t_28);
                /*try:*/ {

                  /* "indexed_gzip/tests/ctest_zran.pyx":1032
 * 
 *                 try:
 *                     assert val == expval             # <<<<<<<<<<<<<<
 *                 except:
 *                     print('{} != {}'.format(val, expval))
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_expval, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L24_error)
                    __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 1032, __pyx_L24_error)
                    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                    if (unlikely(!__pyx_t_20)) {
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1032, __pyx_L24_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1032, __pyx_L24_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1031
 *                 val = read_element(&index, se, nelems, seek=True)
 * 
 *                 try:             # <<<<<<<<<<<<<<
 *                     assert val == expval
 *                 except:
*/
                }
                __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
                __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
                __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
                goto __pyx_L31_try_end;
                __pyx_L24_error:;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "indexed_gzip/tests/ctest_zran.pyx":1033
 *                 try:
 *                     assert val == expval
 *                 except:             # <<<<<<<<<<<<<<
 *                     print('{} != {}'.format(val, expval))
 *                     raise
*/
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_readbuf_spacing_sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 1033, __pyx_L26_except_error)
                  __Pyx_XGOTREF(__pyx_t_4);
                  __Pyx_XGOTREF(__pyx_t_2);
                  __Pyx_XGOTREF(__pyx_t_3);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1034
 *                     assert val == expval
 *                 except:
 *                     print('{} != {}'.format(val, expval))             # <<<<<<<<<<<<<<
 *                     raise
 * 
*/
                  __pyx_t_30 = NULL;
                  __pyx_t_32 = __pyx_mstate_global->__pyx_kp_u_;
                  __Pyx_INCREF(__pyx_t_32);
                  __pyx_t_5 = 0;
                  {
                    PyObject *__pyx_callargs[3] = {__pyx_t_32, __pyx_v_val, __pyx_v_expval};
                    __pyx_t_31 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = 0;
                    if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1034, __pyx_L26_except_error)
                    __Pyx_GOTREF(__pyx_t_31);
                  }
                  __pyx_t_5 = 1;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_30, __pyx_t_31};
                    __pyx_t_29 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0;
                    __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
                    if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1034, __pyx_L26_except_error)
                    __Pyx_GOTREF(__pyx_t_29);
                  }
                  __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1035
 *                 except:
 *                     print('{} != {}'.format(val, expval))
 *                     raise             # <<<<<<<<<<<<<<
 * 
 *             print()
*/
                  __Pyx_GIVEREF(__pyx_t_4);
                  __Pyx_GIVEREF(__pyx_t_2);
                  __Pyx_XGIVEREF(__pyx_t_3);
                  __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_3);
                  __pyx_t_4 = 0;  __pyx_t_2 = 0;  __pyx_t_3 = 0; 
                  __PYX_ERR(0, 1035, __pyx_L26_except_error)
                }

                /* "indexed_gzip/tests/ctest_zran.pyx":1031
 *                 val = read_element(&index, se, nelems, seek=True)
 * 
 *                 try:             # <<<<<<<<<<<<<<
 *                     assert val == expval
 *                 except:
*/
                __pyx_L26_except_error:;
                __Pyx_XGIVEREF(__pyx_t_26);
                __Pyx_XGIVEREF(__pyx_t_27);
                __Pyx_XGIVEREF(__pyx_t_28);
                __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_27, __pyx_t_28);
                goto __pyx_L13_error;
                __pyx_L31_try_end:;
              }

              /* "indexed_gzip/tests/ctest_zran.pyx":1022
 *                                       zran.ZRAN_AUTO_BUILD)
 * 
 *             for i, se in enumerate(seekelems):             # <<<<<<<<<<<<<<
 * 
 *                 # print('{} / {}: {}'.format(i, len(seekelems), se))
*/
            }
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":1037
 *                     raise
 * 
 *             print()             # <<<<<<<<<<<<<<
 *             zran.zran_free(&index)
 * 
*/
            __pyx_t_17 = NULL;
            __pyx_t_5 = 1;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_17, NULL};
              __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1037, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_9);
            }
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":1038
 * 
 *             print()
 *             zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
            zran_free((&__pyx_v_index));

            /* "indexed_gzip/tests/ctest_zran.pyx":1005
 *     for sbi, (spacing, bufsize) in enumerate(it.product(spacings, bufsizes)):
 * 
 *         with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 * 
 *             print('{} / {}: spacing={}, bufsize={} ... '.format(
*/
          }
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          goto __pyx_L20_try_end;
          __pyx_L13_error:;
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0;
          __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0;
          __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_readbuf_spacing_sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_17, &__pyx_t_3) < 0) __PYX_ERR(0, 1005, __pyx_L15_except_error)
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_3);
            __pyx_t_2 = PyTuple_Pack(3, __pyx_t_9, __pyx_t_17, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L15_except_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_28 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 1005, __pyx_L15_except_error)
            __Pyx_GOTREF(__pyx_t_28);
            __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_28);
            __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
            if (__pyx_t_20 < (0)) __PYX_ERR(0, 1005, __pyx_L15_except_error)
            __pyx_t_33 = (!__pyx_t_20);
            if (unlikely(__pyx_t_33)) {
              __Pyx_GIVEREF(__pyx_t_9);
              __Pyx_GIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_3);
              __Pyx_ErrRestoreWithState(__pyx_t_9, __pyx_t_17, __pyx_t_3);
              __pyx_t_9 = 0;  __pyx_t_17 = 0;  __pyx_t_3 = 0; 
              __PYX_ERR(0, 1005, __pyx_L15_except_error)
            }
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L14_exception_handled;
          }
          __pyx_L15_except_error:;
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          goto __pyx_L1_error;
          __pyx_L14_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_L20_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_11) {
            __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1005, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      goto __pyx_L38;
      __pyx_L7_error:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L1_error;
      __pyx_L38:;
    }

    /* "indexed_gzip/tests/ctest_zran.pyx":1003
 *     seekelems = np.concatenate((spacings, bufsizes, seekelems))
 * 
 *     for sbi, (spacing, bufsize) in enumerate(it.product(spacings, bufsizes)):             # <<<<<<<<<<<<<<
 * 
 *         with open(testfile, 'rb') as pyfid:
*/
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":990
 * 
 * 
 * def test_readbuf_spacing_sizes(testfile, no_fds, nelems, niters, seed):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_29);
  __Pyx_XDECREF(__pyx_t_30);
  __Pyx_XDECREF(__pyx_t_31);
  __Pyx_XDECREF(__pyx_t_32);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_readbuf_spacing_sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_spacings);
  __Pyx_XDECREF(__pyx_v_bufsizes);
  __Pyx_XDECREF(__pyx_v_seekelems);
  __Pyx_XDECREF(__pyx_v_sbi);
  __Pyx_XDECREF(__pyx_v_spacing);
  __Pyx_XDECREF(__pyx_v_bufsize);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_se);
  __Pyx_XDECREF(__pyx_v_expval);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1041
 * 
 * 
 * cdef _compare_indexes(zran.zran_index_t *index1,             # <<<<<<<<<<<<<<
 *                       zran.zran_index_t *index2):
 *     """Check that two indexes are equivalent. """
*/

static PyObject *__pyx_f_12indexed_gzip_5tests_10ctest_zran__compare_indexes(zran_index_t *__pyx_v_index1, zran_index_t *__pyx_v_index2) {
  zran_point_t *__pyx_v_p1;
  zran_point_t *__pyx_v_p2;
  uint32_t __pyx_v_ws;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  uint32_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_compare_indexes", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":1047
 *     cdef zran.zran_point_t *p2
 * 
 *     assert index2.compressed_size   == index1.compressed_size             # <<<<<<<<<<<<<<
 *     assert index2.uncompressed_size == index1.uncompressed_size
 *     assert index2.spacing           == index1.spacing
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_index2->compressed_size == __pyx_v_index1->compressed_size);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 1047, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1047, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1048
 * 
 *     assert index2.compressed_size   == index1.compressed_size
 *     assert index2.uncompressed_size == index1.uncompressed_size             # <<<<<<<<<<<<<<
 *     assert index2.spacing           == index1.spacing
 *     assert index2.window_size       == index1.window_size
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_index2->uncompressed_size == __pyx_v_index1->uncompressed_size);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 1048, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1048, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1049
 *     assert index2.compressed_size   == index1.compressed_size
 *     assert index2.uncompressed_size == index1.uncompressed_size
 *     assert index2.spacing           == index1.spacing             # <<<<<<<<<<<<<<
 *     assert index2.window_size       == index1.window_size
 *     assert index2.npoints           == index1.npoints
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_index2->spacing == __pyx_v_index1->spacing);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 1049, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1049, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1050
 *     assert index2.uncompressed_size == index1.uncompressed_size
 *     assert index2.spacing           == index1.spacing
 *     assert index2.window_size       == index1.window_size             # <<<<<<<<<<<<<<
 *     assert index2.npoints           == index1.npoints
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_index2->window_size == __pyx_v_index1->window_size);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 1050, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1050, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1051
 *     assert index2.spacing           == index1.spacing
 *     assert index2.window_size       == index1.window_size
 *     assert index2.npoints           == index1.npoints             # <<<<<<<<<<<<<<
 * 
 *     ws = index1.window_size
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_index2->npoints == __pyx_v_index1->npoints);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 1051, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1051, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1053
 *     assert index2.npoints           == index1.npoints
 * 
 *     ws = index1.window_size             # <<<<<<<<<<<<<<
 * 
 *     for i in range(index1.npoints):
*/
  __pyx_t_2 = __pyx_v_index1->window_size;
  __pyx_v_ws = __pyx_t_2;

  /* "indexed_gzip/tests/ctest_zran.pyx":1055
 *     ws = index1.window_size
 * 
 *     for i in range(index1.npoints):             # <<<<<<<<<<<<<<
 * 
 *         p1 = &index1.list[i]
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = __Pyx_PyLong_From_uint32_t(__pyx_v_index1->npoints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    {
      __pyx_t_3 = __pyx_t_7(__pyx_t_5);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1055, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1057
 *     for i in range(index1.npoints):
 * 
 *         p1 = &index1.list[i]             # <<<<<<<<<<<<<<
 *         p2 = &index2.list[i]
 *         msg = 'Error at point %d' % i
*/
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1057, __pyx_L1_error)
    __pyx_v_p1 = (&(__pyx_v_index1->list[__pyx_t_8]));

    /* "indexed_gzip/tests/ctest_zran.pyx":1058
 * 
 *         p1 = &index1.list[i]
 *         p2 = &index2.list[i]             # <<<<<<<<<<<<<<
 *         msg = 'Error at point %d' % i
 * 
*/
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1058, __pyx_L1_error)
    __pyx_v_p2 = (&(__pyx_v_index2->list[__pyx_t_8]));

    /* "indexed_gzip/tests/ctest_zran.pyx":1059
 *         p1 = &index1.list[i]
 *         p2 = &index2.list[i]
 *         msg = 'Error at point %d' % i             # <<<<<<<<<<<<<<
 * 
 *         assert p2.cmp_offset   == p1.cmp_offset, msg
*/
    __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_Error_at_point_d, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1059, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1061
 *         msg = 'Error at point %d' % i
 * 
 *         assert p2.cmp_offset   == p1.cmp_offset, msg             # <<<<<<<<<<<<<<
 *         assert p2.uncmp_offset == p1.uncmp_offset, msg
 *         assert p2.bits         == p1.bits, msg
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = (__pyx_v_p2->cmp_offset == __pyx_v_p1->cmp_offset);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_v_msg, 0, 0);
        __PYX_ERR(0, 1061, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1061, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":1062
 * 
 *         assert p2.cmp_offset   == p1.cmp_offset, msg
 *         assert p2.uncmp_offset == p1.uncmp_offset, msg             # <<<<<<<<<<<<<<
 *         assert p2.bits         == p1.bits, msg
 *         if (not p1.data):
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = (__pyx_v_p2->uncmp_offset == __pyx_v_p1->uncmp_offset);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_v_msg, 0, 0);
        __PYX_ERR(0, 1062, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1062, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":1063
 *         assert p2.cmp_offset   == p1.cmp_offset, msg
 *         assert p2.uncmp_offset == p1.uncmp_offset, msg
 *         assert p2.bits         == p1.bits, msg             # <<<<<<<<<<<<<<
 *         if (not p1.data):
 *             assert p1.data == p2.data, msg
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = (__pyx_v_p2->bits == __pyx_v_p1->bits);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_v_msg, 0, 0);
        __PYX_ERR(0, 1063, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1063, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":1064
 *         assert p2.uncmp_offset == p1.uncmp_offset, msg
 *         assert p2.bits         == p1.bits, msg
 *         if (not p1.data):             # <<<<<<<<<<<<<<
 *             assert p1.data == p2.data, msg
 *         else:
*/
    __pyx_t_1 = (!(__pyx_v_p1->data != 0));
    if (__pyx_t_1) {

      /* "indexed_gzip/tests/ctest_zran.pyx":1065
 *         assert p2.bits         == p1.bits, msg
 *         if (not p1.data):
 *             assert p1.data == p2.data, msg             # <<<<<<<<<<<<<<
 *         else:
 *             assert not memcmp(p2.data, p1.data, ws), msg
*/
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = (__pyx_v_p1->data == __pyx_v_p2->data);
        if (unlikely(!__pyx_t_1)) {
          __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_v_msg, 0, 0);
          __PYX_ERR(0, 1065, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1065, __pyx_L1_error)
      #endif

      /* "indexed_gzip/tests/ctest_zran.pyx":1064
 *         assert p2.uncmp_offset == p1.uncmp_offset, msg
 *         assert p2.bits         == p1.bits, msg
 *         if (not p1.data):             # <<<<<<<<<<<<<<
 *             assert p1.data == p2.data, msg
 *         else:
*/
      goto __pyx_L5;
    }

    /* "indexed_gzip/tests/ctest_zran.pyx":1067
 *             assert p1.data == p2.data, msg
 *         else:
 *             assert not memcmp(p2.data, p1.data, ws), msg             # <<<<<<<<<<<<<<
 * 
 * 
*/
    /*else*/ {
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = (!(memcmp(__pyx_v_p2->data, __pyx_v_p1->data, __pyx_v_ws) != 0));
        if (unlikely(!__pyx_t_1)) {
          __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_v_msg, 0, 0);
          __PYX_ERR(0, 1067, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(0, 1067, __pyx_L1_error)
      #endif
    }
    __pyx_L5:;

    /* "indexed_gzip/tests/ctest_zran.pyx":1055
 *     ws = index1.window_size
 * 
 *     for i in range(index1.npoints):             # <<<<<<<<<<<<<<
 * 
 *         p1 = &index1.list[i]
*/
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1041
 * 
 * 
 * cdef _compare_indexes(zran.zran_index_t *index1,             # <<<<<<<<<<<<<<
 *                       zran.zran_index_t *index2):
 *     """Check that two indexes are equivalent. """
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran._compare_indexes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1070
 * 
 * 
 * def test_export_then_import(testfile, no_fds):             # <<<<<<<<<<<<<<
 *     """Export-import round trip . Test exporting an index, then importing it
 *     back in.
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_53test_export_then_import(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_12indexed_gzip_5tests_10ctest_zran_52test_export_then_import, "Export-import round trip . Test exporting an index, then importing it\n    back in.\n    ");
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_53test_export_then_import = {"test_export_then_import", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_53test_export_then_import, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_52test_export_then_import};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_53test_export_then_import(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_testfile = 0;
  PyObject *__pyx_v_no_fds = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_export_then_import (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_testfile,&__pyx_mstate_global->__pyx_n_u_no_fds,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1070, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1070, __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, "test_export_then_import", 0) < (0)) __PYX_ERR(0, 1070, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_export_then_import", 1, 2, 2, i); __PYX_ERR(0, 1070, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1070, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1070, __pyx_L3_error)
    }
    __pyx_v_testfile = values[0];
    __pyx_v_no_fds = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_export_then_import", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1070, __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("indexed_gzip.tests.ctest_zran.test_export_then_import", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_52test_export_then_import(__pyx_self, __pyx_v_testfile, __pyx_v_no_fds);

  /* 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_12indexed_gzip_5tests_10ctest_zran_52test_export_then_import(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_testfile, PyObject *__pyx_v_no_fds) {
  zran_index_t __pyx_v_index1;
  zran_index_t __pyx_v_index2;
  long __pyx_v_indexSpacing;
  long __pyx_v_windowSize;
  long __pyx_v_readbufSize;
  long __pyx_v_flag;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_pyexportfid = NULL;
  int __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  void *__pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_export_then_import", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":1078
 *     cdef zran.zran_index_t index2
 * 
 *     indexSpacing = 1048576             # <<<<<<<<<<<<<<
 *     windowSize   = 32768
 *     readbufSize  = 131072
*/
  __pyx_v_indexSpacing = 0x100000;

  /* "indexed_gzip/tests/ctest_zran.pyx":1079
 * 
 *     indexSpacing = 1048576
 *     windowSize   = 32768             # <<<<<<<<<<<<<<
 *     readbufSize  = 131072
 *     flag         = 0
*/
  __pyx_v_windowSize = 0x8000;

  /* "indexed_gzip/tests/ctest_zran.pyx":1080
 *     indexSpacing = 1048576
 *     windowSize   = 32768
 *     readbufSize  = 131072             # <<<<<<<<<<<<<<
 *     flag         = 0
 * 
*/
  __pyx_v_readbufSize = 0x20000;

  /* "indexed_gzip/tests/ctest_zran.pyx":1081
 *     windowSize   = 32768
 *     readbufSize  = 131072
 *     flag         = 0             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
  __pyx_v_flag = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1083
 *     flag         = 0
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
  /*with:*/ {
    __pyx_t_2 = NULL;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1083, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_6 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_pyfid = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1084
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 * 
 *         assert not zran.zran_init(&index1,
*/
          __pyx_t_1 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1084, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1084, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_10, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":1086
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index1,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":1087
 * 
 *         assert not zran.zran_init(&index1,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1087, __pyx_L7_error)
            if (__pyx_t_12) {
              __pyx_t_11 = NULL;
            } else {
              __pyx_t_11 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":1088
 *         assert not zran.zran_init(&index1,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   windowSize,
*/
            __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1088, __pyx_L7_error)
            if (__pyx_t_12) {
              __pyx_t_13 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_13 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":1086
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
 *         assert not zran.zran_init(&index1,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_12 = (!(zran_init((&__pyx_v_index1), __pyx_t_11, __pyx_t_13, __pyx_v_indexSpacing, __pyx_v_windowSize, __pyx_v_readbufSize, __pyx_v_flag) != 0));
            if (unlikely(!__pyx_t_12)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 1086, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 1086, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":1094
 *                                   flag)
 * 
 *         assert not zran.zran_build_index(&index1, 0, 0)             # <<<<<<<<<<<<<<
 * 
 *         with open(testfile + '.idx.tmp', 'wb') as pyexportfid:
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_12 = (!(zran_build_index((&__pyx_v_index1), 0, 0) != 0));
            if (unlikely(!__pyx_t_12)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 1094, __pyx_L7_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 1094, __pyx_L7_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":1096
 *         assert not zran.zran_build_index(&index1, 0, 0)
 * 
 *         with open(testfile + '.idx.tmp', 'wb') as pyexportfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyexportfid.fileno(), 'ab')
 *             ret  = zran.zran_export_index(&index1, NULL if no_fds else cfid, <PyObject*>pyexportfid if no_fds else NULL)
*/
          /*with:*/ {
            __pyx_t_1 = NULL;
            __pyx_t_2 = PyNumber_Add(__pyx_v_testfile, __pyx_mstate_global->__pyx_kp_u_idx_tmp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_wb};
              __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_6);
            }
            __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1096, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_1 = NULL;
            __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_3 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(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_3 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__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(0, 1096, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __pyx_t_5 = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
                __Pyx_XGOTREF(__pyx_t_15);
                __Pyx_XGOTREF(__pyx_t_16);
                __Pyx_XGOTREF(__pyx_t_17);
                /*try:*/ {
                  __pyx_v_pyexportfid = __pyx_t_5;
                  __pyx_t_5 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1097
 * 
 *         with open(testfile + '.idx.tmp', 'wb') as pyexportfid:
 *             cfid = fdopen(pyexportfid.fileno(), 'ab')             # <<<<<<<<<<<<<<
 *             ret  = zran.zran_export_index(&index1, NULL if no_fds else cfid, <PyObject*>pyexportfid if no_fds else NULL)
 *             assert not ret, str(ret)
*/
                  __pyx_t_6 = __pyx_v_pyexportfid;
                  __Pyx_INCREF(__pyx_t_6);
                  __pyx_t_3 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
                    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1097, __pyx_L17_error)
                    __Pyx_GOTREF(__pyx_t_5);
                  }
                  __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1097, __pyx_L17_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __pyx_v_cfid = fdopen(__pyx_t_10, __pyx_k_ab);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1098
 *         with open(testfile + '.idx.tmp', 'wb') as pyexportfid:
 *             cfid = fdopen(pyexportfid.fileno(), 'ab')
 *             ret  = zran.zran_export_index(&index1, NULL if no_fds else cfid, <PyObject*>pyexportfid if no_fds else NULL)             # <<<<<<<<<<<<<<
 *             assert not ret, str(ret)
 * 
*/
                  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1098, __pyx_L17_error)
                  if (__pyx_t_12) {
                    __pyx_t_11 = NULL;
                  } else {
                    __pyx_t_11 = __pyx_v_cfid;
                  }
                  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1098, __pyx_L17_error)
                  if (__pyx_t_12) {
                    __pyx_t_13 = ((PyObject *)__pyx_v_pyexportfid);
                  } else {
                    __pyx_t_13 = NULL;
                  }
                  __pyx_v_ret = zran_export_index((&__pyx_v_index1), __pyx_t_11, __pyx_t_13);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1099
 *             cfid = fdopen(pyexportfid.fileno(), 'ab')
 *             ret  = zran.zran_export_index(&index1, NULL if no_fds else cfid, <PyObject*>pyexportfid if no_fds else NULL)
 *             assert not ret, str(ret)             # <<<<<<<<<<<<<<
 * 
 *     with open(testfile, 'rb') as pyfid:
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_12 = (!(__pyx_v_ret != 0));
                    if (unlikely(!__pyx_t_12)) {
                      __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1099, __pyx_L17_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1099, __pyx_L17_error)
                      __Pyx_GOTREF(__pyx_t_6);
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_6, 0, 0);
                      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                      __PYX_ERR(0, 1099, __pyx_L17_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1099, __pyx_L17_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1096
 *         assert not zran.zran_build_index(&index1, 0, 0)
 * 
 *         with open(testfile + '.idx.tmp', 'wb') as pyexportfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyexportfid.fileno(), 'ab')
 *             ret  = zran.zran_export_index(&index1, NULL if no_fds else cfid, <PyObject*>pyexportfid if no_fds else NULL)
*/
                }
                __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                goto __pyx_L22_try_end;
                __pyx_L17_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_then_import", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L19_except_error)
                  __Pyx_XGOTREF(__pyx_t_6);
                  __Pyx_XGOTREF(__pyx_t_5);
                  __Pyx_XGOTREF(__pyx_t_2);
                  __pyx_t_1 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L19_except_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_1, NULL);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1096, __pyx_L19_except_error)
                  __Pyx_GOTREF(__pyx_t_18);
                  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_18);
                  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                  if (__pyx_t_12 < (0)) __PYX_ERR(0, 1096, __pyx_L19_except_error)
                  __pyx_t_19 = (!__pyx_t_12);
                  if (unlikely(__pyx_t_19)) {
                    __Pyx_GIVEREF(__pyx_t_6);
                    __Pyx_GIVEREF(__pyx_t_5);
                    __Pyx_XGIVEREF(__pyx_t_2);
                    __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_5, __pyx_t_2);
                    __pyx_t_6 = 0;  __pyx_t_5 = 0;  __pyx_t_2 = 0; 
                    __PYX_ERR(0, 1096, __pyx_L19_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  goto __pyx_L18_exception_handled;
                }
                __pyx_L19_except_error:;
                __Pyx_XGIVEREF(__pyx_t_15);
                __Pyx_XGIVEREF(__pyx_t_16);
                __Pyx_XGIVEREF(__pyx_t_17);
                __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
                goto __pyx_L7_error;
                __pyx_L18_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_15);
                __Pyx_XGIVEREF(__pyx_t_16);
                __Pyx_XGIVEREF(__pyx_t_17);
                __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
                __pyx_L22_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_14) {
                  __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1096, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_17);
                  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                }
                goto __pyx_L16;
              }
              __pyx_L16:;
            }
            goto __pyx_L26;
            __pyx_L13_error:;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            goto __pyx_L7_error;
            __pyx_L26:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1083
 *     flag         = 0
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_then_import", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 1083, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1083, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (__pyx_t_19 < (0)) __PYX_ERR(0, 1083, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_19);
          if (unlikely(__pyx_t_12)) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_XGIVEREF(__pyx_t_6);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_5, __pyx_t_6);
            __pyx_t_2 = 0;  __pyx_t_5 = 0;  __pyx_t_6 = 0; 
            __PYX_ERR(0, 1083, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_4) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1083, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L30;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L30:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1101
 *             assert not ret, str(ret)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 *         assert not zran.zran_init(&index2,
*/
  /*with:*/ {
    __pyx_t_5 = NULL;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_testfile, __pyx_mstate_global->__pyx_n_u_rb};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L31_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1101, __pyx_L31_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_7);
        /*try:*/ {
          __Pyx_XDECREF_SET(__pyx_v_pyfid, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1102
 * 
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 *         assert not zran.zran_init(&index2,
 *                                   NULL if no_fds else cfid,
*/
          __pyx_t_6 = __pyx_v_pyfid;
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L35_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1102, __pyx_L35_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_cfid = fdopen(__pyx_t_10, __pyx_k_rb);

          /* "indexed_gzip/tests/ctest_zran.pyx":1103
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 *         assert not zran.zran_init(&index2,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {

            /* "indexed_gzip/tests/ctest_zran.pyx":1104
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 *         assert not zran.zran_init(&index2,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   indexSpacing,
*/
            __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1104, __pyx_L35_error)
            if (__pyx_t_12) {
              __pyx_t_11 = NULL;
            } else {
              __pyx_t_11 = __pyx_v_cfid;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":1105
 *         assert not zran.zran_init(&index2,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   indexSpacing,
 *                                   windowSize,
*/
            __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1105, __pyx_L35_error)
            if (__pyx_t_12) {
              __pyx_t_13 = ((PyObject *)__pyx_v_pyfid);
            } else {
              __pyx_t_13 = NULL;
            }

            /* "indexed_gzip/tests/ctest_zran.pyx":1103
 *     with open(testfile, 'rb') as pyfid:
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 *         assert not zran.zran_init(&index2,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
            __pyx_t_12 = (!(zran_init((&__pyx_v_index2), __pyx_t_11, __pyx_t_13, __pyx_v_indexSpacing, __pyx_v_windowSize, __pyx_v_readbufSize, __pyx_v_flag) != 0));
            if (unlikely(!__pyx_t_12)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 1103, __pyx_L35_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 1103, __pyx_L35_error)
          #endif

          /* "indexed_gzip/tests/ctest_zran.pyx":1111
 *                                   flag)
 * 
 *         with open(testfile + '.idx.tmp', 'rb') as pyexportfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyexportfid.fileno(), 'rb')
 *             ret  = zran.zran_import_index(&index2, NULL if no_fds else cfid, <PyObject*>pyexportfid if no_fds else NULL)
*/
          /*with:*/ {
            __pyx_t_6 = NULL;
            __pyx_t_5 = PyNumber_Add(__pyx_v_testfile, __pyx_mstate_global->__pyx_kp_u_idx_tmp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1111, __pyx_L35_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_3 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_rb};
              __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__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(0, 1111, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1111, __pyx_L35_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_6 = NULL;
            __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1111, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
              assert(__pyx_t_6);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
              __pyx_t_3 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
              __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1111, __pyx_L41_error)
              __Pyx_GOTREF(__pyx_t_5);
            }
            __pyx_t_2 = __pyx_t_5;
            __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
                __Pyx_XGOTREF(__pyx_t_17);
                __Pyx_XGOTREF(__pyx_t_16);
                __Pyx_XGOTREF(__pyx_t_15);
                /*try:*/ {
                  __Pyx_XDECREF_SET(__pyx_v_pyexportfid, __pyx_t_2);
                  __pyx_t_2 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1112
 * 
 *         with open(testfile + '.idx.tmp', 'rb') as pyexportfid:
 *             cfid = fdopen(pyexportfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 *             ret  = zran.zran_import_index(&index2, NULL if no_fds else cfid, <PyObject*>pyexportfid if no_fds else NULL)
 *             assert not ret, str(ret)
*/
                  __pyx_t_1 = __pyx_v_pyexportfid;
                  __Pyx_INCREF(__pyx_t_1);
                  __pyx_t_3 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
                    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L45_error)
                    __Pyx_GOTREF(__pyx_t_2);
                  }
                  __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L45_error)
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_v_cfid = fdopen(__pyx_t_10, __pyx_k_rb);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1113
 *         with open(testfile + '.idx.tmp', 'rb') as pyexportfid:
 *             cfid = fdopen(pyexportfid.fileno(), 'rb')
 *             ret  = zran.zran_import_index(&index2, NULL if no_fds else cfid, <PyObject*>pyexportfid if no_fds else NULL)             # <<<<<<<<<<<<<<
 *             assert not ret, str(ret)
 * 
*/
                  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1113, __pyx_L45_error)
                  if (__pyx_t_12) {
                    __pyx_t_11 = NULL;
                  } else {
                    __pyx_t_11 = __pyx_v_cfid;
                  }
                  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1113, __pyx_L45_error)
                  if (__pyx_t_12) {
                    __pyx_t_13 = ((PyObject *)__pyx_v_pyexportfid);
                  } else {
                    __pyx_t_13 = NULL;
                  }
                  __pyx_v_ret = zran_import_index((&__pyx_v_index2), __pyx_t_11, __pyx_t_13);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1114
 *             cfid = fdopen(pyexportfid.fileno(), 'rb')
 *             ret  = zran.zran_import_index(&index2, NULL if no_fds else cfid, <PyObject*>pyexportfid if no_fds else NULL)
 *             assert not ret, str(ret)             # <<<<<<<<<<<<<<
 * 
 *         _compare_indexes(&index1, &index2)
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_12 = (!(__pyx_v_ret != 0));
                    if (unlikely(!__pyx_t_12)) {
                      __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L45_error)
                      __Pyx_GOTREF(__pyx_t_2);
                      __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L45_error)
                      __Pyx_GOTREF(__pyx_t_1);
                      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_1, 0, 0);
                      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                      __PYX_ERR(0, 1114, __pyx_L45_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1114, __pyx_L45_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1111
 *                                   flag)
 * 
 *         with open(testfile + '.idx.tmp', 'rb') as pyexportfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyexportfid.fileno(), 'rb')
 *             ret  = zran.zran_import_index(&index2, NULL if no_fds else cfid, <PyObject*>pyexportfid if no_fds else NULL)
*/
                }
                __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                goto __pyx_L50_try_end;
                __pyx_L45_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_then_import", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 1111, __pyx_L47_except_error)
                  __Pyx_XGOTREF(__pyx_t_1);
                  __Pyx_XGOTREF(__pyx_t_2);
                  __Pyx_XGOTREF(__pyx_t_5);
                  __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1111, __pyx_L47_except_error)
                  __Pyx_GOTREF(__pyx_t_6);
                  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_6, NULL);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                  if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1111, __pyx_L47_except_error)
                  __Pyx_GOTREF(__pyx_t_18);
                  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_18);
                  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                  if (__pyx_t_12 < (0)) __PYX_ERR(0, 1111, __pyx_L47_except_error)
                  __pyx_t_19 = (!__pyx_t_12);
                  if (unlikely(__pyx_t_19)) {
                    __Pyx_GIVEREF(__pyx_t_1);
                    __Pyx_GIVEREF(__pyx_t_2);
                    __Pyx_XGIVEREF(__pyx_t_5);
                    __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_5);
                    __pyx_t_1 = 0;  __pyx_t_2 = 0;  __pyx_t_5 = 0; 
                    __PYX_ERR(0, 1111, __pyx_L47_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                  goto __pyx_L46_exception_handled;
                }
                __pyx_L47_except_error:;
                __Pyx_XGIVEREF(__pyx_t_17);
                __Pyx_XGIVEREF(__pyx_t_16);
                __Pyx_XGIVEREF(__pyx_t_15);
                __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_16, __pyx_t_15);
                goto __pyx_L35_error;
                __pyx_L46_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_17);
                __Pyx_XGIVEREF(__pyx_t_16);
                __Pyx_XGIVEREF(__pyx_t_15);
                __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_16, __pyx_t_15);
                __pyx_L50_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_14) {
                  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1111, __pyx_L35_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                }
                goto __pyx_L44;
              }
              __pyx_L44:;
            }
            goto __pyx_L54;
            __pyx_L41_error:;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            goto __pyx_L35_error;
            __pyx_L54:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1116
 *             assert not ret, str(ret)
 * 
 *         _compare_indexes(&index1, &index2)             # <<<<<<<<<<<<<<
 * 
 *         zran.zran_free(&index1)
*/
          __pyx_t_5 = __pyx_f_12indexed_gzip_5tests_10ctest_zran__compare_indexes((&__pyx_v_index1), (&__pyx_v_index2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1116, __pyx_L35_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1118
 *         _compare_indexes(&index1, &index2)
 * 
 *         zran.zran_free(&index1)             # <<<<<<<<<<<<<<
 *         zran.zran_free(&index2)
 * 
*/
          zran_free((&__pyx_v_index1));

          /* "indexed_gzip/tests/ctest_zran.pyx":1119
 * 
 *         zran.zran_free(&index1)
 *         zran.zran_free(&index2)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index2));

          /* "indexed_gzip/tests/ctest_zran.pyx":1101
 *             assert not ret, str(ret)
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *         cfid = fdopen(pyfid.fileno(), 'rb')
 *         assert not zran.zran_init(&index2,
*/
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L40_try_end;
        __pyx_L35_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_then_import", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 1101, __pyx_L37_except_error)
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_6 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1101, __pyx_L37_except_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1101, __pyx_L37_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (__pyx_t_19 < (0)) __PYX_ERR(0, 1101, __pyx_L37_except_error)
          __pyx_t_12 = (!__pyx_t_19);
          if (unlikely(__pyx_t_12)) {
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_2, __pyx_t_1);
            __pyx_t_5 = 0;  __pyx_t_2 = 0;  __pyx_t_1 = 0; 
            __PYX_ERR(0, 1101, __pyx_L37_except_error)
          }
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L36_exception_handled;
        }
        __pyx_L37_except_error:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        goto __pyx_L1_error;
        __pyx_L36_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        __pyx_L40_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_4) {
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1101, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        goto __pyx_L34;
      }
      __pyx_L34:;
    }
    goto __pyx_L58;
    __pyx_L31_error:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L58:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1070
 * 
 * 
 * def test_export_then_import(testfile, no_fds):             # <<<<<<<<<<<<<<
 *     """Export-import round trip . Test exporting an index, then importing it
 *     back in.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_then_import", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_pyexportfid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1122
 * 
 * 
 * def test_export_import_no_points(no_fds):             # <<<<<<<<<<<<<<
 *     """Test exporting and importing an index which does not contain any
 *     seek points.
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_55test_export_import_no_points(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_12indexed_gzip_5tests_10ctest_zran_54test_export_import_no_points, "Test exporting and importing an index which does not contain any\n    seek points.\n    ");
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_55test_export_import_no_points = {"test_export_import_no_points", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_55test_export_import_no_points, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_54test_export_import_no_points};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_55test_export_import_no_points(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_no_fds = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_export_import_no_points (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_no_fds,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1122, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1122, __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, "test_export_import_no_points", 0) < (0)) __PYX_ERR(0, 1122, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_export_import_no_points", 1, 1, 1, i); __PYX_ERR(0, 1122, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1122, __pyx_L3_error)
    }
    __pyx_v_no_fds = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_export_import_no_points", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1122, __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("indexed_gzip.tests.ctest_zran.test_export_import_no_points", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_54test_export_import_no_points(__pyx_self, __pyx_v_no_fds);

  /* 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_12indexed_gzip_5tests_10ctest_zran_54test_export_import_no_points(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_no_fds) {
  zran_index_t __pyx_v_index;
  void *__pyx_v_buffer;
  PyObject *__pyx_v_data = NULL;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_buf = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  int64_t __pyx_v_output;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_v_pyidxfid = NULL;
  FILE *__pyx_v_cidxfid;
  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;
  void *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  PyObject *__pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_export_import_no_points", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":1129
 *     cdef void             *buffer
 * 
 *     data   = np.random.randint(1, 255, 100, dtype=np.uint8)             # <<<<<<<<<<<<<<
 *     buf    = ReadBuffer(100)
 *     buffer = buf.buffer
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_randint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4) < (0)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[1], __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_data = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1130
 * 
 *     data   = np.random.randint(1, 255, 100, dtype=np.uint8)
 *     buf    = ReadBuffer(100)             # <<<<<<<<<<<<<<
 *     buffer = buf.buffer
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_100};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, __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;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __pyx_v_buf = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1131
 *     data   = np.random.randint(1, 255, 100, dtype=np.uint8)
 *     buf    = ReadBuffer(100)
 *     buffer = buf.buffer             # <<<<<<<<<<<<<<
 * 
 *     with tempdir():
*/
  __pyx_t_6 = __pyx_v_buf->buffer;
  __pyx_v_buffer = __pyx_t_6;

  /* "indexed_gzip/tests/ctest_zran.pyx":1133
 *     buffer = buf.buffer
 * 
 *     with tempdir():             # <<<<<<<<<<<<<<
 * 
 *         with gzip.open('data.gz', 'wb') as f:
*/
  /*with:*/ {
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_tempdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = 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_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = NULL;
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__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(0, 1133, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "indexed_gzip/tests/ctest_zran.pyx":1135
 *     with tempdir():
 * 
 *         with gzip.open('data.gz', 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(data.tobytes())
 * 
*/
          /*with:*/ {
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gzip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1135, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1135, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1135, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_3 = NULL;
            __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
              assert(__pyx_t_3);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
              __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __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_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __pyx_t_2 = __pyx_t_1;
            __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_14);
                /*try:*/ {
                  __pyx_v_f = __pyx_t_2;
                  __pyx_t_2 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1136
 * 
 *         with gzip.open('data.gz', 'wb') as f:
 *             f.write(data.tobytes())             # <<<<<<<<<<<<<<
 * 
 *         with open('data.gz', 'rb')  as pyfid:
*/
                  __pyx_t_4 = __pyx_v_f;
                  __Pyx_INCREF(__pyx_t_4);
                  __pyx_t_3 = __pyx_v_data;
                  __Pyx_INCREF(__pyx_t_3);
                  __pyx_t_5 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
                    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tobytes, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L17_error)
                    __Pyx_GOTREF(__pyx_t_1);
                  }
                  __pyx_t_5 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
                    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L17_error)
                    __Pyx_GOTREF(__pyx_t_2);
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1135
 *     with tempdir():
 * 
 *         with gzip.open('data.gz', 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(data.tobytes())
 * 
*/
                }
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                goto __pyx_L22_try_end;
                __pyx_L17_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_no_points", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 1135, __pyx_L19_except_error)
                  __Pyx_XGOTREF(__pyx_t_2);
                  __Pyx_XGOTREF(__pyx_t_1);
                  __Pyx_XGOTREF(__pyx_t_4);
                  __pyx_t_3 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L19_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, NULL);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1135, __pyx_L19_except_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_15);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  if (__pyx_t_16 < (0)) __PYX_ERR(0, 1135, __pyx_L19_except_error)
                  __pyx_t_17 = (!__pyx_t_16);
                  if (unlikely(__pyx_t_17)) {
                    __Pyx_GIVEREF(__pyx_t_2);
                    __Pyx_GIVEREF(__pyx_t_1);
                    __Pyx_XGIVEREF(__pyx_t_4);
                    __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_4);
                    __pyx_t_2 = 0;  __pyx_t_1 = 0;  __pyx_t_4 = 0; 
                    __PYX_ERR(0, 1135, __pyx_L19_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  goto __pyx_L18_exception_handled;
                }
                __pyx_L19_except_error:;
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_14);
                __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
                goto __pyx_L7_error;
                __pyx_L18_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_14);
                __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
                __pyx_L22_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_11) {
                  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1135, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_14);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                }
                goto __pyx_L16;
              }
              __pyx_L16:;
            }
            goto __pyx_L26;
            __pyx_L13_error:;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L7_error;
            __pyx_L26:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1138
 *             f.write(data.tobytes())
 * 
 *         with open('data.gz', 'rb')  as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,
*/
          /*with:*/ {
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[3], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1138, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = NULL;
            __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
              assert(__pyx_t_2);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
              __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__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(0, 1138, __pyx_L27_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __pyx_t_3 = __pyx_t_1;
            __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_14);
                __Pyx_XGOTREF(__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_12);
                /*try:*/ {
                  __pyx_v_pyfid = __pyx_t_3;
                  __pyx_t_3 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1139
 * 
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 *             assert zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
*/
                  __pyx_t_4 = __pyx_v_pyfid;
                  __Pyx_INCREF(__pyx_t_4);
                  __pyx_t_5 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
                    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_3);
                  }
                  __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1139, __pyx_L31_error)
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __pyx_v_cfid = fdopen(__pyx_t_18, __pyx_k_rb);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1140
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {

                    /* "indexed_gzip/tests/ctest_zran.pyx":1141
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   1048576,
*/
                    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1141, __pyx_L31_error)
                    if (__pyx_t_17) {
                      __pyx_t_6 = NULL;
                    } else {
                      __pyx_t_6 = __pyx_v_cfid;
                    }

                    /* "indexed_gzip/tests/ctest_zran.pyx":1142
 *             assert zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   1048576,
 *                                   32768,
*/
                    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1142, __pyx_L31_error)
                    if (__pyx_t_17) {
                      __pyx_t_19 = ((PyObject *)__pyx_v_pyfid);
                    } else {
                      __pyx_t_19 = NULL;
                    }

                    /* "indexed_gzip/tests/ctest_zran.pyx":1146
 *                                   32768,
 *                                   131072,
 *                                   0) == 0             # <<<<<<<<<<<<<<
 *             output = zran.zran_read(&index, buffer, 100)
 *             assert output  == 100, output
*/
                    __pyx_t_17 = (zran_init((&__pyx_v_index), __pyx_t_6, __pyx_t_19, 0x100000, 0x8000, 0x20000, 0) == 0);
                    if (unlikely(!__pyx_t_17)) {

                      /* "indexed_gzip/tests/ctest_zran.pyx":1140
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1140, __pyx_L31_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1140, __pyx_L31_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1147
 *                                   131072,
 *                                   0) == 0
 *             output = zran.zran_read(&index, buffer, 100)             # <<<<<<<<<<<<<<
 *             assert output  == 100, output
 * 
*/
                  __pyx_v_output = zran_read((&__pyx_v_index), __pyx_v_buffer, 0x64);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1148
 *                                   0) == 0
 *             output = zran.zran_read(&index, buffer, 100)
 *             assert output  == 100, output             # <<<<<<<<<<<<<<
 * 
 *             pybuf = <bytes>(<char *>buffer)[:100]
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_17 = (__pyx_v_output == 0x64);
                    if (unlikely(!__pyx_t_17)) {
                      __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L31_error)
                      __Pyx_GOTREF(__pyx_t_3);
                      __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L31_error)
                      __Pyx_GOTREF(__pyx_t_4);
                      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_4, 0, 0);
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      __PYX_ERR(0, 1148, __pyx_L31_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1148, __pyx_L31_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1150
 *             assert output  == 100, output
 * 
 *             pybuf = <bytes>(<char *>buffer)[:100]             # <<<<<<<<<<<<<<
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == data)
 * 
*/
                  __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_buffer) + 0, 0x64 - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1150, __pyx_L31_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __pyx_t_3 = __pyx_t_4;
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __pyx_v_pybuf = ((PyObject*)__pyx_t_3);
                  __pyx_t_3 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1151
 * 
 *             pybuf = <bytes>(<char *>buffer)[:100]
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == data)             # <<<<<<<<<<<<<<
 * 
 *             with open('data.gz.index', 'wb') as pyidxfid:
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_4 = NULL;
                    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_1);
                    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_2);
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                    __pyx_t_20 = NULL;
                    __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1151, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_21);
                    __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_frombuffer); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1151, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_22);
                    __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                    __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1151, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_21);
                    __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_uint8); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1151, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_23);
                    __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                    __pyx_t_5 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (unlikely(PyMethod_Check(__pyx_t_22))) {
                      __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_22);
                      assert(__pyx_t_20);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_22);
                      __Pyx_INCREF(__pyx_t_20);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_22, __pyx__function);
                      __pyx_t_5 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_20, __pyx_v_pybuf};
                      __pyx_t_21 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1151, __pyx_L31_error)
                      __Pyx_GOTREF(__pyx_t_21);
                      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_23, __pyx_t_21, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1151, __pyx_L31_error)
                      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_22, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_21);
                      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
                      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L31_error)
                      __Pyx_GOTREF(__pyx_t_1);
                    }
                    __pyx_t_22 = PyObject_RichCompare(__pyx_t_1, __pyx_v_data, Py_EQ); __Pyx_XGOTREF(__pyx_t_22); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1151, __pyx_L31_error)
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_22};
                      __pyx_t_3 = __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_22); __pyx_t_22 = 0;
                      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1151, __pyx_L31_error)
                      __Pyx_GOTREF(__pyx_t_3);
                    }
                    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1151, __pyx_L31_error)
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (unlikely(!__pyx_t_17)) {
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1151, __pyx_L31_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1151, __pyx_L31_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1153
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == data)
 * 
 *             with open('data.gz.index', 'wb') as pyidxfid:             # <<<<<<<<<<<<<<
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'wb')
 *                 assert zran.zran_export_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0
*/
                  /*with:*/ {
                    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[4], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_3);
                    __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1153, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_15);
                    __pyx_t_22 = NULL;
                    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L37_error)
                    __Pyx_GOTREF(__pyx_t_4);
                    __pyx_t_5 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (likely(PyMethod_Check(__pyx_t_4))) {
                      __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_4);
                      assert(__pyx_t_22);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
                      __Pyx_INCREF(__pyx_t_22);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
                      __pyx_t_5 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_22, 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_22); __pyx_t_22 = 0;
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L37_error)
                      __Pyx_GOTREF(__pyx_t_2);
                    }
                    __pyx_t_4 = __pyx_t_2;
                    __pyx_t_2 = 0;
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    /*try:*/ {
                      {
                        __Pyx_PyThreadState_declare
                        __Pyx_PyThreadState_assign
                        __Pyx_ExceptionSave(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
                        __Pyx_XGOTREF(__pyx_t_24);
                        __Pyx_XGOTREF(__pyx_t_25);
                        __Pyx_XGOTREF(__pyx_t_26);
                        /*try:*/ {
                          __pyx_v_pyidxfid = __pyx_t_4;
                          __pyx_t_4 = 0;

                          /* "indexed_gzip/tests/ctest_zran.pyx":1154
 * 
 *             with open('data.gz.index', 'wb') as pyidxfid:
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'wb')             # <<<<<<<<<<<<<<
 *                 assert zran.zran_export_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0
 *             zran.zran_free(&index)
*/
                          __pyx_t_3 = __pyx_v_pyidxfid;
                          __Pyx_INCREF(__pyx_t_3);
                          __pyx_t_5 = 0;
                          {
                            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
                            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L41_error)
                            __Pyx_GOTREF(__pyx_t_4);
                          }
                          __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1154, __pyx_L41_error)
                          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                          __pyx_v_cidxfid = fdopen(__pyx_t_18, __pyx_k_wb);

                          /* "indexed_gzip/tests/ctest_zran.pyx":1155
 *             with open('data.gz.index', 'wb') as pyidxfid:
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'wb')
 *                 assert zran.zran_export_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0             # <<<<<<<<<<<<<<
 *             zran.zran_free(&index)
 * 
*/
                          #ifndef CYTHON_WITHOUT_ASSERTIONS
                          if (unlikely(__pyx_assertions_enabled())) {
                            __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1155, __pyx_L41_error)
                            if (__pyx_t_17) {
                              __pyx_t_6 = NULL;
                            } else {
                              __pyx_t_6 = __pyx_v_cidxfid;
                            }
                            __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1155, __pyx_L41_error)
                            if (__pyx_t_17) {
                              __pyx_t_19 = ((PyObject *)__pyx_v_pyidxfid);
                            } else {
                              __pyx_t_19 = NULL;
                            }
                            __pyx_t_17 = (zran_export_index((&__pyx_v_index), __pyx_t_6, __pyx_t_19) == 0);
                            if (unlikely(!__pyx_t_17)) {
                              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                              __PYX_ERR(0, 1155, __pyx_L41_error)
                            }
                          }
                          #else
                          if ((1)); else __PYX_ERR(0, 1155, __pyx_L41_error)
                          #endif

                          /* "indexed_gzip/tests/ctest_zran.pyx":1153
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == data)
 * 
 *             with open('data.gz.index', 'wb') as pyidxfid:             # <<<<<<<<<<<<<<
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'wb')
 *                 assert zran.zran_export_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0
*/
                        }
                        __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
                        __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
                        __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
                        goto __pyx_L46_try_end;
                        __pyx_L41_error:;
                        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                        __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                        __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
                        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                        /*except:*/ {
                          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_no_points", __pyx_clineno, __pyx_lineno, __pyx_filename);
                          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 1153, __pyx_L43_except_error)
                          __Pyx_XGOTREF(__pyx_t_4);
                          __Pyx_XGOTREF(__pyx_t_3);
                          __Pyx_XGOTREF(__pyx_t_2);
                          __pyx_t_22 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1153, __pyx_L43_except_error)
                          __Pyx_GOTREF(__pyx_t_22);
                          __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_22, NULL);
                          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                          if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 1153, __pyx_L43_except_error)
                          __Pyx_GOTREF(__pyx_t_27);
                          __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_27);
                          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
                          if (__pyx_t_17 < (0)) __PYX_ERR(0, 1153, __pyx_L43_except_error)
                          __pyx_t_16 = (!__pyx_t_17);
                          if (unlikely(__pyx_t_16)) {
                            __Pyx_GIVEREF(__pyx_t_4);
                            __Pyx_GIVEREF(__pyx_t_3);
                            __Pyx_XGIVEREF(__pyx_t_2);
                            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_3, __pyx_t_2);
                            __pyx_t_4 = 0;  __pyx_t_3 = 0;  __pyx_t_2 = 0; 
                            __PYX_ERR(0, 1153, __pyx_L43_except_error)
                          }
                          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                          goto __pyx_L42_exception_handled;
                        }
                        __pyx_L43_except_error:;
                        __Pyx_XGIVEREF(__pyx_t_24);
                        __Pyx_XGIVEREF(__pyx_t_25);
                        __Pyx_XGIVEREF(__pyx_t_26);
                        __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
                        goto __pyx_L31_error;
                        __pyx_L42_exception_handled:;
                        __Pyx_XGIVEREF(__pyx_t_24);
                        __Pyx_XGIVEREF(__pyx_t_25);
                        __Pyx_XGIVEREF(__pyx_t_26);
                        __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
                        __pyx_L46_try_end:;
                      }
                    }
                    /*finally:*/ {
                      /*normal exit:*/{
                        if (__pyx_t_15) {
                          __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_mstate_global->__pyx_tuple[0], NULL);
                          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                          if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1153, __pyx_L31_error)
                          __Pyx_GOTREF(__pyx_t_26);
                          __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
                        }
                        goto __pyx_L40;
                      }
                      __pyx_L40:;
                    }
                    goto __pyx_L50;
                    __pyx_L37_error:;
                    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                    goto __pyx_L31_error;
                    __pyx_L50:;
                  }

                  /* "indexed_gzip/tests/ctest_zran.pyx":1156
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'wb')
 *                 assert zran.zran_export_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0
 *             zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *         with open('data.gz', 'rb')  as pyfid:
*/
                  zran_free((&__pyx_v_index));

                  /* "indexed_gzip/tests/ctest_zran.pyx":1138
 *             f.write(data.tobytes())
 * 
 *         with open('data.gz', 'rb')  as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,
*/
                }
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                goto __pyx_L36_try_end;
                __pyx_L31_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_no_points", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 1138, __pyx_L33_except_error)
                  __Pyx_XGOTREF(__pyx_t_2);
                  __Pyx_XGOTREF(__pyx_t_3);
                  __Pyx_XGOTREF(__pyx_t_4);
                  __pyx_t_22 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1138, __pyx_L33_except_error)
                  __Pyx_GOTREF(__pyx_t_22);
                  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_22, NULL);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                  if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1138, __pyx_L33_except_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_15);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  if (__pyx_t_16 < (0)) __PYX_ERR(0, 1138, __pyx_L33_except_error)
                  __pyx_t_17 = (!__pyx_t_16);
                  if (unlikely(__pyx_t_17)) {
                    __Pyx_GIVEREF(__pyx_t_2);
                    __Pyx_GIVEREF(__pyx_t_3);
                    __Pyx_XGIVEREF(__pyx_t_4);
                    __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_4);
                    __pyx_t_2 = 0;  __pyx_t_3 = 0;  __pyx_t_4 = 0; 
                    __PYX_ERR(0, 1138, __pyx_L33_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  goto __pyx_L32_exception_handled;
                }
                __pyx_L33_except_error:;
                __Pyx_XGIVEREF(__pyx_t_14);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
                goto __pyx_L7_error;
                __pyx_L32_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_14);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
                __pyx_L36_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_11) {
                  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1138, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_12);
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                }
                goto __pyx_L30;
              }
              __pyx_L30:;
            }
            goto __pyx_L54;
            __pyx_L27_error:;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L7_error;
            __pyx_L54:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1158
 *             zran.zran_free(&index)
 * 
 *         with open('data.gz', 'rb')  as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,
*/
          /*with:*/ {
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[3], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1158, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = NULL;
            __pyx_t_22 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1158, __pyx_L55_error)
            __Pyx_GOTREF(__pyx_t_22);
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_22))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_22);
              assert(__pyx_t_2);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_22);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_22, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_22, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1158, __pyx_L55_error)
              __Pyx_GOTREF(__pyx_t_3);
            }
            __pyx_t_22 = __pyx_t_3;
            __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_14);
                /*try:*/ {
                  __Pyx_XDECREF_SET(__pyx_v_pyfid, __pyx_t_22);
                  __pyx_t_22 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1159
 * 
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 *             assert zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
*/
                  __pyx_t_4 = __pyx_v_pyfid;
                  __Pyx_INCREF(__pyx_t_4);
                  __pyx_t_5 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
                    __pyx_t_22 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1159, __pyx_L59_error)
                    __Pyx_GOTREF(__pyx_t_22);
                  }
                  __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_t_22); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L59_error)
                  __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                  __pyx_v_cfid = fdopen(__pyx_t_18, __pyx_k_rb);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1160
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {

                    /* "indexed_gzip/tests/ctest_zran.pyx":1161
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,             # <<<<<<<<<<<<<<
 *                                   <PyObject*>pyfid if no_fds else NULL,
 *                                   1048576,
*/
                    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1161, __pyx_L59_error)
                    if (__pyx_t_17) {
                      __pyx_t_6 = NULL;
                    } else {
                      __pyx_t_6 = __pyx_v_cfid;
                    }

                    /* "indexed_gzip/tests/ctest_zran.pyx":1162
 *             assert zran.zran_init(&index,
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,             # <<<<<<<<<<<<<<
 *                                   1048576,
 *                                   32768,
*/
                    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1162, __pyx_L59_error)
                    if (__pyx_t_17) {
                      __pyx_t_19 = ((PyObject *)__pyx_v_pyfid);
                    } else {
                      __pyx_t_19 = NULL;
                    }

                    /* "indexed_gzip/tests/ctest_zran.pyx":1166
 *                                   32768,
 *                                   131072,
 *                                   0) == 0             # <<<<<<<<<<<<<<
 * 
 *             with open('data.gz.index', 'rb') as pyidxfid:
*/
                    __pyx_t_17 = (zran_init((&__pyx_v_index), __pyx_t_6, __pyx_t_19, 0x100000, 0x8000, 0x20000, 0) == 0);
                    if (unlikely(!__pyx_t_17)) {

                      /* "indexed_gzip/tests/ctest_zran.pyx":1160
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL if no_fds else cfid,
 *                                   <PyObject*>pyfid if no_fds else NULL,
*/
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1160, __pyx_L59_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1160, __pyx_L59_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1168
 *                                   0) == 0
 * 
 *             with open('data.gz.index', 'rb') as pyidxfid:             # <<<<<<<<<<<<<<
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')
 *                 assert zran.zran_import_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0
*/
                  /*with:*/ {
                    __pyx_t_22 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[5], NULL); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1168, __pyx_L59_error)
                    __Pyx_GOTREF(__pyx_t_22);
                    __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1168, __pyx_L59_error)
                    __Pyx_GOTREF(__pyx_t_15);
                    __pyx_t_3 = NULL;
                    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1168, __pyx_L65_error)
                    __Pyx_GOTREF(__pyx_t_2);
                    __pyx_t_5 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (likely(PyMethod_Check(__pyx_t_2))) {
                      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
                      assert(__pyx_t_3);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
                      __Pyx_INCREF(__pyx_t_3);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
                      __pyx_t_5 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
                      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __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_2); __pyx_t_2 = 0;
                      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1168, __pyx_L65_error)
                      __Pyx_GOTREF(__pyx_t_4);
                    }
                    __pyx_t_2 = __pyx_t_4;
                    __pyx_t_4 = 0;
                    __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                    /*try:*/ {
                      {
                        __Pyx_PyThreadState_declare
                        __Pyx_PyThreadState_assign
                        __Pyx_ExceptionSave(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24);
                        __Pyx_XGOTREF(__pyx_t_26);
                        __Pyx_XGOTREF(__pyx_t_25);
                        __Pyx_XGOTREF(__pyx_t_24);
                        /*try:*/ {
                          __Pyx_XDECREF_SET(__pyx_v_pyidxfid, __pyx_t_2);
                          __pyx_t_2 = 0;

                          /* "indexed_gzip/tests/ctest_zran.pyx":1169
 * 
 *             with open('data.gz.index', 'rb') as pyidxfid:
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 *                 assert zran.zran_import_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0
 *             assert index.npoints == 0
*/
                          __pyx_t_22 = __pyx_v_pyidxfid;
                          __Pyx_INCREF(__pyx_t_22);
                          __pyx_t_5 = 0;
                          {
                            PyObject *__pyx_callargs[2] = {__pyx_t_22, NULL};
                            __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                            __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L69_error)
                            __Pyx_GOTREF(__pyx_t_2);
                          }
                          __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L69_error)
                          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                          __pyx_v_cidxfid = fdopen(__pyx_t_18, __pyx_k_rb);

                          /* "indexed_gzip/tests/ctest_zran.pyx":1170
 *             with open('data.gz.index', 'rb') as pyidxfid:
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')
 *                 assert zran.zran_import_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0             # <<<<<<<<<<<<<<
 *             assert index.npoints == 0
 * 
*/
                          #ifndef CYTHON_WITHOUT_ASSERTIONS
                          if (unlikely(__pyx_assertions_enabled())) {
                            __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1170, __pyx_L69_error)
                            if (__pyx_t_17) {
                              __pyx_t_6 = NULL;
                            } else {
                              __pyx_t_6 = __pyx_v_cidxfid;
                            }
                            __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_no_fds); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1170, __pyx_L69_error)
                            if (__pyx_t_17) {
                              __pyx_t_19 = ((PyObject *)__pyx_v_pyidxfid);
                            } else {
                              __pyx_t_19 = NULL;
                            }
                            __pyx_t_17 = (zran_import_index((&__pyx_v_index), __pyx_t_6, __pyx_t_19) == 0);
                            if (unlikely(!__pyx_t_17)) {
                              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                              __PYX_ERR(0, 1170, __pyx_L69_error)
                            }
                          }
                          #else
                          if ((1)); else __PYX_ERR(0, 1170, __pyx_L69_error)
                          #endif

                          /* "indexed_gzip/tests/ctest_zran.pyx":1168
 *                                   0) == 0
 * 
 *             with open('data.gz.index', 'rb') as pyidxfid:             # <<<<<<<<<<<<<<
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')
 *                 assert zran.zran_import_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0
*/
                        }
                        __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
                        __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
                        __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
                        goto __pyx_L74_try_end;
                        __pyx_L69_error:;
                        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                        __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                        __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
                        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                        /*except:*/ {
                          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_no_points", __pyx_clineno, __pyx_lineno, __pyx_filename);
                          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_22, &__pyx_t_4) < 0) __PYX_ERR(0, 1168, __pyx_L71_except_error)
                          __Pyx_XGOTREF(__pyx_t_2);
                          __Pyx_XGOTREF(__pyx_t_22);
                          __Pyx_XGOTREF(__pyx_t_4);
                          __pyx_t_3 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_22, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1168, __pyx_L71_except_error)
                          __Pyx_GOTREF(__pyx_t_3);
                          __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_3, NULL);
                          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                          if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 1168, __pyx_L71_except_error)
                          __Pyx_GOTREF(__pyx_t_27);
                          __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_27);
                          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
                          if (__pyx_t_17 < (0)) __PYX_ERR(0, 1168, __pyx_L71_except_error)
                          __pyx_t_16 = (!__pyx_t_17);
                          if (unlikely(__pyx_t_16)) {
                            __Pyx_GIVEREF(__pyx_t_2);
                            __Pyx_GIVEREF(__pyx_t_22);
                            __Pyx_XGIVEREF(__pyx_t_4);
                            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_22, __pyx_t_4);
                            __pyx_t_2 = 0;  __pyx_t_22 = 0;  __pyx_t_4 = 0; 
                            __PYX_ERR(0, 1168, __pyx_L71_except_error)
                          }
                          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                          __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                          goto __pyx_L70_exception_handled;
                        }
                        __pyx_L71_except_error:;
                        __Pyx_XGIVEREF(__pyx_t_26);
                        __Pyx_XGIVEREF(__pyx_t_25);
                        __Pyx_XGIVEREF(__pyx_t_24);
                        __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24);
                        goto __pyx_L59_error;
                        __pyx_L70_exception_handled:;
                        __Pyx_XGIVEREF(__pyx_t_26);
                        __Pyx_XGIVEREF(__pyx_t_25);
                        __Pyx_XGIVEREF(__pyx_t_24);
                        __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24);
                        __pyx_L74_try_end:;
                      }
                    }
                    /*finally:*/ {
                      /*normal exit:*/{
                        if (__pyx_t_15) {
                          __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_mstate_global->__pyx_tuple[0], NULL);
                          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                          if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 1168, __pyx_L59_error)
                          __Pyx_GOTREF(__pyx_t_24);
                          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                        }
                        goto __pyx_L68;
                      }
                      __pyx_L68:;
                    }
                    goto __pyx_L78;
                    __pyx_L65_error:;
                    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                    goto __pyx_L59_error;
                    __pyx_L78:;
                  }

                  /* "indexed_gzip/tests/ctest_zran.pyx":1171
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')
 *                 assert zran.zran_import_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0
 *             assert index.npoints == 0             # <<<<<<<<<<<<<<
 * 
 *             assert zran.zran_read(&index, buffer, 100)  == 100
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_16 = (__pyx_v_index.npoints == 0);
                    if (unlikely(!__pyx_t_16)) {
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1171, __pyx_L59_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1171, __pyx_L59_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1173
 *             assert index.npoints == 0
 * 
 *             assert zran.zran_read(&index, buffer, 100)  == 100             # <<<<<<<<<<<<<<
 *             pybuf = <bytes>(<char *>buffer)[:100]
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == data)
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_16 = (zran_read((&__pyx_v_index), __pyx_v_buffer, 0x64) == 0x64);
                    if (unlikely(!__pyx_t_16)) {
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1173, __pyx_L59_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1173, __pyx_L59_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1174
 * 
 *             assert zran.zran_read(&index, buffer, 100)  == 100
 *             pybuf = <bytes>(<char *>buffer)[:100]             # <<<<<<<<<<<<<<
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == data)
 *             zran.zran_free(&index)
*/
                  __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_buffer) + 0, 0x64 - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L59_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __pyx_t_22 = __pyx_t_4;
                  __Pyx_INCREF(__pyx_t_22);
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_XDECREF_SET(__pyx_v_pybuf, ((PyObject*)__pyx_t_22));
                  __pyx_t_22 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1175
 *             assert zran.zran_read(&index, buffer, 100)  == 100
 *             pybuf = <bytes>(<char *>buffer)[:100]
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == data)             # <<<<<<<<<<<<<<
 *             zran.zran_free(&index)
 * 
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_4 = NULL;
                    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L59_error)
                    __Pyx_GOTREF(__pyx_t_2);
                    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_all); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L59_error)
                    __Pyx_GOTREF(__pyx_t_3);
                    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                    __pyx_t_1 = NULL;
                    __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1175, __pyx_L59_error)
                    __Pyx_GOTREF(__pyx_t_21);
                    __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_frombuffer); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1175, __pyx_L59_error)
                    __Pyx_GOTREF(__pyx_t_23);
                    __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                    __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1175, __pyx_L59_error)
                    __Pyx_GOTREF(__pyx_t_21);
                    __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_uint8); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1175, __pyx_L59_error)
                    __Pyx_GOTREF(__pyx_t_20);
                    __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                    __pyx_t_5 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (unlikely(PyMethod_Check(__pyx_t_23))) {
                      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_23);
                      assert(__pyx_t_1);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_23);
                      __Pyx_INCREF(__pyx_t_1);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_23, __pyx__function);
                      __pyx_t_5 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_v_pybuf};
                      __pyx_t_21 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1175, __pyx_L59_error)
                      __Pyx_GOTREF(__pyx_t_21);
                      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_20, __pyx_t_21, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1175, __pyx_L59_error)
                      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_23, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_21);
                      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
                      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L59_error)
                      __Pyx_GOTREF(__pyx_t_2);
                    }
                    __pyx_t_23 = PyObject_RichCompare(__pyx_t_2, __pyx_v_data, Py_EQ); __Pyx_XGOTREF(__pyx_t_23); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1175, __pyx_L59_error)
                    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                    __pyx_t_5 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (unlikely(PyMethod_Check(__pyx_t_3))) {
                      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
                      assert(__pyx_t_4);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
                      __Pyx_INCREF(__pyx_t_4);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
                      __pyx_t_5 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_23};
                      __pyx_t_22 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
                      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                      if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1175, __pyx_L59_error)
                      __Pyx_GOTREF(__pyx_t_22);
                    }
                    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_22); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1175, __pyx_L59_error)
                    __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                    if (unlikely(!__pyx_t_16)) {
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1175, __pyx_L59_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1175, __pyx_L59_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1176
 *             pybuf = <bytes>(<char *>buffer)[:100]
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == data)
 *             zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 * 
*/
                  zran_free((&__pyx_v_index));

                  /* "indexed_gzip/tests/ctest_zran.pyx":1158
 *             zran.zran_free(&index)
 * 
 *         with open('data.gz', 'rb')  as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,
*/
                }
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                goto __pyx_L64_try_end;
                __pyx_L59_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_no_points", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_22, &__pyx_t_3, &__pyx_t_23) < 0) __PYX_ERR(0, 1158, __pyx_L61_except_error)
                  __Pyx_XGOTREF(__pyx_t_22);
                  __Pyx_XGOTREF(__pyx_t_3);
                  __Pyx_XGOTREF(__pyx_t_23);
                  __pyx_t_4 = PyTuple_Pack(3, __pyx_t_22, __pyx_t_3, __pyx_t_23); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L61_except_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1158, __pyx_L61_except_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_15);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  if (__pyx_t_16 < (0)) __PYX_ERR(0, 1158, __pyx_L61_except_error)
                  __pyx_t_17 = (!__pyx_t_16);
                  if (unlikely(__pyx_t_17)) {
                    __Pyx_GIVEREF(__pyx_t_22);
                    __Pyx_GIVEREF(__pyx_t_3);
                    __Pyx_XGIVEREF(__pyx_t_23);
                    __Pyx_ErrRestoreWithState(__pyx_t_22, __pyx_t_3, __pyx_t_23);
                    __pyx_t_22 = 0;  __pyx_t_3 = 0;  __pyx_t_23 = 0; 
                    __PYX_ERR(0, 1158, __pyx_L61_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
                  goto __pyx_L60_exception_handled;
                }
                __pyx_L61_except_error:;
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_14);
                __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
                goto __pyx_L7_error;
                __pyx_L60_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_14);
                __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
                __pyx_L64_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_11) {
                  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1158, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_14);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                }
                goto __pyx_L58;
              }
              __pyx_L58:;
            }
            goto __pyx_L82;
            __pyx_L55_error:;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L7_error;
            __pyx_L82:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1133
 *     buffer = buf.buffer
 * 
 *     with tempdir():             # <<<<<<<<<<<<<<
 * 
 *         with gzip.open('data.gz', 'wb') as f:
*/
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
        __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_no_points", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_23, &__pyx_t_3, &__pyx_t_22) < 0) __PYX_ERR(0, 1133, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_23, __pyx_t_3, __pyx_t_22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1133, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_17 < (0)) __PYX_ERR(0, 1133, __pyx_L9_except_error)
          __pyx_t_16 = (!__pyx_t_17);
          if (unlikely(__pyx_t_16)) {
            __Pyx_GIVEREF(__pyx_t_23);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ErrRestoreWithState(__pyx_t_23, __pyx_t_3, __pyx_t_22);
            __pyx_t_23 = 0;  __pyx_t_3 = 0;  __pyx_t_22 = 0; 
            __PYX_ERR(0, 1133, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1133, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L86;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L86:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1122
 * 
 * 
 * def test_export_import_no_points(no_fds):             # <<<<<<<<<<<<<<
 *     """Test exporting and importing an index which does not contain any
 *     seek points.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_no_points", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_XDECREF(__pyx_v_pyidxfid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1179
 * 
 * 
 * def test_export_import_format_v0():             # <<<<<<<<<<<<<<
 *     """Test index export and import on a version 0 index file. """
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_57test_export_import_format_v0(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_12indexed_gzip_5tests_10ctest_zran_56test_export_import_format_v0, "Test index export and import on a version 0 index file. ");
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_57test_export_import_format_v0 = {"test_export_import_format_v0", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_57test_export_import_format_v0, METH_NOARGS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_56test_export_import_format_v0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_57test_export_import_format_v0(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_export_import_format_v0 (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_56test_export_import_format_v0(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_56test_export_import_format_v0(CYTHON_UNUSED PyObject *__pyx_self) {
  zran_index_t __pyx_v_index1;
  zran_index_t __pyx_v_index2;
  int __pyx_v_ret;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_pyidxfid = NULL;
  FILE *__pyx_v_cidxfid;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_export_import_format_v0", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":1186
 *     cdef int               ret
 * 
 *     data = np.random.randint(1, 255, 1000000, dtype=np.uint8)             # <<<<<<<<<<<<<<
 *     with tempdir():
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_randint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4) < (0)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[6], __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_data = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1187
 * 
 *     data = np.random.randint(1, 255, 1000000, dtype=np.uint8)
 *     with tempdir():             # <<<<<<<<<<<<<<
 * 
 *         with gzip.open('data.gz', 'wb') as f:
*/
  /*with:*/ {
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_tempdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = 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_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = NULL;
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1187, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__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(0, 1187, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "indexed_gzip/tests/ctest_zran.pyx":1189
 *     with tempdir():
 * 
 *         with gzip.open('data.gz', 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(data.tobytes())
 * 
*/
          /*with:*/ {
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gzip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1189, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_3 = NULL;
            __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
              assert(__pyx_t_3);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
              __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __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_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __pyx_t_2 = __pyx_t_1;
            __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_13);
                /*try:*/ {
                  __pyx_v_f = __pyx_t_2;
                  __pyx_t_2 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1190
 * 
 *         with gzip.open('data.gz', 'wb') as f:
 *             f.write(data.tobytes())             # <<<<<<<<<<<<<<
 * 
 *         with open('data.gz', 'rb')  as pyfid:
*/
                  __pyx_t_4 = __pyx_v_f;
                  __Pyx_INCREF(__pyx_t_4);
                  __pyx_t_3 = __pyx_v_data;
                  __Pyx_INCREF(__pyx_t_3);
                  __pyx_t_5 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
                    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tobytes, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L17_error)
                    __Pyx_GOTREF(__pyx_t_1);
                  }
                  __pyx_t_5 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
                    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L17_error)
                    __Pyx_GOTREF(__pyx_t_2);
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1189
 *     with tempdir():
 * 
 *         with gzip.open('data.gz', 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(data.tobytes())
 * 
*/
                }
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                goto __pyx_L22_try_end;
                __pyx_L17_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_format_v0", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 1189, __pyx_L19_except_error)
                  __Pyx_XGOTREF(__pyx_t_2);
                  __Pyx_XGOTREF(__pyx_t_1);
                  __Pyx_XGOTREF(__pyx_t_4);
                  __pyx_t_3 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1189, __pyx_L19_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1189, __pyx_L19_except_error)
                  __Pyx_GOTREF(__pyx_t_14);
                  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_14);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (__pyx_t_15 < (0)) __PYX_ERR(0, 1189, __pyx_L19_except_error)
                  __pyx_t_16 = (!__pyx_t_15);
                  if (unlikely(__pyx_t_16)) {
                    __Pyx_GIVEREF(__pyx_t_2);
                    __Pyx_GIVEREF(__pyx_t_1);
                    __Pyx_XGIVEREF(__pyx_t_4);
                    __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_4);
                    __pyx_t_2 = 0;  __pyx_t_1 = 0;  __pyx_t_4 = 0; 
                    __PYX_ERR(0, 1189, __pyx_L19_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  goto __pyx_L18_exception_handled;
                }
                __pyx_L19_except_error:;
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
                goto __pyx_L7_error;
                __pyx_L18_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
                __pyx_L22_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_10) {
                  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1189, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_13);
                  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                }
                goto __pyx_L16;
              }
              __pyx_L16:;
            }
            goto __pyx_L26;
            __pyx_L13_error:;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L7_error;
            __pyx_L26:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1192
 *             f.write(data.tobytes())
 * 
 *         with open('data.gz', 'rb')  as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(
*/
          /*with:*/ {
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[3], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1192, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_2 = NULL;
            __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1192, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
              assert(__pyx_t_2);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
              __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__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(0, 1192, __pyx_L27_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __pyx_t_3 = __pyx_t_1;
            __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_11);
                /*try:*/ {
                  __pyx_v_pyfid = __pyx_t_3;
                  __pyx_t_3 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1193
 * 
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 *             assert not zran.zran_init(
 *                 &index1, cfid, NULL, 50000, 32768, 131072, 0)
*/
                  __pyx_t_4 = __pyx_v_pyfid;
                  __Pyx_INCREF(__pyx_t_4);
                  __pyx_t_5 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
                    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_3);
                  }
                  __pyx_t_17 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1193, __pyx_L31_error)
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __pyx_v_cfid = fdopen(__pyx_t_17, __pyx_k_rb);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1194
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(             # <<<<<<<<<<<<<<
 *                 &index1, cfid, NULL, 50000, 32768, 131072, 0)
 * 
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {

                    /* "indexed_gzip/tests/ctest_zran.pyx":1195
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(
 *                 &index1, cfid, NULL, 50000, 32768, 131072, 0)             # <<<<<<<<<<<<<<
 * 
 *             assert not zran.zran_build_index(&index1, 0, 0)
*/
                    __pyx_t_16 = (!(zran_init((&__pyx_v_index1), __pyx_v_cfid, NULL, 0xC350, 0x8000, 0x20000, 0) != 0));
                    if (unlikely(!__pyx_t_16)) {

                      /* "indexed_gzip/tests/ctest_zran.pyx":1194
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(             # <<<<<<<<<<<<<<
 *                 &index1, cfid, NULL, 50000, 32768, 131072, 0)
 * 
*/
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1194, __pyx_L31_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1194, __pyx_L31_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1197
 *                 &index1, cfid, NULL, 50000, 32768, 131072, 0)
 * 
 *             assert not zran.zran_build_index(&index1, 0, 0)             # <<<<<<<<<<<<<<
 *             _write_index_file_v0(&index1, 'data.gz.index')
 * 
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_16 = (!(zran_build_index((&__pyx_v_index1), 0, 0) != 0));
                    if (unlikely(!__pyx_t_16)) {
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1197, __pyx_L31_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1197, __pyx_L31_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1198
 * 
 *             assert not zran.zran_build_index(&index1, 0, 0)
 *             _write_index_file_v0(&index1, 'data.gz.index')             # <<<<<<<<<<<<<<
 * 
 *         with open('data.gz', 'rb')  as pyfid:
*/
                  __pyx_t_3 = __pyx_f_12indexed_gzip_5tests_10ctest_zran__write_index_file_v0((&__pyx_v_index1), __pyx_mstate_global->__pyx_kp_u_data_gz_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L31_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1192
 *             f.write(data.tobytes())
 * 
 *         with open('data.gz', 'rb')  as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(
*/
                }
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                goto __pyx_L36_try_end;
                __pyx_L31_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_format_v0", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 1192, __pyx_L33_except_error)
                  __Pyx_XGOTREF(__pyx_t_3);
                  __Pyx_XGOTREF(__pyx_t_4);
                  __Pyx_XGOTREF(__pyx_t_1);
                  __pyx_t_2 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L33_except_error)
                  __Pyx_GOTREF(__pyx_t_2);
                  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1192, __pyx_L33_except_error)
                  __Pyx_GOTREF(__pyx_t_14);
                  __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_14);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (__pyx_t_16 < (0)) __PYX_ERR(0, 1192, __pyx_L33_except_error)
                  __pyx_t_15 = (!__pyx_t_16);
                  if (unlikely(__pyx_t_15)) {
                    __Pyx_GIVEREF(__pyx_t_3);
                    __Pyx_GIVEREF(__pyx_t_4);
                    __Pyx_XGIVEREF(__pyx_t_1);
                    __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_1);
                    __pyx_t_3 = 0;  __pyx_t_4 = 0;  __pyx_t_1 = 0; 
                    __PYX_ERR(0, 1192, __pyx_L33_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  goto __pyx_L32_exception_handled;
                }
                __pyx_L33_except_error:;
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
                goto __pyx_L7_error;
                __pyx_L32_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
                __pyx_L36_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_10) {
                  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1192, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_11);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                }
                goto __pyx_L30;
              }
              __pyx_L30:;
            }
            goto __pyx_L40;
            __pyx_L27_error:;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L7_error;
            __pyx_L40:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1200
 *             _write_index_file_v0(&index1, 'data.gz.index')
 * 
 *         with open('data.gz', 'rb')  as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(
*/
          /*with:*/ {
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[3], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1200, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_3 = NULL;
            __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
              assert(__pyx_t_3);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
              __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __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_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L41_error)
              __Pyx_GOTREF(__pyx_t_4);
            }
            __pyx_t_2 = __pyx_t_4;
            __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_13);
                /*try:*/ {
                  __Pyx_XDECREF_SET(__pyx_v_pyfid, __pyx_t_2);
                  __pyx_t_2 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1201
 * 
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 *             assert not zran.zran_init(
 *                 &index2, cfid, NULL, 50000, 32768, 131072, 0)
*/
                  __pyx_t_1 = __pyx_v_pyfid;
                  __Pyx_INCREF(__pyx_t_1);
                  __pyx_t_5 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
                    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L45_error)
                    __Pyx_GOTREF(__pyx_t_2);
                  }
                  __pyx_t_17 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L45_error)
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_v_cfid = fdopen(__pyx_t_17, __pyx_k_rb);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1202
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(             # <<<<<<<<<<<<<<
 *                 &index2, cfid, NULL, 50000, 32768, 131072, 0)
 * 
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {

                    /* "indexed_gzip/tests/ctest_zran.pyx":1203
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(
 *                 &index2, cfid, NULL, 50000, 32768, 131072, 0)             # <<<<<<<<<<<<<<
 * 
 *             with open('data.gz.index', 'rb') as pyidxfid:
*/
                    __pyx_t_15 = (!(zran_init((&__pyx_v_index2), __pyx_v_cfid, NULL, 0xC350, 0x8000, 0x20000, 0) != 0));
                    if (unlikely(!__pyx_t_15)) {

                      /* "indexed_gzip/tests/ctest_zran.pyx":1202
 *         with open('data.gz', 'rb')  as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(             # <<<<<<<<<<<<<<
 *                 &index2, cfid, NULL, 50000, 32768, 131072, 0)
 * 
*/
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1202, __pyx_L45_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1202, __pyx_L45_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1205
 *                 &index2, cfid, NULL, 50000, 32768, 131072, 0)
 * 
 *             with open('data.gz.index', 'rb') as pyidxfid:             # <<<<<<<<<<<<<<
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')
 *                 ret = zran.zran_import_index(&index2, cidxfid,  NULL)
*/
                  /*with:*/ {
                    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[5], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1205, __pyx_L45_error)
                    __Pyx_GOTREF(__pyx_t_2);
                    __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1205, __pyx_L45_error)
                    __Pyx_GOTREF(__pyx_t_14);
                    __pyx_t_4 = NULL;
                    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __pyx_L51_error)
                    __Pyx_GOTREF(__pyx_t_3);
                    __pyx_t_5 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (likely(PyMethod_Check(__pyx_t_3))) {
                      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
                      assert(__pyx_t_4);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
                      __Pyx_INCREF(__pyx_t_4);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
                      __pyx_t_5 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
                      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L51_error)
                      __Pyx_GOTREF(__pyx_t_1);
                    }
                    __pyx_t_3 = __pyx_t_1;
                    __pyx_t_1 = 0;
                    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                    /*try:*/ {
                      {
                        __Pyx_PyThreadState_declare
                        __Pyx_PyThreadState_assign
                        __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
                        __Pyx_XGOTREF(__pyx_t_18);
                        __Pyx_XGOTREF(__pyx_t_19);
                        __Pyx_XGOTREF(__pyx_t_20);
                        /*try:*/ {
                          __pyx_v_pyidxfid = __pyx_t_3;
                          __pyx_t_3 = 0;

                          /* "indexed_gzip/tests/ctest_zran.pyx":1206
 * 
 *             with open('data.gz.index', 'rb') as pyidxfid:
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 *                 ret = zran.zran_import_index(&index2, cidxfid,  NULL)
 *                 assert ret == 0, ret
*/
                          __pyx_t_2 = __pyx_v_pyidxfid;
                          __Pyx_INCREF(__pyx_t_2);
                          __pyx_t_5 = 0;
                          {
                            PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
                            __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1206, __pyx_L55_error)
                            __Pyx_GOTREF(__pyx_t_3);
                          }
                          __pyx_t_17 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L55_error)
                          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                          __pyx_v_cidxfid = fdopen(__pyx_t_17, __pyx_k_rb);

                          /* "indexed_gzip/tests/ctest_zran.pyx":1207
 *             with open('data.gz.index', 'rb') as pyidxfid:
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')
 *                 ret = zran.zran_import_index(&index2, cidxfid,  NULL)             # <<<<<<<<<<<<<<
 *                 assert ret == 0, ret
 * 
*/
                          __pyx_v_ret = zran_import_index((&__pyx_v_index2), __pyx_v_cidxfid, NULL);

                          /* "indexed_gzip/tests/ctest_zran.pyx":1208
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')
 *                 ret = zran.zran_import_index(&index2, cidxfid,  NULL)
 *                 assert ret == 0, ret             # <<<<<<<<<<<<<<
 * 
 *         _compare_indexes(&index1, &index2)
*/
                          #ifndef CYTHON_WITHOUT_ASSERTIONS
                          if (unlikely(__pyx_assertions_enabled())) {
                            __pyx_t_15 = (__pyx_v_ret == 0);
                            if (unlikely(!__pyx_t_15)) {
                              __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L55_error)
                              __Pyx_GOTREF(__pyx_t_3);
                              __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1208, __pyx_L55_error)
                              __Pyx_GOTREF(__pyx_t_2);
                              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_2, 0, 0);
                              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                              __PYX_ERR(0, 1208, __pyx_L55_error)
                            }
                          }
                          #else
                          if ((1)); else __PYX_ERR(0, 1208, __pyx_L55_error)
                          #endif

                          /* "indexed_gzip/tests/ctest_zran.pyx":1205
 *                 &index2, cfid, NULL, 50000, 32768, 131072, 0)
 * 
 *             with open('data.gz.index', 'rb') as pyidxfid:             # <<<<<<<<<<<<<<
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')
 *                 ret = zran.zran_import_index(&index2, cidxfid,  NULL)
*/
                        }
                        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                        goto __pyx_L60_try_end;
                        __pyx_L55_error:;
                        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                        /*except:*/ {
                          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_format_v0", __pyx_clineno, __pyx_lineno, __pyx_filename);
                          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 1205, __pyx_L57_except_error)
                          __Pyx_XGOTREF(__pyx_t_2);
                          __Pyx_XGOTREF(__pyx_t_3);
                          __Pyx_XGOTREF(__pyx_t_1);
                          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L57_except_error)
                          __Pyx_GOTREF(__pyx_t_4);
                          __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_4, NULL);
                          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                          if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1205, __pyx_L57_except_error)
                          __Pyx_GOTREF(__pyx_t_21);
                          __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_21);
                          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                          if (__pyx_t_15 < (0)) __PYX_ERR(0, 1205, __pyx_L57_except_error)
                          __pyx_t_16 = (!__pyx_t_15);
                          if (unlikely(__pyx_t_16)) {
                            __Pyx_GIVEREF(__pyx_t_2);
                            __Pyx_GIVEREF(__pyx_t_3);
                            __Pyx_XGIVEREF(__pyx_t_1);
                            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1);
                            __pyx_t_2 = 0;  __pyx_t_3 = 0;  __pyx_t_1 = 0; 
                            __PYX_ERR(0, 1205, __pyx_L57_except_error)
                          }
                          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                          goto __pyx_L56_exception_handled;
                        }
                        __pyx_L57_except_error:;
                        __Pyx_XGIVEREF(__pyx_t_18);
                        __Pyx_XGIVEREF(__pyx_t_19);
                        __Pyx_XGIVEREF(__pyx_t_20);
                        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
                        goto __pyx_L45_error;
                        __pyx_L56_exception_handled:;
                        __Pyx_XGIVEREF(__pyx_t_18);
                        __Pyx_XGIVEREF(__pyx_t_19);
                        __Pyx_XGIVEREF(__pyx_t_20);
                        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
                        __pyx_L60_try_end:;
                      }
                    }
                    /*finally:*/ {
                      /*normal exit:*/{
                        if (__pyx_t_14) {
                          __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[0], NULL);
                          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                          if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1205, __pyx_L45_error)
                          __Pyx_GOTREF(__pyx_t_20);
                          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                        }
                        goto __pyx_L54;
                      }
                      __pyx_L54:;
                    }
                    goto __pyx_L64;
                    __pyx_L51_error:;
                    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                    goto __pyx_L45_error;
                    __pyx_L64:;
                  }

                  /* "indexed_gzip/tests/ctest_zran.pyx":1200
 *             _write_index_file_v0(&index1, 'data.gz.index')
 * 
 *         with open('data.gz', 'rb')  as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(
*/
                }
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                goto __pyx_L50_try_end;
                __pyx_L45_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_format_v0", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 1200, __pyx_L47_except_error)
                  __Pyx_XGOTREF(__pyx_t_1);
                  __Pyx_XGOTREF(__pyx_t_3);
                  __Pyx_XGOTREF(__pyx_t_2);
                  __pyx_t_4 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L47_except_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1200, __pyx_L47_except_error)
                  __Pyx_GOTREF(__pyx_t_14);
                  __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_14);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (__pyx_t_16 < (0)) __PYX_ERR(0, 1200, __pyx_L47_except_error)
                  __pyx_t_15 = (!__pyx_t_16);
                  if (unlikely(__pyx_t_15)) {
                    __Pyx_GIVEREF(__pyx_t_1);
                    __Pyx_GIVEREF(__pyx_t_3);
                    __Pyx_XGIVEREF(__pyx_t_2);
                    __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2);
                    __pyx_t_1 = 0;  __pyx_t_3 = 0;  __pyx_t_2 = 0; 
                    __PYX_ERR(0, 1200, __pyx_L47_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  goto __pyx_L46_exception_handled;
                }
                __pyx_L47_except_error:;
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
                goto __pyx_L7_error;
                __pyx_L46_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
                __pyx_L50_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_10) {
                  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1200, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_13);
                  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                }
                goto __pyx_L44;
              }
              __pyx_L44:;
            }
            goto __pyx_L68;
            __pyx_L41_error:;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L7_error;
            __pyx_L68:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1210
 *                 assert ret == 0, ret
 * 
 *         _compare_indexes(&index1, &index2)             # <<<<<<<<<<<<<<
 *         zran.zran_free(&index1)
 *         zran.zran_free(&index2)
*/
          __pyx_t_2 = __pyx_f_12indexed_gzip_5tests_10ctest_zran__compare_indexes((&__pyx_v_index1), (&__pyx_v_index2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1211
 * 
 *         _compare_indexes(&index1, &index2)
 *         zran.zran_free(&index1)             # <<<<<<<<<<<<<<
 *         zran.zran_free(&index2)
 * 
*/
          zran_free((&__pyx_v_index1));

          /* "indexed_gzip/tests/ctest_zran.pyx":1212
 *         _compare_indexes(&index1, &index2)
 *         zran.zran_free(&index1)
 *         zran.zran_free(&index2)             # <<<<<<<<<<<<<<
 * 
 * 
*/
          zran_free((&__pyx_v_index2));

          /* "indexed_gzip/tests/ctest_zran.pyx":1187
 * 
 *     data = np.random.randint(1, 255, 1000000, dtype=np.uint8)
 *     with tempdir():             # <<<<<<<<<<<<<<
 * 
 *         with gzip.open('data.gz', 'wb') as f:
*/
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_format_v0", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 1187, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1187, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1187, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_15 < (0)) __PYX_ERR(0, 1187, __pyx_L9_except_error)
          __pyx_t_16 = (!__pyx_t_15);
          if (unlikely(__pyx_t_16)) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1);
            __pyx_t_2 = 0;  __pyx_t_3 = 0;  __pyx_t_1 = 0; 
            __PYX_ERR(0, 1187, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1187, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L72;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L72:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1179
 * 
 * 
 * def test_export_import_format_v0():             # <<<<<<<<<<<<<<
 *     """Test index export and import on a version 0 index file. """
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_export_import_format_v0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_pyidxfid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1215
 * 
 * 
 * cdef _write_index_file_v0(zran.zran_index_t *index, dest):             # <<<<<<<<<<<<<<
 *     """Write the given index out to a file, index file version 0 format. """
 * 
*/

static PyObject *__pyx_f_12indexed_gzip_5tests_10ctest_zran__write_index_file_v0(zran_index_t *__pyx_v_index, PyObject *__pyx_v_dest) {
  zran_point_t *__pyx_v_point;
  PyObject *__pyx_v_f = NULL;
  long __pyx_v_i;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  uint32_t __pyx_t_10;
  uint32_t __pyx_t_11;
  long __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_write_index_file_v0", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":1220
 *     cdef zran.zran_point_t *point
 * 
 *     with open(dest, 'wb') as f:             # <<<<<<<<<<<<<<
 *         f.write(b'GZIDX\0\0')
 *         f.write(<bytes>(<char *>(&index.compressed_size))[:8])
*/
  /*with:*/ {
    __pyx_t_2 = NULL;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_dest, __pyx_mstate_global->__pyx_n_u_wb};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1220, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1220, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_6 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_f = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1221
 * 
 *     with open(dest, 'wb') as f:
 *         f.write(b'GZIDX\0\0')             # <<<<<<<<<<<<<<
 *         f.write(<bytes>(<char *>(&index.compressed_size))[:8])
 *         f.write(<bytes>(<char *>(&index.uncompressed_size))[:8])
*/
          __pyx_t_1 = __pyx_v_f;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_b_GZIDX};
            __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1221, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1222
 *     with open(dest, 'wb') as f:
 *         f.write(b'GZIDX\0\0')
 *         f.write(<bytes>(<char *>(&index.compressed_size))[:8])             # <<<<<<<<<<<<<<
 *         f.write(<bytes>(<char *>(&index.uncompressed_size))[:8])
 *         f.write(<bytes>(<char *>(&index.spacing))[:4])
*/
          __pyx_t_1 = __pyx_v_f;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)(&__pyx_v_index->compressed_size)) + 0, 8 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1222, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
            __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1222, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1223
 *         f.write(b'GZIDX\0\0')
 *         f.write(<bytes>(<char *>(&index.compressed_size))[:8])
 *         f.write(<bytes>(<char *>(&index.uncompressed_size))[:8])             # <<<<<<<<<<<<<<
 *         f.write(<bytes>(<char *>(&index.spacing))[:4])
 *         f.write(<bytes>(<char *>(&index.window_size))[:4])
*/
          __pyx_t_2 = __pyx_v_f;
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)(&__pyx_v_index->uncompressed_size)) + 0, 8 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
            __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1223, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1224
 *         f.write(<bytes>(<char *>(&index.compressed_size))[:8])
 *         f.write(<bytes>(<char *>(&index.uncompressed_size))[:8])
 *         f.write(<bytes>(<char *>(&index.spacing))[:4])             # <<<<<<<<<<<<<<
 *         f.write(<bytes>(<char *>(&index.window_size))[:4])
 *         f.write(<bytes>(<char *>(&index.npoints))[:4])
*/
          __pyx_t_1 = __pyx_v_f;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)(&__pyx_v_index->spacing)) + 0, 4 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
            __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1224, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1225
 *         f.write(<bytes>(<char *>(&index.uncompressed_size))[:8])
 *         f.write(<bytes>(<char *>(&index.spacing))[:4])
 *         f.write(<bytes>(<char *>(&index.window_size))[:4])             # <<<<<<<<<<<<<<
 *         f.write(<bytes>(<char *>(&index.npoints))[:4])
 * 
*/
          __pyx_t_2 = __pyx_v_f;
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)(&__pyx_v_index->window_size)) + 0, 4 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
            __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1225, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1226
 *         f.write(<bytes>(<char *>(&index.spacing))[:4])
 *         f.write(<bytes>(<char *>(&index.window_size))[:4])
 *         f.write(<bytes>(<char *>(&index.npoints))[:4])             # <<<<<<<<<<<<<<
 * 
 *         for i in range(index.npoints):
*/
          __pyx_t_1 = __pyx_v_f;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)(&__pyx_v_index->npoints)) + 0, 4 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
            __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1228
 *         f.write(<bytes>(<char *>(&index.npoints))[:4])
 * 
 *         for i in range(index.npoints):             # <<<<<<<<<<<<<<
 *             point = &index.list[i]
 *             f.write(<bytes>(<char *>(&point.cmp_offset))[:8])
*/
          __pyx_t_10 = __pyx_v_index->npoints;
          __pyx_t_11 = __pyx_t_10;
          for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
            __pyx_v_i = __pyx_t_12;

            /* "indexed_gzip/tests/ctest_zran.pyx":1229
 * 
 *         for i in range(index.npoints):
 *             point = &index.list[i]             # <<<<<<<<<<<<<<
 *             f.write(<bytes>(<char *>(&point.cmp_offset))[:8])
 *             f.write(<bytes>(<char *>(&point.uncmp_offset))[:8])
*/
            __pyx_v_point = (&(__pyx_v_index->list[__pyx_v_i]));

            /* "indexed_gzip/tests/ctest_zran.pyx":1230
 *         for i in range(index.npoints):
 *             point = &index.list[i]
 *             f.write(<bytes>(<char *>(&point.cmp_offset))[:8])             # <<<<<<<<<<<<<<
 *             f.write(<bytes>(<char *>(&point.uncmp_offset))[:8])
 *             f.write(<bytes>(<char *>(&point.bits))[:1])
*/
            __pyx_t_2 = __pyx_v_f;
            __Pyx_INCREF(__pyx_t_2);
            __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)(&__pyx_v_point->cmp_offset)) + 0, 8 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
              __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1230, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_6);
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":1231
 *             point = &index.list[i]
 *             f.write(<bytes>(<char *>(&point.cmp_offset))[:8])
 *             f.write(<bytes>(<char *>(&point.uncmp_offset))[:8])             # <<<<<<<<<<<<<<
 *             f.write(<bytes>(<char *>(&point.bits))[:1])
 * 
*/
            __pyx_t_1 = __pyx_v_f;
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)(&__pyx_v_point->uncmp_offset)) + 0, 8 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1231, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
              __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1231, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_6);
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":1232
 *             f.write(<bytes>(<char *>(&point.cmp_offset))[:8])
 *             f.write(<bytes>(<char *>(&point.uncmp_offset))[:8])
 *             f.write(<bytes>(<char *>(&point.bits))[:1])             # <<<<<<<<<<<<<<
 * 
 *         for i in range(1, index.npoints):
*/
            __pyx_t_2 = __pyx_v_f;
            __Pyx_INCREF(__pyx_t_2);
            __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)(&__pyx_v_point->bits)) + 0, 1 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
              __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1232, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_6);
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1234
 *             f.write(<bytes>(<char *>(&point.bits))[:1])
 * 
 *         for i in range(1, index.npoints):             # <<<<<<<<<<<<<<
 *             point = &index.list[i]
 *             data  = <bytes>point.data[:index.window_size]
*/
          __pyx_t_10 = __pyx_v_index->npoints;
          __pyx_t_11 = __pyx_t_10;
          for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
            __pyx_v_i = __pyx_t_12;

            /* "indexed_gzip/tests/ctest_zran.pyx":1235
 * 
 *         for i in range(1, index.npoints):
 *             point = &index.list[i]             # <<<<<<<<<<<<<<
 *             data  = <bytes>point.data[:index.window_size]
 *             f.write(data)
*/
            __pyx_v_point = (&(__pyx_v_index->list[__pyx_v_i]));

            /* "indexed_gzip/tests/ctest_zran.pyx":1236
 *         for i in range(1, index.npoints):
 *             point = &index.list[i]
 *             data  = <bytes>point.data[:index.window_size]             # <<<<<<<<<<<<<<
 *             f.write(data)
 * 
*/
            __pyx_t_6 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_point->data) + 0, __pyx_v_index->window_size - 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1236, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_1 = __pyx_t_6;
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF_SET(__pyx_v_data, ((PyObject*)__pyx_t_1));
            __pyx_t_1 = 0;

            /* "indexed_gzip/tests/ctest_zran.pyx":1237
 *             point = &index.list[i]
 *             data  = <bytes>point.data[:index.window_size]
 *             f.write(data)             # <<<<<<<<<<<<<<
 * 
 * 
*/
            __pyx_t_6 = __pyx_v_f;
            __Pyx_INCREF(__pyx_t_6);
            __pyx_t_3 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_data};
              __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1220
 *     cdef zran.zran_point_t *point
 * 
 *     with open(dest, 'wb') as f:             # <<<<<<<<<<<<<<
 *         f.write(b'GZIDX\0\0')
 *         f.write(<bytes>(<char *>(&index.compressed_size))[:8])
*/
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran._write_index_file_v0", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(0, 1220, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_2);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1220, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1220, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (__pyx_t_14 < (0)) __PYX_ERR(0, 1220, __pyx_L9_except_error)
          __pyx_t_15 = (!__pyx_t_14);
          if (unlikely(__pyx_t_15)) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_6, __pyx_t_2);
            __pyx_t_1 = 0;  __pyx_t_6 = 0;  __pyx_t_2 = 0; 
            __PYX_ERR(0, 1220, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_4) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1220, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L20;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1215
 * 
 * 
 * cdef _write_index_file_v0(zran.zran_index_t *index, dest):             # <<<<<<<<<<<<<<
 *     """Write the given index out to a file, index file version 0 format. """
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran._write_index_file_v0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1240
 * 
 * 
 * def test_crc_validation(concat, seed):             # <<<<<<<<<<<<<<
 *     """Basic test of CRC validation. """
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_59test_crc_validation(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_12indexed_gzip_5tests_10ctest_zran_58test_crc_validation, "Basic test of CRC validation. ");
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_59test_crc_validation = {"test_crc_validation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_59test_crc_validation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_58test_crc_validation};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_59test_crc_validation(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_concat = 0;
  CYTHON_UNUSED PyObject *__pyx_v_seed = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_crc_validation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_concat,&__pyx_mstate_global->__pyx_n_u_seed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1240, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1240, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1240, __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, "test_crc_validation", 0) < (0)) __PYX_ERR(0, 1240, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_crc_validation", 1, 2, 2, i); __PYX_ERR(0, 1240, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1240, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1240, __pyx_L3_error)
    }
    __pyx_v_concat = values[0];
    __pyx_v_seed = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_crc_validation", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1240, __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("indexed_gzip.tests.ctest_zran.test_crc_validation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_58test_crc_validation(__pyx_self, __pyx_v_concat, __pyx_v_seed);

  /* 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;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1253
 *     cmpdata, strmoffs = compress_inmem(rawdata.tobytes(), concat)
 * 
 *     def _zran_init(data, flags):             # <<<<<<<<<<<<<<
 *         f = BytesIO(data)
 *         assert not zran.zran_init(&index,
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_1_zran_init(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_1_zran_init = {"_zran_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_1_zran_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_1_zran_init(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_flags = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_zran_init (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_flags,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1253, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1253, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1253, __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, "_zran_init", 0) < (0)) __PYX_ERR(0, 1253, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_zran_init", 1, 2, 2, i); __PYX_ERR(0, 1253, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1253, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1253, __pyx_L3_error)
    }
    __pyx_v_data = values[0];
    __pyx_v_flags = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_zran_init", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1253, __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("indexed_gzip.tests.ctest_zran.test_crc_validation._zran_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation__zran_init(__pyx_self, __pyx_v_data, __pyx_v_flags);

  /* 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_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation__zran_init(PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_flags) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *__pyx_cur_scope;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *__pyx_outer_scope;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  uint16_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_zran_init", 0);
  __pyx_outer_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "indexed_gzip/tests/ctest_zran.pyx":1254
 * 
 *     def _zran_init(data, flags):
 *         f = BytesIO(data)             # <<<<<<<<<<<<<<
 *         assert not zran.zran_init(&index,
 *                                   NULL,
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1255
 *     def _zran_init(data, flags):
 *         f = BytesIO(data)
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL,
 *                                   <PyObject*>f,
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {

    /* "indexed_gzip/tests/ctest_zran.pyx":1261
 *                                   32768,
 *                                   131072,
 *                                   flags)             # <<<<<<<<<<<<<<
 *         return f
 * 
*/
    __pyx_t_5 = __Pyx_PyLong_As_uint16_t(__pyx_v_flags); if (unlikely((__pyx_t_5 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1261, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":1255
 *     def _zran_init(data, flags):
 *         f = BytesIO(data)
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL,
 *                                   <PyObject*>f,
*/
    __pyx_t_6 = (!(zran_init((&__pyx_cur_scope->__pyx_v_index), NULL, ((PyObject *)__pyx_v_f), 0x100000, 0x8000, 0x20000, __pyx_t_5) != 0));
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 1255, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1255, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1262
 *                                   131072,
 *                                   flags)
 *         return f             # <<<<<<<<<<<<<<
 * 
 *     def _run_crc_tests(data, shouldpass, flags=zran.ZRAN_AUTO_BUILD):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_f);
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1253
 *     cmpdata, strmoffs = compress_inmem(rawdata.tobytes(), concat)
 * 
 *     def _zran_init(data, flags):             # <<<<<<<<<<<<<<
 *         f = BytesIO(data)
 *         assert not zran.zran_init(&index,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_crc_validation._zran_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1264
 *         return f
 * 
 *     def _run_crc_tests(data, shouldpass, flags=zran.ZRAN_AUTO_BUILD):             # <<<<<<<<<<<<<<
 *         if shouldpass:
 *             expect_build = zran.ZRAN_BUILD_INDEX_OK
*/

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_68__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 1264, __pyx_L1_error);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1264, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 1264, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_3_run_crc_tests(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_3_run_crc_tests = {"_run_crc_tests", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_3_run_crc_tests, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_3_run_crc_tests(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_shouldpass = 0;
  PyObject *__pyx_v_flags = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_run_crc_tests (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_shouldpass,&__pyx_mstate_global->__pyx_n_u_flags,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1264, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1264, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1264, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1264, __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, "_run_crc_tests", 0) < (0)) __PYX_ERR(0, 1264, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_run_crc_tests", 0, 2, 3, i); __PYX_ERR(0, 1264, __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(0, 1264, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1264, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1264, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
    }
    __pyx_v_data = values[0];
    __pyx_v_shouldpass = values[1];
    __pyx_v_flags = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_run_crc_tests", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1264, __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("indexed_gzip.tests.ctest_zran.test_crc_validation._run_crc_tests", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_2_run_crc_tests(__pyx_self, __pyx_v_data, __pyx_v_shouldpass, __pyx_v_flags);

  /* 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_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_2_run_crc_tests(PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_shouldpass, PyObject *__pyx_v_flags) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *__pyx_cur_scope;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *__pyx_outer_scope;
  int __pyx_v_expect_build;
  int __pyx_v_expect_seek;
  PyObject *__pyx_v_expect_read = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_f = NULL;
  int64_t __pyx_v_ret;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_buf = NULL;
  void *__pyx_v_buffer;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int64_t __pyx_t_4;
  size_t __pyx_t_5;
  void *__pyx_t_6;
  uint64_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_run_crc_tests", 0);
  __pyx_outer_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "indexed_gzip/tests/ctest_zran.pyx":1265
 * 
 *     def _run_crc_tests(data, shouldpass, flags=zran.ZRAN_AUTO_BUILD):
 *         if shouldpass:             # <<<<<<<<<<<<<<
 *             expect_build = zran.ZRAN_BUILD_INDEX_OK
 *             expect_seek  = zran.ZRAN_SEEK_OK
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shouldpass); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "indexed_gzip/tests/ctest_zran.pyx":1266
 *     def _run_crc_tests(data, shouldpass, flags=zran.ZRAN_AUTO_BUILD):
 *         if shouldpass:
 *             expect_build = zran.ZRAN_BUILD_INDEX_OK             # <<<<<<<<<<<<<<
 *             expect_seek  = zran.ZRAN_SEEK_OK
 *             expect_read  = dsize
*/
    __pyx_v_expect_build = ZRAN_BUILD_INDEX_OK;

    /* "indexed_gzip/tests/ctest_zran.pyx":1267
 *         if shouldpass:
 *             expect_build = zran.ZRAN_BUILD_INDEX_OK
 *             expect_seek  = zran.ZRAN_SEEK_OK             # <<<<<<<<<<<<<<
 *             expect_read  = dsize
 *         else:
*/
    __pyx_v_expect_seek = ZRAN_SEEK_OK;

    /* "indexed_gzip/tests/ctest_zran.pyx":1268
 *             expect_build = zran.ZRAN_BUILD_INDEX_OK
 *             expect_seek  = zran.ZRAN_SEEK_OK
 *             expect_read  = dsize             # <<<<<<<<<<<<<<
 *         else:
 *             expect_build = zran.ZRAN_BUILD_INDEX_CRC_ERROR
*/
    if (unlikely(!__pyx_cur_scope->__pyx_v_dsize)) { __Pyx_RaiseClosureNameError("dsize"); __PYX_ERR(0, 1268, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dsize);
    __pyx_v_expect_read = __pyx_cur_scope->__pyx_v_dsize;

    /* "indexed_gzip/tests/ctest_zran.pyx":1265
 * 
 *     def _run_crc_tests(data, shouldpass, flags=zran.ZRAN_AUTO_BUILD):
 *         if shouldpass:             # <<<<<<<<<<<<<<
 *             expect_build = zran.ZRAN_BUILD_INDEX_OK
 *             expect_seek  = zran.ZRAN_SEEK_OK
*/
    goto __pyx_L3;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1270
 *             expect_read  = dsize
 *         else:
 *             expect_build = zran.ZRAN_BUILD_INDEX_CRC_ERROR             # <<<<<<<<<<<<<<
 *             expect_seek  = zran.ZRAN_SEEK_CRC_ERROR
 *             expect_read  = zran.ZRAN_READ_CRC_ERROR
*/
  /*else*/ {
    __pyx_v_expect_build = ZRAN_BUILD_INDEX_CRC_ERROR;

    /* "indexed_gzip/tests/ctest_zran.pyx":1271
 *         else:
 *             expect_build = zran.ZRAN_BUILD_INDEX_CRC_ERROR
 *             expect_seek  = zran.ZRAN_SEEK_CRC_ERROR             # <<<<<<<<<<<<<<
 *             expect_read  = zran.ZRAN_READ_CRC_ERROR
 * 
*/
    __pyx_v_expect_seek = ZRAN_SEEK_CRC_ERROR;

    /* "indexed_gzip/tests/ctest_zran.pyx":1272
 *             expect_build = zran.ZRAN_BUILD_INDEX_CRC_ERROR
 *             expect_seek  = zran.ZRAN_SEEK_CRC_ERROR
 *             expect_read  = zran.ZRAN_READ_CRC_ERROR             # <<<<<<<<<<<<<<
 * 
 *         # CRC validation should occur on the first
*/
    __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(ZRAN_READ_CRC_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_expect_read = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "indexed_gzip/tests/ctest_zran.pyx":1288
 *         # and on the constants used in
 *         # _zran_estimate_offset
 *         f   = _zran_init(data, flags)             # <<<<<<<<<<<<<<
 *         ret = zran.zran_build_index(&index, 0, 0)
 *         assert ret == expect_build, ret
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v__zran_init)) { __Pyx_RaiseClosureNameError("_zran_init"); __PYX_ERR(0, 1288, __pyx_L1_error) }
  __pyx_t_2 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation__zran_init(__pyx_cur_scope->__pyx_v__zran_init, __pyx_v_data, __pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_f = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1289
 *         # _zran_estimate_offset
 *         f   = _zran_init(data, flags)
 *         ret = zran.zran_build_index(&index, 0, 0)             # <<<<<<<<<<<<<<
 *         assert ret == expect_build, ret
 *         zran.zran_free(&index)
*/
  __pyx_v_ret = zran_build_index((&__pyx_cur_scope->__pyx_v_index), 0, 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":1290
 *         f   = _zran_init(data, flags)
 *         ret = zran.zran_build_index(&index, 0, 0)
 *         assert ret == expect_build, ret             # <<<<<<<<<<<<<<
 *         zran.zran_free(&index)
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_ret == __pyx_v_expect_build);
    if (unlikely(!__pyx_t_1)) {
      __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_3, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1290, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1290, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1291
 *         ret = zran.zran_build_index(&index, 0, 0)
 *         assert ret == expect_build, ret
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *         # error if we try to seek
*/
  zran_free((&__pyx_cur_scope->__pyx_v_index));

  /* "indexed_gzip/tests/ctest_zran.pyx":1294
 * 
 *         # error if we try to seek
 *         f   = _zran_init(data, flags)             # <<<<<<<<<<<<<<
 *         ret = zran.zran_seek(&index, dsize - 1, SEEK_SET, NULL)
 *         assert ret == expect_seek, ret
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v__zran_init)) { __Pyx_RaiseClosureNameError("_zran_init"); __PYX_ERR(0, 1294, __pyx_L1_error) }
  __pyx_t_3 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation__zran_init(__pyx_cur_scope->__pyx_v__zran_init, __pyx_v_data, __pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1295
 *         # error if we try to seek
 *         f   = _zran_init(data, flags)
 *         ret = zran.zran_seek(&index, dsize - 1, SEEK_SET, NULL)             # <<<<<<<<<<<<<<
 *         assert ret == expect_seek, ret
 *         zran.zran_free(&index)
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v_dsize)) { __Pyx_RaiseClosureNameError("dsize"); __PYX_ERR(0, 1295, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyLong_SubtractObjC(__pyx_cur_scope->__pyx_v_dsize, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ret = zran_seek((&__pyx_cur_scope->__pyx_v_index), __pyx_t_4, SEEK_SET, NULL);

  /* "indexed_gzip/tests/ctest_zran.pyx":1296
 *         f   = _zran_init(data, flags)
 *         ret = zran.zran_seek(&index, dsize - 1, SEEK_SET, NULL)
 *         assert ret == expect_seek, ret             # <<<<<<<<<<<<<<
 *         zran.zran_free(&index)
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_ret == __pyx_v_expect_seek);
    if (unlikely(!__pyx_t_1)) {
      __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_2, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1296, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1296, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1297
 *         ret = zran.zran_seek(&index, dsize - 1, SEEK_SET, NULL)
 *         assert ret == expect_seek, ret
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *         # error if we try to read
*/
  zran_free((&__pyx_cur_scope->__pyx_v_index));

  /* "indexed_gzip/tests/ctest_zran.pyx":1300
 * 
 *         # error if we try to read
 *         buf    = ReadBuffer(dsize)             # <<<<<<<<<<<<<<
 *         buffer = buf.buffer
 *         f      = _zran_init(data, flags)
*/
  __pyx_t_3 = NULL;
  if (unlikely(!__pyx_cur_scope->__pyx_v_dsize)) { __Pyx_RaiseClosureNameError("dsize"); __PYX_ERR(0, 1300, __pyx_L1_error) }
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_dsize};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, __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;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_buf = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1301
 *         # error if we try to read
 *         buf    = ReadBuffer(dsize)
 *         buffer = buf.buffer             # <<<<<<<<<<<<<<
 *         f      = _zran_init(data, flags)
 *         ret    = zran.zran_read(&index, buffer, dsize)
*/
  __pyx_t_6 = __pyx_v_buf->buffer;
  __pyx_v_buffer = __pyx_t_6;

  /* "indexed_gzip/tests/ctest_zran.pyx":1302
 *         buf    = ReadBuffer(dsize)
 *         buffer = buf.buffer
 *         f      = _zran_init(data, flags)             # <<<<<<<<<<<<<<
 *         ret    = zran.zran_read(&index, buffer, dsize)
 *         assert ret == expect_read, ret
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v__zran_init)) { __Pyx_RaiseClosureNameError("_zran_init"); __PYX_ERR(0, 1302, __pyx_L1_error) }
  __pyx_t_2 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation__zran_init(__pyx_cur_scope->__pyx_v__zran_init, __pyx_v_data, __pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1303
 *         buffer = buf.buffer
 *         f      = _zran_init(data, flags)
 *         ret    = zran.zran_read(&index, buffer, dsize)             # <<<<<<<<<<<<<<
 *         assert ret == expect_read, ret
 *         zran.zran_free(&index)
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v_dsize)) { __Pyx_RaiseClosureNameError("dsize"); __PYX_ERR(0, 1303, __pyx_L1_error) }
  __pyx_t_7 = __Pyx_PyLong_As_uint64_t(__pyx_cur_scope->__pyx_v_dsize); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1303, __pyx_L1_error)
  __pyx_v_ret = zran_read((&__pyx_cur_scope->__pyx_v_index), __pyx_v_buffer, __pyx_t_7);

  /* "indexed_gzip/tests/ctest_zran.pyx":1304
 *         f      = _zran_init(data, flags)
 *         ret    = zran.zran_read(&index, buffer, dsize)
 *         assert ret == expect_read, ret             # <<<<<<<<<<<<<<
 *         zran.zran_free(&index)
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_expect_read, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) {
      __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_2, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1304, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1304, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1305
 *         ret    = zran.zran_read(&index, buffer, dsize)
 *         assert ret == expect_read, ret
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *         if shouldpass:
*/
  zran_free((&__pyx_cur_scope->__pyx_v_index));

  /* "indexed_gzip/tests/ctest_zran.pyx":1307
 *         zran.zran_free(&index)
 * 
 *         if shouldpass:             # <<<<<<<<<<<<<<
 *             pybuf = <bytes>(<char *>buffer)[:dsize]
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint32) == rawdata)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shouldpass); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1307, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "indexed_gzip/tests/ctest_zran.pyx":1308
 * 
 *         if shouldpass:
 *             pybuf = <bytes>(<char *>buffer)[:dsize]             # <<<<<<<<<<<<<<
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint32) == rawdata)
 * 
*/
    if (unlikely(!__pyx_cur_scope->__pyx_v_dsize)) { __Pyx_RaiseClosureNameError("dsize"); __PYX_ERR(0, 1308, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dsize);
    __pyx_t_2 = __pyx_cur_scope->__pyx_v_dsize;
    __pyx_t_1 = (__pyx_t_2 == Py_None);
    if (__pyx_t_1) {
      __pyx_t_8 = PY_SSIZE_T_MAX;
    } else {
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1308, __pyx_L1_error)
      __pyx_t_8 = __pyx_t_9;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_buffer) + 0, __pyx_t_8 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_pybuf = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1309
 *         if shouldpass:
 *             pybuf = <bytes>(<char *>buffer)[:dsize]
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint32) == rawdata)             # <<<<<<<<<<<<<<
 * 
 *     def wrap(val):
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_all); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_12 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_frombuffer); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_uint32); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
        assert(__pyx_t_12);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_12, __pyx_v_pybuf};
        __pyx_t_13 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_15, __pyx_t_13, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1309, __pyx_L1_error)
        __pyx_t_10 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      if (unlikely(!__pyx_cur_scope->__pyx_v_rawdata)) { __Pyx_RaiseClosureNameError("rawdata"); __PYX_ERR(0, 1309, __pyx_L1_error) }
      __pyx_t_14 = PyObject_RichCompare(__pyx_t_10, __pyx_cur_scope->__pyx_v_rawdata, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_14};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __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_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 1309, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1309, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":1307
 *         zran.zran_free(&index)
 * 
 *         if shouldpass:             # <<<<<<<<<<<<<<
 *             pybuf = <bytes>(<char *>buffer)[:dsize]
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint32) == rawdata)
*/
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1264
 *         return f
 * 
 *     def _run_crc_tests(data, shouldpass, flags=zran.ZRAN_AUTO_BUILD):             # <<<<<<<<<<<<<<
 *         if shouldpass:
 *             expect_build = zran.ZRAN_BUILD_INDEX_OK
*/

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_crc_validation._run_crc_tests", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expect_read);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1311
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint32) == rawdata)
 * 
 *     def wrap(val):             # <<<<<<<<<<<<<<
 *         return val % 255
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_5wrap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_5wrap = {"wrap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_5wrap, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_5wrap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_val = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrap (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1311, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1311, __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, "wrap", 0) < (0)) __PYX_ERR(0, 1311, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("wrap", 1, 1, 1, i); __PYX_ERR(0, 1311, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1311, __pyx_L3_error)
    }
    __pyx_v_val = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wrap", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1311, __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("indexed_gzip.tests.ctest_zran.test_crc_validation.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_4wrap(__pyx_self, __pyx_v_val);

  /* 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_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_4wrap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val) {
  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("wrap", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":1312
 * 
 *     def wrap(val):
 *         return val % 255             # <<<<<<<<<<<<<<
 * 
 *     # data/crc is good, all should be well
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_RemainderObjC(__pyx_v_val, __pyx_mstate_global->__pyx_int_255, 0xFF, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1311
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint32) == rawdata)
 * 
 *     def wrap(val):             # <<<<<<<<<<<<<<
 *         return val % 255
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_crc_validation.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1240
 * 
 * 
 * def test_crc_validation(concat, seed):             # <<<<<<<<<<<<<<
 *     """Basic test of CRC validation. """
 * 
*/

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_58test_crc_validation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_concat, CYTHON_UNUSED PyObject *__pyx_v_seed) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *__pyx_cur_scope;
  PyObject *__pyx_v_cmpdata = NULL;
  PyObject *__pyx_v_strmoffs = NULL;
  PyObject *__pyx_v__run_crc_tests = 0;
  PyObject *__pyx_v_wrap = 0;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_off = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_crc_validation", 0);
  __pyx_cur_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation(__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1240, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1249
 *     # use uint32 so there are lots of zeros,
 *     # and so there is something to compress
 *     dsize             = 1048576 * 10             # <<<<<<<<<<<<<<
 *     rawdata           = np.random.randint(0, 255, dsize // 4, dtype=np.uint32)
 *     cmpdata, strmoffs = compress_inmem(rawdata.tobytes(), concat)
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_10485760);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_10485760);
  __pyx_cur_scope->__pyx_v_dsize = __pyx_mstate_global->__pyx_int_10485760;

  /* "indexed_gzip/tests/ctest_zran.pyx":1250
 *     # and so there is something to compress
 *     dsize             = 1048576 * 10
 *     rawdata           = np.random.randint(0, 255, dsize // 4, dtype=np.uint32)             # <<<<<<<<<<<<<<
 *     cmpdata, strmoffs = compress_inmem(rawdata.tobytes(), concat)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_FloorDivideObjC(__pyx_cur_scope->__pyx_v_dsize, __pyx_mstate_global->__pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_255, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+4, 0) < (0)) __PYX_ERR(0, 1250, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_rawdata = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1251
 *     dsize             = 1048576 * 10
 *     rawdata           = np.random.randint(0, 255, dsize // 4, dtype=np.uint32)
 *     cmpdata, strmoffs = compress_inmem(rawdata.tobytes(), concat)             # <<<<<<<<<<<<<<
 * 
 *     def _zran_init(data, flags):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_compress_inmem); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_rawdata;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tobytes, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_6, __pyx_v_concat};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (3-__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;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1251, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
    }
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < (0)) __PYX_ERR(0, 1251, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1251, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_cmpdata = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_strmoffs = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1253
 *     cmpdata, strmoffs = compress_inmem(rawdata.tobytes(), concat)
 * 
 *     def _zran_init(data, flags):             # <<<<<<<<<<<<<<
 *         f = BytesIO(data)
 *         assert not zran.zran_init(&index,
*/
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_1_zran_init, 0, __pyx_mstate_global->__pyx_n_u_test_crc_validation_locals__zran, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v__zran_init = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1264
 *         return f
 * 
 *     def _run_crc_tests(data, shouldpass, flags=zran.ZRAN_AUTO_BUILD):             # <<<<<<<<<<<<<<
 *         if shouldpass:
 *             expect_build = zran.ZRAN_BUILD_INDEX_OK
*/
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_3_run_crc_tests, 0, __pyx_mstate_global->__pyx_n_u_test_crc_validation_locals__run, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyLong_From___pyx_anon_enum(ZRAN_AUTO_BUILD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_1)->arg0 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_12indexed_gzip_5tests_10ctest_zran_68__defaults__);
  __pyx_v__run_crc_tests = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1311
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint32) == rawdata)
 * 
 *     def wrap(val):             # <<<<<<<<<<<<<<
 *         return val % 255
 * 
*/
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_5wrap, 0, __pyx_mstate_global->__pyx_n_u_test_crc_validation_locals_wrap, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wrap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1315
 * 
 *     # data/crc is good, all should be well
 *     _run_crc_tests(cmpdata, True)             # <<<<<<<<<<<<<<
 * 
 *     # corrupt the size, we should get an error
*/
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_cmpdata);
  __Pyx_GIVEREF(__pyx_v_cmpdata);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cmpdata) != (0)) __PYX_ERR(0, 1315, __pyx_L1_error);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_True) != (0)) __PYX_ERR(0, 1315, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v__run_crc_tests, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1318
 * 
 *     # corrupt the size, we should get an error
 *     data     = cmpdata.copy()             # <<<<<<<<<<<<<<
 *     data[-1] = wrap(data[-1] + 1)  # corrupt size
 *     _run_crc_tests(data, False)
*/
  __pyx_t_1 = __pyx_v_cmpdata;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_v_data = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1319
 *     # corrupt the size, we should get an error
 *     data     = cmpdata.copy()
 *     data[-1] = wrap(data[-1] + 1)  # corrupt size             # <<<<<<<<<<<<<<
 *     _run_crc_tests(data, False)
 * 
*/
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_data, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_t_6, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_4wrap(__pyx_v_wrap, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely((__Pyx_SetItemInt(__pyx_v_data, -1L, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1320
 *     data     = cmpdata.copy()
 *     data[-1] = wrap(data[-1] + 1)  # corrupt size
 *     _run_crc_tests(data, False)             # <<<<<<<<<<<<<<
 * 
 *     # corrupt the crc, we should get an error
*/
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_data) != (0)) __PYX_ERR(0, 1320, __pyx_L1_error);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, Py_False) != (0)) __PYX_ERR(0, 1320, __pyx_L1_error);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v__run_crc_tests, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1323
 * 
 *     # corrupt the crc, we should get an error
 *     data     = cmpdata.copy()             # <<<<<<<<<<<<<<
 *     data[-5] = wrap(data[-5] + 1)  # corrupt crc
 *     _run_crc_tests(data, False)
*/
  __pyx_t_6 = __pyx_v_cmpdata;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __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_1)) __PYX_ERR(0, 1323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1324
 *     # corrupt the crc, we should get an error
 *     data     = cmpdata.copy()
 *     data[-5] = wrap(data[-5] + 1)  # corrupt crc             # <<<<<<<<<<<<<<
 *     _run_crc_tests(data, False)
 * 
*/
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, -5L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_4wrap(__pyx_v_wrap, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely((__Pyx_SetItemInt(__pyx_v_data, -5L, __pyx_t_1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1325
 *     data     = cmpdata.copy()
 *     data[-5] = wrap(data[-5] + 1)  # corrupt crc
 *     _run_crc_tests(data, False)             # <<<<<<<<<<<<<<
 * 
 *     # Corrupt a different stream, if we have more than one
*/
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data) != (0)) __PYX_ERR(0, 1325, __pyx_L1_error);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_False) != (0)) __PYX_ERR(0, 1325, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v__run_crc_tests, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1328
 * 
 *     # Corrupt a different stream, if we have more than one
 *     if len(strmoffs) > 1:             # <<<<<<<<<<<<<<
 *         for off in strmoffs[1:]:
 *             data        = cmpdata.copy()
*/
  __pyx_t_9 = PyObject_Length(__pyx_v_strmoffs); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1328, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_9 > 1);
  if (__pyx_t_10) {

    /* "indexed_gzip/tests/ctest_zran.pyx":1329
 *     # Corrupt a different stream, if we have more than one
 *     if len(strmoffs) > 1:
 *         for off in strmoffs[1:]:             # <<<<<<<<<<<<<<
 *             data        = cmpdata.copy()
 *             data[off-1] = wrap(data[off-1] + 1)
*/
    __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_strmoffs, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_9 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1329, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1329, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1329, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9));
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1329, __pyx_L1_error)
      } else {
        __pyx_t_6 = __pyx_t_11(__pyx_t_1);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1329, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_off, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":1330
 *     if len(strmoffs) > 1:
 *         for off in strmoffs[1:]:
 *             data        = cmpdata.copy()             # <<<<<<<<<<<<<<
 *             data[off-1] = wrap(data[off-1] + 1)
 *             _run_crc_tests(data, False)
*/
      __pyx_t_5 = __pyx_v_cmpdata;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":1331
 *         for off in strmoffs[1:]:
 *             data        = cmpdata.copy()
 *             data[off-1] = wrap(data[off-1] + 1)             # <<<<<<<<<<<<<<
 *             _run_crc_tests(data, False)
 * 
*/
      __pyx_t_6 = __Pyx_PyLong_SubtractObjC(__pyx_v_off, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1331, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1331, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1331, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_4wrap(__pyx_v_wrap, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1331, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyLong_SubtractObjC(__pyx_v_off, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1331, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely((PyObject_SetItem(__pyx_v_data, __pyx_t_6, __pyx_t_5) < 0))) __PYX_ERR(0, 1331, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":1332
 *             data        = cmpdata.copy()
 *             data[off-1] = wrap(data[off-1] + 1)
 *             _run_crc_tests(data, False)             # <<<<<<<<<<<<<<
 * 
 *     # Disable CRC, all should be well, even with a corrupt CRC/size
*/
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_data) != (0)) __PYX_ERR(0, 1332, __pyx_L1_error);
      __Pyx_INCREF(Py_False);
      __Pyx_GIVEREF(Py_False);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, Py_False) != (0)) __PYX_ERR(0, 1332, __pyx_L1_error);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v__run_crc_tests, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":1329
 *     # Corrupt a different stream, if we have more than one
 *     if len(strmoffs) > 1:
 *         for off in strmoffs[1:]:             # <<<<<<<<<<<<<<
 *             data        = cmpdata.copy()
 *             data[off-1] = wrap(data[off-1] + 1)
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1328
 * 
 *     # Corrupt a different stream, if we have more than one
 *     if len(strmoffs) > 1:             # <<<<<<<<<<<<<<
 *         for off in strmoffs[1:]:
 *             data        = cmpdata.copy()
*/
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1336
 *     # Disable CRC, all should be well, even with a corrupt CRC/size
 *     # First test with good data
 *     data = cmpdata.copy()             # <<<<<<<<<<<<<<
 *     _run_crc_tests(data, True, zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK)
 * 
*/
  __pyx_t_6 = __pyx_v_cmpdata;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __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_1)) __PYX_ERR(0, 1336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1337
 *     # First test with good data
 *     data = cmpdata.copy()
 *     _run_crc_tests(data, True, zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK)             # <<<<<<<<<<<<<<
 * 
 *     data     = cmpdata.copy()
*/
  __pyx_t_1 = __Pyx_PyLong_From_int((ZRAN_AUTO_BUILD | ZRAN_SKIP_CRC_CHECK)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_2_run_crc_tests(__pyx_v__run_crc_tests, __pyx_v_data, Py_True, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1339
 *     _run_crc_tests(data, True, zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK)
 * 
 *     data     = cmpdata.copy()             # <<<<<<<<<<<<<<
 *     data[-1] = wrap(data[-1] + 1)  # corrupt size
 *     _run_crc_tests(data, True, zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK)
*/
  __pyx_t_1 = __pyx_v_cmpdata;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1340
 * 
 *     data     = cmpdata.copy()
 *     data[-1] = wrap(data[-1] + 1)  # corrupt size             # <<<<<<<<<<<<<<
 *     _run_crc_tests(data, True, zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK)
 * 
*/
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_data, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_t_6, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_4wrap(__pyx_v_wrap, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely((__Pyx_SetItemInt(__pyx_v_data, -1L, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1341
 *     data     = cmpdata.copy()
 *     data[-1] = wrap(data[-1] + 1)  # corrupt size
 *     _run_crc_tests(data, True, zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK)             # <<<<<<<<<<<<<<
 * 
 *     data     = cmpdata.copy()
*/
  __pyx_t_6 = __Pyx_PyLong_From_int((ZRAN_AUTO_BUILD | ZRAN_SKIP_CRC_CHECK)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_2_run_crc_tests(__pyx_v__run_crc_tests, __pyx_v_data, Py_True, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1343
 *     _run_crc_tests(data, True, zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK)
 * 
 *     data     = cmpdata.copy()             # <<<<<<<<<<<<<<
 *     data[-5] = wrap(data[-5] - 1)  # corrupt crc
 *     _run_crc_tests(data, True, zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK)
*/
  __pyx_t_6 = __pyx_v_cmpdata;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __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_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1344
 * 
 *     data     = cmpdata.copy()
 *     data[-5] = wrap(data[-5] - 1)  # corrupt crc             # <<<<<<<<<<<<<<
 *     _run_crc_tests(data, True, zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK)
 * 
*/
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, -5L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyLong_SubtractObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_4wrap(__pyx_v_wrap, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely((__Pyx_SetItemInt(__pyx_v_data, -5L, __pyx_t_1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1345
 *     data     = cmpdata.copy()
 *     data[-5] = wrap(data[-5] - 1)  # corrupt crc
 *     _run_crc_tests(data, True, zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_From_int((ZRAN_AUTO_BUILD | ZRAN_SKIP_CRC_CHECK)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_19test_crc_validation_2_run_crc_tests(__pyx_v__run_crc_tests, __pyx_v_data, Py_True, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1240
 * 
 * 
 * def test_crc_validation(concat, seed):             # <<<<<<<<<<<<<<
 *     """Basic test of CRC validation. """
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_crc_validation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cmpdata);
  __Pyx_XDECREF(__pyx_v_strmoffs);
  __Pyx_XDECREF(__pyx_v__run_crc_tests);
  __Pyx_XDECREF(__pyx_v_wrap);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_off);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1348
 * 
 * 
 * def test_standard_usage_with_null_padding(concat):             # <<<<<<<<<<<<<<
 *     """Make sure standard usage works with files that have null-padding after
 *     the GZIP footer.
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_61test_standard_usage_with_null_padding(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_12indexed_gzip_5tests_10ctest_zran_60test_standard_usage_with_null_padding, "Make sure standard usage works with files that have null-padding after\n    the GZIP footer.\n\n    See https://www.gnu.org/software/gzip/manual/gzip.html#Tapes\n    ");
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_61test_standard_usage_with_null_padding = {"test_standard_usage_with_null_padding", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_61test_standard_usage_with_null_padding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_60test_standard_usage_with_null_padding};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_61test_standard_usage_with_null_padding(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_concat = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_standard_usage_with_null_padding (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_concat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1348, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1348, __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, "test_standard_usage_with_null_padding", 0) < (0)) __PYX_ERR(0, 1348, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_standard_usage_with_null_padding", 1, 1, 1, i); __PYX_ERR(0, 1348, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1348, __pyx_L3_error)
    }
    __pyx_v_concat = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_standard_usage_with_null_padding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1348, __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("indexed_gzip.tests.ctest_zran.test_standard_usage_with_null_padding", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_60test_standard_usage_with_null_padding(__pyx_self, __pyx_v_concat);

  /* 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;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1393
 * 
 * 
 *     def _zran_init():             # <<<<<<<<<<<<<<
 *         f[0] = BytesIO(paddedcmpdata)
 *         assert not zran.zran_init(&index,
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding_1_zran_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding_1_zran_init = {"_zran_init", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding_1_zran_init, METH_NOARGS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding_1_zran_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_zran_init (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding__zran_init(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding__zran_init(PyObject *__pyx_self) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *__pyx_cur_scope;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_zran_init", 0);
  __pyx_outer_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "indexed_gzip/tests/ctest_zran.pyx":1394
 * 
 *     def _zran_init():
 *         f[0] = BytesIO(paddedcmpdata)             # <<<<<<<<<<<<<<
 *         assert not zran.zran_init(&index,
 *                                   NULL,
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(!__pyx_cur_scope->__pyx_v_paddedcmpdata)) { __Pyx_RaiseClosureNameError("paddedcmpdata"); __PYX_ERR(0, 1394, __pyx_L1_error) }
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_paddedcmpdata};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (unlikely(!__pyx_cur_scope->__pyx_v_f)) { __Pyx_RaiseClosureNameError("f"); __PYX_ERR(0, 1394, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_f == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1394, __pyx_L1_error)
  }
  if (unlikely((__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v_f, 0, __pyx_t_1, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 1394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1395
 *     def _zran_init():
 *         f[0] = BytesIO(paddedcmpdata)
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL,
 *                                   <PyObject*>f[0],
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {

    /* "indexed_gzip/tests/ctest_zran.pyx":1397
 *         assert not zran.zran_init(&index,
 *                                   NULL,
 *                                   <PyObject*>f[0],             # <<<<<<<<<<<<<<
 *                                   1048576,
 *                                   32768,
*/
    if (unlikely(!__pyx_cur_scope->__pyx_v_f)) { __Pyx_RaiseClosureNameError("f"); __PYX_ERR(0, 1397, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_v_f == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1397, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v_f, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "indexed_gzip/tests/ctest_zran.pyx":1395
 *     def _zran_init():
 *         f[0] = BytesIO(paddedcmpdata)
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL,
 *                                   <PyObject*>f[0],
*/
    __pyx_t_5 = (!(zran_init((&__pyx_cur_scope->__pyx_v_index), NULL, ((PyObject *)__pyx_t_1), 0x100000, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 1395, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1395, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1393
 * 
 * 
 *     def _zran_init():             # <<<<<<<<<<<<<<
 *         f[0] = BytesIO(paddedcmpdata)
 *         assert not zran.zran_init(&index,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_standard_usage_with_null_padding._zran_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1348
 * 
 * 
 * def test_standard_usage_with_null_padding(concat):             # <<<<<<<<<<<<<<
 *     """Make sure standard usage works with files that have null-padding after
 *     the GZIP footer.
*/

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_60test_standard_usage_with_null_padding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_concat) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *__pyx_cur_scope;
  void *__pyx_v_buffer;
  int64_t __pyx_v_ret;
  PyObject *__pyx_v_dsize = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_cmpdata = NULL;
  PyObject *__pyx_v_strmoffs = NULL;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_buf = NULL;
  PyObject *__pyx_v_padding = NULL;
  PyObject *__pyx_v_padoff = NULL;
  PyObject *__pyx_v_last = NULL;
  PyObject *__pyx_v_off = NULL;
  PyObject *__pyx_v_pad = NULL;
  PyObject *__pyx_v_strm = NULL;
  PyObject *__pyx_v__zran_init = 0;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  void *__pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  int64_t __pyx_t_17;
  uint64_t __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_standard_usage_with_null_padding", 0);
  __pyx_cur_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding(__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1348, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1360
 *     # use uint32 so there are lots of zeros,
 *     # and so there is something to compress
 *     dsize             = 1048576 * 10             # <<<<<<<<<<<<<<
 *     data              = np.random.randint(0, 255, dsize // 4, dtype=np.uint32)
 *     cmpdata, strmoffs = compress_inmem(data.tobytes(), concat)
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_10485760);
  __pyx_v_dsize = __pyx_mstate_global->__pyx_int_10485760;

  /* "indexed_gzip/tests/ctest_zran.pyx":1361
 *     # and so there is something to compress
 *     dsize             = 1048576 * 10
 *     data              = np.random.randint(0, 255, dsize // 4, dtype=np.uint32)             # <<<<<<<<<<<<<<
 *     cmpdata, strmoffs = compress_inmem(data.tobytes(), concat)
 *     buf               = ReadBuffer(dsize)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_dsize, __pyx_mstate_global->__pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_255, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+4, 0) < (0)) __PYX_ERR(0, 1361, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1362
 *     dsize             = 1048576 * 10
 *     data              = np.random.randint(0, 255, dsize // 4, dtype=np.uint32)
 *     cmpdata, strmoffs = compress_inmem(data.tobytes(), concat)             # <<<<<<<<<<<<<<
 *     buf               = ReadBuffer(dsize)
 *     buffer            = buf.buffer
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_compress_inmem); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __pyx_v_data;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tobytes, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_6, __pyx_v_concat};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (3-__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;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1362, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1362, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
    }
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < (0)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1362, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_cmpdata = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_strmoffs = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1363
 *     data              = np.random.randint(0, 255, dsize // 4, dtype=np.uint32)
 *     cmpdata, strmoffs = compress_inmem(data.tobytes(), concat)
 *     buf               = ReadBuffer(dsize)             # <<<<<<<<<<<<<<
 *     buffer            = buf.buffer
 *     f                 = [None]  # to prevent gc
*/
  __pyx_t_6 = NULL;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dsize};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, __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(0, 1363, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1364
 *     cmpdata, strmoffs = compress_inmem(data.tobytes(), concat)
 *     buf               = ReadBuffer(dsize)
 *     buffer            = buf.buffer             # <<<<<<<<<<<<<<
 *     f                 = [None]  # to prevent gc
 * 
*/
  __pyx_t_9 = __pyx_v_buf->buffer;
  __pyx_v_buffer = __pyx_t_9;

  /* "indexed_gzip/tests/ctest_zran.pyx":1365
 *     buf               = ReadBuffer(dsize)
 *     buffer            = buf.buffer
 *     f                 = [None]  # to prevent gc             # <<<<<<<<<<<<<<
 * 
 *     # random amount of padding for each stream
*/
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_None) != (0)) __PYX_ERR(0, 1365, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_f = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1368
 * 
 *     # random amount of padding for each stream
 *     padding = np.random.randint(1, 100, len(strmoffs))             # <<<<<<<<<<<<<<
 * 
 *     # new compressed data - bytearrays
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_10 = PyObject_Length(__pyx_v_strmoffs); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1368, __pyx_L1_error)
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_100, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_padding = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1372
 *     # new compressed data - bytearrays
 *     # are initialised to contain all 0s
 *     paddedcmpdata = bytearray(len(cmpdata) + padding.sum())             # <<<<<<<<<<<<<<
 * 
 *     # copy old unpadded compressed data
*/
  __pyx_t_4 = NULL;
  __pyx_t_10 = PyObject_Length(__pyx_v_cmpdata); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1372, __pyx_L1_error)
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __pyx_v_padding;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyByteArray_Type), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_paddedcmpdata = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1376
 *     # copy old unpadded compressed data
 *     # into new padded compressed data
 *     padoff = 0  # offset into padded data             # <<<<<<<<<<<<<<
 *     last   = 0  # offset to end of last copied stream in unpadded data
 *     print('Padding streams [orig size: {}] ...'.format(len(cmpdata)))
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_padoff = __pyx_mstate_global->__pyx_int_0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1377
 *     # into new padded compressed data
 *     padoff = 0  # offset into padded data
 *     last   = 0  # offset to end of last copied stream in unpadded data             # <<<<<<<<<<<<<<
 *     print('Padding streams [orig size: {}] ...'.format(len(cmpdata)))
 *     for off, pad in zip(strmoffs, padding):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_last = __pyx_mstate_global->__pyx_int_0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1378
 *     padoff = 0  # offset into padded data
 *     last   = 0  # offset to end of last copied stream in unpadded data
 *     print('Padding streams [orig size: {}] ...'.format(len(cmpdata)))             # <<<<<<<<<<<<<<
 *     for off, pad in zip(strmoffs, padding):
 * 
*/
  __pyx_t_3 = NULL;
  __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_Padding_streams_orig_size;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_10 = PyObject_Length(__pyx_v_cmpdata); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1378, __pyx_L1_error)
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1379
 *     last   = 0  # offset to end of last copied stream in unpadded data
 *     print('Padding streams [orig size: {}] ...'.format(len(cmpdata)))
 *     for off, pad in zip(strmoffs, padding):             # <<<<<<<<<<<<<<
 * 
 *         strm = cmpdata[last:off]
*/
  __pyx_t_4 = NULL;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_strmoffs, __pyx_v_padding};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1379, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1379, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_10;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1379, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10);
        #endif
        ++__pyx_t_10;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_11(__pyx_t_4);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1379, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1379, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1379, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 1379, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1379, __pyx_L1_error)
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_off, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_pad, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1381
 *     for off, pad in zip(strmoffs, padding):
 * 
 *         strm = cmpdata[last:off]             # <<<<<<<<<<<<<<
 * 
 *         paddedcmpdata[padoff:padoff + len(strm)] = strm
*/
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_cmpdata, 0, 0, &__pyx_v_last, &__pyx_v_off, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_strm, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1383
 *         strm = cmpdata[last:off]
 * 
 *         paddedcmpdata[padoff:padoff + len(strm)] = strm             # <<<<<<<<<<<<<<
 * 
 *         print('  Copied stream from [{} - {}] to [{} - {}] ({} '
*/
    __Pyx_INCREF(__pyx_v_padoff);
    __pyx_t_1 = __pyx_v_padoff;
    __pyx_t_13 = (__pyx_t_1 == Py_None);
    if (__pyx_t_13) {
      __pyx_t_12 = 0;
    } else {
      __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L1_error)
      __pyx_t_12 = __pyx_t_14;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = PyObject_Length(__pyx_v_strm); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1383, __pyx_L1_error)
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_v_padoff, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_13 = (__pyx_t_5 == Py_None);
    if (__pyx_t_13) {
      __pyx_t_14 = PY_SSIZE_T_MAX;
    } else {
      __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L1_error)
      __pyx_t_14 = __pyx_t_15;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetSlice(__pyx_cur_scope->__pyx_v_paddedcmpdata, __pyx_v_strm, __pyx_t_12, __pyx_t_14, NULL, NULL, NULL, 1, 1, 1) < (0)) __PYX_ERR(0, 1383, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":1385
 *         paddedcmpdata[padoff:padoff + len(strm)] = strm
 * 
 *         print('  Copied stream from [{} - {}] to [{} - {}] ({} '             # <<<<<<<<<<<<<<
 *               'padding bytes)'.format(
 *                   last, off, padoff, padoff + len(strm), pad))
*/
    __pyx_t_1 = NULL;

    /* "indexed_gzip/tests/ctest_zran.pyx":1386
 * 
 *         print('  Copied stream from [{} - {}] to [{} - {}] ({} '
 *               'padding bytes)'.format(             # <<<<<<<<<<<<<<
 *                   last, off, padoff, padoff + len(strm), pad))
 * 
*/
    __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_Copied_stream_from_to_padding_b;
    __Pyx_INCREF(__pyx_t_6);

    /* "indexed_gzip/tests/ctest_zran.pyx":1387
 *         print('  Copied stream from [{} - {}] to [{} - {}] ({} '
 *               'padding bytes)'.format(
 *                   last, off, padoff, padoff + len(strm), pad))             # <<<<<<<<<<<<<<
 * 
 *         padoff += len(strm) + pad
*/
    __pyx_t_14 = PyObject_Length(__pyx_v_strm); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1387, __pyx_L1_error)
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = PyNumber_Add(__pyx_v_padoff, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_6, __pyx_v_last, __pyx_v_off, __pyx_v_padoff, __pyx_t_16, __pyx_v_pad};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (6-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __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_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1389
 *                   last, off, padoff, padoff + len(strm), pad))
 * 
 *         padoff += len(strm) + pad             # <<<<<<<<<<<<<<
 *         last    = off
 * 
*/
    __pyx_t_14 = PyObject_Length(__pyx_v_strm); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1389, __pyx_L1_error)
    __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_pad); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_padoff, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_padoff, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1390
 * 
 *         padoff += len(strm) + pad
 *         last    = off             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_INCREF(__pyx_v_off);
    __Pyx_DECREF_SET(__pyx_v_last, __pyx_v_off);

    /* "indexed_gzip/tests/ctest_zran.pyx":1379
 *     last   = 0  # offset to end of last copied stream in unpadded data
 *     print('Padding streams [orig size: {}] ...'.format(len(cmpdata)))
 *     for off, pad in zip(strmoffs, padding):             # <<<<<<<<<<<<<<
 * 
 *         strm = cmpdata[last:off]
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1393
 * 
 * 
 *     def _zran_init():             # <<<<<<<<<<<<<<
 *         f[0] = BytesIO(paddedcmpdata)
 *         assert not zran.zran_init(&index,
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding_1_zran_init, 0, __pyx_mstate_global->__pyx_n_u_test_standard_usage_with_null_pa, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v__zran_init = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1403
 *                                   zran.ZRAN_AUTO_BUILD)
 * 
 *     _zran_init()             # <<<<<<<<<<<<<<
 *     ret = zran.zran_build_index(&index, 0, 0)
 *     assert ret == zran.ZRAN_BUILD_INDEX_OK, ret
*/
  __pyx_t_4 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding__zran_init(__pyx_v__zran_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1404
 * 
 *     _zran_init()
 *     ret = zran.zran_build_index(&index, 0, 0)             # <<<<<<<<<<<<<<
 *     assert ret == zran.ZRAN_BUILD_INDEX_OK, ret
 *     zran.zran_free(&index)
*/
  __pyx_v_ret = zran_build_index((&__pyx_cur_scope->__pyx_v_index), 0, 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":1405
 *     _zran_init()
 *     ret = zran.zran_build_index(&index, 0, 0)
 *     assert ret == zran.ZRAN_BUILD_INDEX_OK, ret             # <<<<<<<<<<<<<<
 *     zran.zran_free(&index)
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_13 = (__pyx_v_ret == ZRAN_BUILD_INDEX_OK);
    if (unlikely(!__pyx_t_13)) {
      __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 1405, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1405, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1406
 *     ret = zran.zran_build_index(&index, 0, 0)
 *     assert ret == zran.ZRAN_BUILD_INDEX_OK, ret
 *     zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *     _zran_init()
*/
  zran_free((&__pyx_cur_scope->__pyx_v_index));

  /* "indexed_gzip/tests/ctest_zran.pyx":1408
 *     zran.zran_free(&index)
 * 
 *     _zran_init()             # <<<<<<<<<<<<<<
 *     ret = zran.zran_seek(&index, dsize - 1, SEEK_SET, NULL)
 *     assert ret == zran.ZRAN_SEEK_OK, ret
*/
  __pyx_t_5 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding__zran_init(__pyx_v__zran_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1409
 * 
 *     _zran_init()
 *     ret = zran.zran_seek(&index, dsize - 1, SEEK_SET, NULL)             # <<<<<<<<<<<<<<
 *     assert ret == zran.ZRAN_SEEK_OK, ret
 *     zran.zran_free(&index)
*/
  __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_dsize, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_17 = __Pyx_PyLong_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_17 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_ret = zran_seek((&__pyx_cur_scope->__pyx_v_index), __pyx_t_17, SEEK_SET, NULL);

  /* "indexed_gzip/tests/ctest_zran.pyx":1410
 *     _zran_init()
 *     ret = zran.zran_seek(&index, dsize - 1, SEEK_SET, NULL)
 *     assert ret == zran.ZRAN_SEEK_OK, ret             # <<<<<<<<<<<<<<
 *     zran.zran_free(&index)
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_13 = (__pyx_v_ret == ZRAN_SEEK_OK);
    if (unlikely(!__pyx_t_13)) {
      __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_4, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 1410, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1410, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1411
 *     ret = zran.zran_seek(&index, dsize - 1, SEEK_SET, NULL)
 *     assert ret == zran.ZRAN_SEEK_OK, ret
 *     zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *     _zran_init()
*/
  zran_free((&__pyx_cur_scope->__pyx_v_index));

  /* "indexed_gzip/tests/ctest_zran.pyx":1413
 *     zran.zran_free(&index)
 * 
 *     _zran_init()             # <<<<<<<<<<<<<<
 *     ret = zran.zran_read(&index, buffer, dsize)
 *     assert ret == dsize, ret
*/
  __pyx_t_4 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_37test_standard_usage_with_null_padding__zran_init(__pyx_v__zran_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1414
 * 
 *     _zran_init()
 *     ret = zran.zran_read(&index, buffer, dsize)             # <<<<<<<<<<<<<<
 *     assert ret == dsize, ret
 *     zran.zran_free(&index)
*/
  __pyx_t_18 = __Pyx_PyLong_As_uint64_t(__pyx_v_dsize); if (unlikely((__pyx_t_18 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L1_error)
  __pyx_v_ret = zran_read((&__pyx_cur_scope->__pyx_v_index), __pyx_v_buffer, __pyx_t_18);

  /* "indexed_gzip/tests/ctest_zran.pyx":1415
 *     _zran_init()
 *     ret = zran.zran_read(&index, buffer, dsize)
 *     assert ret == dsize, ret             # <<<<<<<<<<<<<<
 *     zran.zran_free(&index)
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_dsize, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1415, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1415, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_13)) {
      __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1415, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_4, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 1415, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1415, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1416
 *     ret = zran.zran_read(&index, buffer, dsize)
 *     assert ret == dsize, ret
 *     zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *     pybuf = <bytes>(<char *>buffer)[:dsize]
*/
  zran_free((&__pyx_cur_scope->__pyx_v_index));

  /* "indexed_gzip/tests/ctest_zran.pyx":1418
 *     zran.zran_free(&index)
 * 
 *     pybuf = <bytes>(<char *>buffer)[:dsize]             # <<<<<<<<<<<<<<
 *     assert np.all(np.frombuffer(pybuf, dtype=np.uint32) == data)
 * 
*/
  __Pyx_INCREF(__pyx_v_dsize);
  __pyx_t_4 = __pyx_v_dsize;
  __pyx_t_13 = (__pyx_t_4 == Py_None);
  if (__pyx_t_13) {
    __pyx_t_10 = PY_SSIZE_T_MAX;
  } else {
    __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1418, __pyx_L1_error)
    __pyx_t_10 = __pyx_t_14;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_buffer) + 0, __pyx_t_10 - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_pybuf = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1419
 * 
 *     pybuf = <bytes>(<char *>buffer)[:dsize]
 *     assert np.all(np.frombuffer(pybuf, dtype=np.uint32) == data)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_16 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_frombuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_uint32); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_16);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_16, __pyx_v_pybuf};
      __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_19, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1419, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_data, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_5 = __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_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1419, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_13)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 1419, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1419, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1348
 * 
 * 
 * def test_standard_usage_with_null_padding(concat):             # <<<<<<<<<<<<<<
 *     """Make sure standard usage works with files that have null-padding after
 *     the GZIP footer.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_standard_usage_with_null_padding", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dsize);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_cmpdata);
  __Pyx_XDECREF(__pyx_v_strmoffs);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_padding);
  __Pyx_XDECREF(__pyx_v_padoff);
  __Pyx_XDECREF(__pyx_v_last);
  __Pyx_XDECREF(__pyx_v_off);
  __Pyx_XDECREF(__pyx_v_pad);
  __Pyx_XDECREF(__pyx_v_strm);
  __Pyx_XDECREF(__pyx_v__zran_init);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1423
 * 
 * # pauldmccarthy/indexed_gzip#82
 * def test_inflateInit_leak_on_error():             # <<<<<<<<<<<<<<
 *     """Make sure memory is not leaked after a successful call to
 *     inflateInit2(), but then a failure on subsequent zlib calls.
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_63test_inflateInit_leak_on_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_12indexed_gzip_5tests_10ctest_zran_62test_inflateInit_leak_on_error, "Make sure memory is not leaked after a successful call to\n    inflateInit2(), but then a failure on subsequent zlib calls.\n    ");
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_63test_inflateInit_leak_on_error = {"test_inflateInit_leak_on_error", (PyCFunction)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_63test_inflateInit_leak_on_error, METH_NOARGS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_62test_inflateInit_leak_on_error};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_63test_inflateInit_leak_on_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_inflateInit_leak_on_error (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_62test_inflateInit_leak_on_error(__pyx_self);

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

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_62test_inflateInit_leak_on_error(CYTHON_UNUSED PyObject *__pyx_self) {
  zran_index_t __pyx_v_index;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_iters = NULL;
  PyObject *__pyx_v_mem = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_inflateInit_leak_on_error", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":1433
 *     # We can target the first call by passing a file containing random noise.
 *     # I haven't yet figured out a reliable way to target the second call.
 *     f = BytesIO(np.arange(1, 100).tobytes())             # <<<<<<<<<<<<<<
 * 
 *     iters = np.arange(1, 10000)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[7], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_5 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tobytes, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1435
 *     f = BytesIO(np.arange(1, 100).tobytes())
 * 
 *     iters = np.arange(1, 10000)             # <<<<<<<<<<<<<<
 *     mem   = np.zeros(10000, dtype=np.uint64)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __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[8], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_iters = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1436
 * 
 *     iters = np.arange(1, 10000)
 *     mem   = np.zeros(10000, dtype=np.uint64)             # <<<<<<<<<<<<<<
 * 
 *     for i in iters:
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_10000};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1436, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_mem = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1438
 *     mem   = np.zeros(10000, dtype=np.uint64)
 * 
 *     for i in iters:             # <<<<<<<<<<<<<<
 *         assert not zran.zran_init(&index,
 *                                   NULL,
*/
  if (likely(PyList_CheckExact(__pyx_v_iters)) || PyTuple_CheckExact(__pyx_v_iters)) {
    __pyx_t_1 = __pyx_v_iters; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_iters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1438, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1438, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_9;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1438, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9);
        #endif
        ++__pyx_t_9;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1438, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_10(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1438, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1439
 * 
 *     for i in iters:
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL,
 *                                   <PyObject*>f,
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {

      /* "indexed_gzip/tests/ctest_zran.pyx":1445
 *                                   32768,
 *                                   131072,
 *                                   zran.ZRAN_AUTO_BUILD)             # <<<<<<<<<<<<<<
 *         assert zran.zran_seek(&index, 20, SEEK_SET, NULL) == \
 *             zran.ZRAN_SEEK_FAIL
*/
      __pyx_t_11 = (!(zran_init((&__pyx_v_index), NULL, ((PyObject *)__pyx_v_f), 0x100000, 0x8000, 0x20000, ZRAN_AUTO_BUILD) != 0));
      if (unlikely(!__pyx_t_11)) {

        /* "indexed_gzip/tests/ctest_zran.pyx":1439
 * 
 *     for i in iters:
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL,
 *                                   <PyObject*>f,
*/
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 1439, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1439, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":1446
 *                                   131072,
 *                                   zran.ZRAN_AUTO_BUILD)
 *         assert zran.zran_seek(&index, 20, SEEK_SET, NULL) == \             # <<<<<<<<<<<<<<
 *             zran.ZRAN_SEEK_FAIL
 *         zran.zran_free(&index)
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {

      /* "indexed_gzip/tests/ctest_zran.pyx":1447
 *                                   zran.ZRAN_AUTO_BUILD)
 *         assert zran.zran_seek(&index, 20, SEEK_SET, NULL) == \
 *             zran.ZRAN_SEEK_FAIL             # <<<<<<<<<<<<<<
 *         zran.zran_free(&index)
 * 
*/
      __pyx_t_11 = (zran_seek((&__pyx_v_index), 20, SEEK_SET, NULL) == ZRAN_SEEK_FAIL);
      if (unlikely(!__pyx_t_11)) {

        /* "indexed_gzip/tests/ctest_zran.pyx":1446
 *                                   131072,
 *                                   zran.ZRAN_AUTO_BUILD)
 *         assert zran.zran_seek(&index, 20, SEEK_SET, NULL) == \             # <<<<<<<<<<<<<<
 *             zran.ZRAN_SEEK_FAIL
 *         zran.zran_free(&index)
*/
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 1446, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1446, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":1448
 *         assert zran.zran_seek(&index, 20, SEEK_SET, NULL) == \
 *             zran.ZRAN_SEEK_FAIL
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *         if resource is not None:
*/
    zran_free((&__pyx_v_index));

    /* "indexed_gzip/tests/ctest_zran.pyx":1450
 *         zran.zran_free(&index)
 * 
 *         if resource is not None:             # <<<<<<<<<<<<<<
 *             mem[i] = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_resource); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = (__pyx_t_2 != Py_None);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_11) {

      /* "indexed_gzip/tests/ctest_zran.pyx":1451
 * 
 *         if resource is not None:
 *             mem[i] = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss             # <<<<<<<<<<<<<<
 * 
 *     # We expect to see some small growth in memory
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_resource); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getrusage); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_resource); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_RUSAGE_SELF); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_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_2)) __PYX_ERR(0, 1451, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ru_maxrss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely((PyObject_SetItem(__pyx_v_mem, __pyx_v_i, __pyx_t_3) < 0))) __PYX_ERR(0, 1451, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":1450
 *         zran.zran_free(&index)
 * 
 *         if resource is not None:             # <<<<<<<<<<<<<<
 *             mem[i] = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
 * 
*/
    }

    /* "indexed_gzip/tests/ctest_zran.pyx":1438
 *     mem   = np.zeros(10000, dtype=np.uint64)
 * 
 *     for i in iters:             # <<<<<<<<<<<<<<
 *         assert not zran.zran_init(&index,
 *                                   NULL,
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1456
 *     # usage for the first few iterations, but then
 *     # it should remain stable
 *     mem = mem[5:]             # <<<<<<<<<<<<<<
 *     assert np.all(mem == mem[0])
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_mem, 5, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_mem, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1457
 *     # it should remain stable
 *     mem = mem[5:]
 *     assert np.all(mem == mem[0])             # <<<<<<<<<<<<<<
 * 
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_all); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_mem, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_mem, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_11)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 1457, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1457, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1423
 * 
 * # pauldmccarthy/indexed_gzip#82
 * def test_inflateInit_leak_on_error():             # <<<<<<<<<<<<<<
 *     """Make sure memory is not leaked after a successful call to
 *     inflateInit2(), but then a failure on subsequent zlib calls.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_inflateInit_leak_on_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_iters);
  __Pyx_XDECREF(__pyx_v_mem);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1461
 * 
 * # pauldmccarthy/indexed_gzip#80
 * def test_read_eof_memmove_rotate_bug(seed):             # <<<<<<<<<<<<<<
 * 
 *     # This bug was triggered by the read buffer rotation
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_65test_read_eof_memmove_rotate_bug(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_65test_read_eof_memmove_rotate_bug = {"test_read_eof_memmove_rotate_bug", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_65test_read_eof_memmove_rotate_bug, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_65test_read_eof_memmove_rotate_bug(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_seed = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_read_eof_memmove_rotate_bug (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_seed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1461, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1461, __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, "test_read_eof_memmove_rotate_bug", 0) < (0)) __PYX_ERR(0, 1461, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_read_eof_memmove_rotate_bug", 1, 1, 1, i); __PYX_ERR(0, 1461, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1461, __pyx_L3_error)
    }
    __pyx_v_seed = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_read_eof_memmove_rotate_bug", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1461, __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("indexed_gzip.tests.ctest_zran.test_read_eof_memmove_rotate_bug", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_64test_read_eof_memmove_rotate_bug(__pyx_self, __pyx_v_seed);

  /* 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_12indexed_gzip_5tests_10ctest_zran_64test_read_eof_memmove_rotate_bug(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_seed) {
  zran_index_t __pyx_v_index;
  FILE *__pyx_v_cfid;
  PyObject *__pyx_v_nelems = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_fsize = NULL;
  PyObject *__pyx_v_readbuf_size = NULL;
  PyObject *__pyx_v_pyfid = NULL;
  PyObject *__pyx_v_eof = NULL;
  int __pyx_v_got;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  uint32_t __pyx_t_18;
  int64_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_read_eof_memmove_rotate_bug", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":1483
 *     cdef FILE             *cfid
 * 
 *     with tempdir():             # <<<<<<<<<<<<<<
 *         nelems = np.random.randint(524288, 525000, 1)[0]
 *         data   = np.random.random(nelems)
*/
  /*with:*/ {
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tempdir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 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_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1483, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "indexed_gzip/tests/ctest_zran.pyx":1484
 * 
 *     with tempdir():
 *         nelems = np.random.randint(524288, 525000, 1)[0]             # <<<<<<<<<<<<<<
 *         data   = np.random.random(nelems)
 *         with gzip.open('test.gz', 'wb') as f:
*/
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1484, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_randint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[9], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1484, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_nelems = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1485
 *     with tempdir():
 *         nelems = np.random.randint(524288, 525000, 1)[0]
 *         data   = np.random.random(nelems)             # <<<<<<<<<<<<<<
 *         with gzip.open('test.gz', 'wb') as f:
 *             f.write(data.tobytes())
*/
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1485, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1485, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_3 = __pyx_t_2;
          __Pyx_INCREF(__pyx_t_3);
          __pyx_t_4 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_nelems};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_random, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1485, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __pyx_v_data = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1486
 *         nelems = np.random.randint(524288, 525000, 1)[0]
 *         data   = np.random.random(nelems)
 *         with gzip.open('test.gz', 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(data.tobytes())
 * 
*/
          /*with:*/ {
            __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_gzip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[10], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1486, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_3 = NULL;
            __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1486, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_4 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(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, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __pyx_t_6 = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_13);
                /*try:*/ {
                  __pyx_v_f = __pyx_t_6;
                  __pyx_t_6 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1487
 *         data   = np.random.random(nelems)
 *         with gzip.open('test.gz', 'wb') as f:
 *             f.write(data.tobytes())             # <<<<<<<<<<<<<<
 * 
 *         fsize        = os.stat('test.gz').st_size
*/
                  __pyx_t_1 = __pyx_v_f;
                  __Pyx_INCREF(__pyx_t_1);
                  __pyx_t_3 = __pyx_v_data;
                  __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_tobytes, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __pyx_L17_error)
                    __Pyx_GOTREF(__pyx_t_2);
                  }
                  __pyx_t_4 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
                    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1487, __pyx_L17_error)
                    __Pyx_GOTREF(__pyx_t_6);
                  }
                  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1486
 *         nelems = np.random.randint(524288, 525000, 1)[0]
 *         data   = np.random.random(nelems)
 *         with gzip.open('test.gz', 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(data.tobytes())
 * 
*/
                }
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                goto __pyx_L22_try_end;
                __pyx_L17_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_read_eof_memmove_rotate_bug", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 1486, __pyx_L19_except_error)
                  __Pyx_XGOTREF(__pyx_t_6);
                  __Pyx_XGOTREF(__pyx_t_2);
                  __Pyx_XGOTREF(__pyx_t_1);
                  __pyx_t_3 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1486, __pyx_L19_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1486, __pyx_L19_except_error)
                  __Pyx_GOTREF(__pyx_t_14);
                  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_14);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (__pyx_t_15 < (0)) __PYX_ERR(0, 1486, __pyx_L19_except_error)
                  __pyx_t_16 = (!__pyx_t_15);
                  if (unlikely(__pyx_t_16)) {
                    __Pyx_GIVEREF(__pyx_t_6);
                    __Pyx_GIVEREF(__pyx_t_2);
                    __Pyx_XGIVEREF(__pyx_t_1);
                    __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_2, __pyx_t_1);
                    __pyx_t_6 = 0;  __pyx_t_2 = 0;  __pyx_t_1 = 0; 
                    __PYX_ERR(0, 1486, __pyx_L19_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  goto __pyx_L18_exception_handled;
                }
                __pyx_L19_except_error:;
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
                goto __pyx_L7_error;
                __pyx_L18_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
                __pyx_L22_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_10) {
                  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1486, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_13);
                  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                }
                goto __pyx_L16;
              }
              __pyx_L16:;
            }
            goto __pyx_L26;
            __pyx_L13_error:;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L7_error;
            __pyx_L26:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1489
 *             f.write(data.tobytes())
 * 
 *         fsize        = os.stat('test.gz').st_size             # <<<<<<<<<<<<<<
 *         readbuf_size = fsize - 10
 * 
*/
          __pyx_t_2 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1489, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_stat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_4 = 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_4 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_test_gz};
            __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_st_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_fsize = __pyx_t_3;
          __pyx_t_3 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1490
 * 
 *         fsize        = os.stat('test.gz').st_size
 *         readbuf_size = fsize - 10             # <<<<<<<<<<<<<<
 * 
 *         with open('test.gz', 'rb') as pyfid:
*/
          __pyx_t_3 = __Pyx_PyLong_SubtractObjC(__pyx_v_fsize, __pyx_mstate_global->__pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1490, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_v_readbuf_size = __pyx_t_3;
          __pyx_t_3 = 0;

          /* "indexed_gzip/tests/ctest_zran.pyx":1492
 *         readbuf_size = fsize - 10
 * 
 *         with open('test.gz', 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(&index,
*/
          /*with:*/ {
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[11], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1492, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1492, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_2 = NULL;
            __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1492, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_4 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_6))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
              assert(__pyx_t_2);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
              __pyx_t_4 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
              __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __pyx_L27_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __pyx_t_6 = __pyx_t_1;
            __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_11);
                /*try:*/ {
                  __pyx_v_pyfid = __pyx_t_6;
                  __pyx_t_6 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1493
 * 
 *         with open('test.gz', 'rb') as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')             # <<<<<<<<<<<<<<
 *             assert not zran.zran_init(&index,
 *                                       cfid,
*/
                  __pyx_t_3 = __pyx_v_pyfid;
                  __Pyx_INCREF(__pyx_t_3);
                  __pyx_t_4 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
                    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __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_6)) __PYX_ERR(0, 1493, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_6);
                  }
                  __pyx_t_17 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1493, __pyx_L31_error)
                  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                  __pyx_v_cfid = fdopen(__pyx_t_17, __pyx_k_rb);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1494
 *         with open('test.gz', 'rb') as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                       cfid,
 *                                       NULL,
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {

                    /* "indexed_gzip/tests/ctest_zran.pyx":1499
 *                                       4194304,
 *                                       32768,
 *                                       readbuf_size,             # <<<<<<<<<<<<<<
 *                                       zran.ZRAN_AUTO_BUILD)
 * 
*/
                    __pyx_t_18 = __Pyx_PyLong_As_uint32_t(__pyx_v_readbuf_size); if (unlikely((__pyx_t_18 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1499, __pyx_L31_error)

                    /* "indexed_gzip/tests/ctest_zran.pyx":1494
 *         with open('test.gz', 'rb') as pyfid:
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                       cfid,
 *                                       NULL,
*/
                    __pyx_t_16 = (!(zran_init((&__pyx_v_index), __pyx_v_cfid, NULL, 0x400000, 0x8000, __pyx_t_18, ZRAN_AUTO_BUILD) != 0));
                    if (unlikely(!__pyx_t_16)) {
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1494, __pyx_L31_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1494, __pyx_L31_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1502
 *                                       zran.ZRAN_AUTO_BUILD)
 * 
 *             eof = nelems * 8 - 1             # <<<<<<<<<<<<<<
 *             got = zran.zran_seek(&index, eof, SEEK_SET, NULL)
 * 
*/
                  __pyx_t_6 = __Pyx_PyLong_MultiplyObjC(__pyx_v_nelems, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1502, __pyx_L31_error)
                  __Pyx_GOTREF(__pyx_t_6);
                  __pyx_t_3 = __Pyx_PyLong_SubtractObjC(__pyx_t_6, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1502, __pyx_L31_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                  __pyx_v_eof = __pyx_t_3;
                  __pyx_t_3 = 0;

                  /* "indexed_gzip/tests/ctest_zran.pyx":1503
 * 
 *             eof = nelems * 8 - 1
 *             got = zran.zran_seek(&index, eof, SEEK_SET, NULL)             # <<<<<<<<<<<<<<
 * 
 *             assert got                    == zran.ZRAN_SEEK_OK, got
*/
                  __pyx_t_19 = __Pyx_PyLong_As_int64_t(__pyx_v_eof); if (unlikely((__pyx_t_19 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1503, __pyx_L31_error)
                  __pyx_v_got = zran_seek((&__pyx_v_index), __pyx_t_19, SEEK_SET, NULL);

                  /* "indexed_gzip/tests/ctest_zran.pyx":1505
 *             got = zran.zran_seek(&index, eof, SEEK_SET, NULL)
 * 
 *             assert got                    == zran.ZRAN_SEEK_OK, got             # <<<<<<<<<<<<<<
 *             assert zran.zran_tell(&index) == eof
 * 
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_16 = (__pyx_v_got == ZRAN_SEEK_OK);
                    if (unlikely(!__pyx_t_16)) {
                      __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_got); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1505, __pyx_L31_error)
                      __Pyx_GOTREF(__pyx_t_3);
                      __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1505, __pyx_L31_error)
                      __Pyx_GOTREF(__pyx_t_6);
                      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_6, 0, 0);
                      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                      __PYX_ERR(0, 1505, __pyx_L31_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1505, __pyx_L31_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1506
 * 
 *             assert got                    == zran.ZRAN_SEEK_OK, got
 *             assert zran.zran_tell(&index) == eof             # <<<<<<<<<<<<<<
 * 
 * 
*/
                  #ifndef CYTHON_WITHOUT_ASSERTIONS
                  if (unlikely(__pyx_assertions_enabled())) {
                    __pyx_t_6 = __Pyx_PyLong_From_uint64_t(zran_tell((&__pyx_v_index))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1506, __pyx_L31_error)
                    __Pyx_GOTREF(__pyx_t_6);
                    __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_v_eof, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1506, __pyx_L31_error)
                    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1506, __pyx_L31_error)
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (unlikely(!__pyx_t_16)) {
                      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
                      __PYX_ERR(0, 1506, __pyx_L31_error)
                    }
                  }
                  #else
                  if ((1)); else __PYX_ERR(0, 1506, __pyx_L31_error)
                  #endif

                  /* "indexed_gzip/tests/ctest_zran.pyx":1492
 *         readbuf_size = fsize - 10
 * 
 *         with open('test.gz', 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(&index,
*/
                }
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                goto __pyx_L36_try_end;
                __pyx_L31_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_read_eof_memmove_rotate_bug", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(0, 1492, __pyx_L33_except_error)
                  __Pyx_XGOTREF(__pyx_t_3);
                  __Pyx_XGOTREF(__pyx_t_6);
                  __Pyx_XGOTREF(__pyx_t_1);
                  __pyx_t_2 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1492, __pyx_L33_except_error)
                  __Pyx_GOTREF(__pyx_t_2);
                  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1492, __pyx_L33_except_error)
                  __Pyx_GOTREF(__pyx_t_14);
                  __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_14);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (__pyx_t_16 < (0)) __PYX_ERR(0, 1492, __pyx_L33_except_error)
                  __pyx_t_15 = (!__pyx_t_16);
                  if (unlikely(__pyx_t_15)) {
                    __Pyx_GIVEREF(__pyx_t_3);
                    __Pyx_GIVEREF(__pyx_t_6);
                    __Pyx_XGIVEREF(__pyx_t_1);
                    __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_6, __pyx_t_1);
                    __pyx_t_3 = 0;  __pyx_t_6 = 0;  __pyx_t_1 = 0; 
                    __PYX_ERR(0, 1492, __pyx_L33_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  goto __pyx_L32_exception_handled;
                }
                __pyx_L33_except_error:;
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
                goto __pyx_L7_error;
                __pyx_L32_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
                __pyx_L36_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_10) {
                  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1492, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_11);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                }
                goto __pyx_L30;
              }
              __pyx_L30:;
            }
            goto __pyx_L40;
            __pyx_L27_error:;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L7_error;
            __pyx_L40:;
          }

          /* "indexed_gzip/tests/ctest_zran.pyx":1483
 *     cdef FILE             *cfid
 * 
 *     with tempdir():             # <<<<<<<<<<<<<<
 *         nelems = np.random.randint(524288, 525000, 1)[0]
 *         data   = np.random.random(nelems)
*/
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_read_eof_memmove_rotate_bug", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_3) < 0) __PYX_ERR(0, 1483, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_2 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1483, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1483, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_15 < (0)) __PYX_ERR(0, 1483, __pyx_L9_except_error)
          __pyx_t_16 = (!__pyx_t_15);
          if (unlikely(__pyx_t_16)) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_6, __pyx_t_3);
            __pyx_t_1 = 0;  __pyx_t_6 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(0, 1483, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_5) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0], NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L44;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L1_error;
    __pyx_L44:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1461
 * 
 * # pauldmccarthy/indexed_gzip#80
 * def test_read_eof_memmove_rotate_bug(seed):             # <<<<<<<<<<<<<<
 * 
 *     # This bug was triggered by the read buffer rotation
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_read_eof_memmove_rotate_bug", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nelems);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_fsize);
  __Pyx_XDECREF(__pyx_v_readbuf_size);
  __Pyx_XDECREF(__pyx_v_pyfid);
  __Pyx_XDECREF(__pyx_v_eof);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1510
 * 
 * # pauldmccarthy/indexed_gzip#169
 * def test_skip_crc_with_footer_that_looks_like_new_stream(seed):             # <<<<<<<<<<<<<<
 *     """Test the code with a file where the 8 byte GZIP footer (the CRC and
 *     uncompressed size modulo 2**32) contains bytes which look like a new
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_67test_skip_crc_with_footer_that_looks_like_new_stream(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_12indexed_gzip_5tests_10ctest_zran_66test_skip_crc_with_footer_that_looks_like_new_stream, "Test the code with a file where the 8 byte GZIP footer (the CRC and\n    uncompressed size modulo 2**32) contains bytes which look like a new\n    GZIP stream (i.e. contain 0x1f8b).\n    ");
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_67test_skip_crc_with_footer_that_looks_like_new_stream = {"test_skip_crc_with_footer_that_looks_like_new_stream", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_67test_skip_crc_with_footer_that_looks_like_new_stream, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_66test_skip_crc_with_footer_that_looks_like_new_stream};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_67test_skip_crc_with_footer_that_looks_like_new_stream(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_seed = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("test_skip_crc_with_footer_that_looks_like_new_stream (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_seed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1510, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1510, __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, "test_skip_crc_with_footer_that_looks_like_new_stream", 0) < (0)) __PYX_ERR(0, 1510, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test_skip_crc_with_footer_that_looks_like_new_stream", 1, 1, 1, i); __PYX_ERR(0, 1510, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1510, __pyx_L3_error)
    }
    __pyx_v_seed = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("test_skip_crc_with_footer_that_looks_like_new_stream", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1510, __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("indexed_gzip.tests.ctest_zran.test_skip_crc_with_footer_that_looks_like_new_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_66test_skip_crc_with_footer_that_looks_like_new_stream(__pyx_self, __pyx_v_seed);

  /* 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;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1527
 *     cmpdata = compress_inmem(rawdata.tobytes(), True)[0]
 * 
 *     def _zran_init(data, flags):             # <<<<<<<<<<<<<<
 *         f = BytesIO(data)
 *         assert not zran.zran_init(&index,
*/

/* Python wrapper */
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream_1_zran_init(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream_1_zran_init = {"_zran_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream_1_zran_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream_1_zran_init(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_flags = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_zran_init (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_flags,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1527, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1527, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1527, __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, "_zran_init", 0) < (0)) __PYX_ERR(0, 1527, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_zran_init", 1, 2, 2, i); __PYX_ERR(0, 1527, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1527, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1527, __pyx_L3_error)
    }
    __pyx_v_data = values[0];
    __pyx_v_flags = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_zran_init", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1527, __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("indexed_gzip.tests.ctest_zran.test_skip_crc_with_footer_that_looks_like_new_stream._zran_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream__zran_init(__pyx_self, __pyx_v_data, __pyx_v_flags);

  /* 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_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream__zran_init(PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_flags) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream *__pyx_cur_scope;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream *__pyx_outer_scope;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  uint16_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_zran_init", 0);
  __pyx_outer_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "indexed_gzip/tests/ctest_zran.pyx":1528
 * 
 *     def _zran_init(data, flags):
 *         f = BytesIO(data)             # <<<<<<<<<<<<<<
 *         assert not zran.zran_init(&index,
 *                                   NULL,
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BytesIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 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_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1529
 *     def _zran_init(data, flags):
 *         f = BytesIO(data)
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL,
 *                                   <PyObject*>f,
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {

    /* "indexed_gzip/tests/ctest_zran.pyx":1535
 *                                   32768,
 *                                   131072,
 *                                   flags)             # <<<<<<<<<<<<<<
 *         return f
 * 
*/
    __pyx_t_5 = __Pyx_PyLong_As_uint16_t(__pyx_v_flags); if (unlikely((__pyx_t_5 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1535, __pyx_L1_error)

    /* "indexed_gzip/tests/ctest_zran.pyx":1529
 *     def _zran_init(data, flags):
 *         f = BytesIO(data)
 *         assert not zran.zran_init(&index,             # <<<<<<<<<<<<<<
 *                                   NULL,
 *                                   <PyObject*>f,
*/
    __pyx_t_6 = (!(zran_init((&__pyx_cur_scope->__pyx_v_index), NULL, ((PyObject *)__pyx_v_f), 0x100000, 0x8000, 0x20000, __pyx_t_5) != 0));
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 1529, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 1529, __pyx_L1_error)
  #endif

  /* "indexed_gzip/tests/ctest_zran.pyx":1536
 *                                   131072,
 *                                   flags)
 *         return f             # <<<<<<<<<<<<<<
 * 
 *     for flags in [zran.ZRAN_AUTO_BUILD,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_f);
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1527
 *     cmpdata = compress_inmem(rawdata.tobytes(), True)[0]
 * 
 *     def _zran_init(data, flags):             # <<<<<<<<<<<<<<
 *         f = BytesIO(data)
 *         assert not zran.zran_init(&index,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_skip_crc_with_footer_that_looks_like_new_stream._zran_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "indexed_gzip/tests/ctest_zran.pyx":1510
 * 
 * # pauldmccarthy/indexed_gzip#169
 * def test_skip_crc_with_footer_that_looks_like_new_stream(seed):             # <<<<<<<<<<<<<<
 *     """Test the code with a file where the 8 byte GZIP footer (the CRC and
 *     uncompressed size modulo 2**32) contains bytes which look like a new
*/

static PyObject *__pyx_pf_12indexed_gzip_5tests_10ctest_zran_66test_skip_crc_with_footer_that_looks_like_new_stream(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_seed) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream *__pyx_cur_scope;
  void *__pyx_v_buffer;
  int64_t __pyx_v_ret;
  PyObject *__pyx_v_nbytes = NULL;
  PyObject *__pyx_v_rawdata = NULL;
  PyObject *__pyx_v_cmpdata = NULL;
  PyObject *__pyx_v__zran_init = 0;
  PyObject *__pyx_v_flags = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_f = NULL;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *__pyx_v_buf = NULL;
  PyObject *__pyx_v_pybuf = 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;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int64_t __pyx_t_9;
  void *__pyx_t_10;
  uint64_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("test_skip_crc_with_footer_that_looks_like_new_stream", 0);
  __pyx_cur_scope = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream(__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1510, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":1523
 *     # (with little-endian storage). The compress_imem function chunks
 *     # the data into 10 separate gzip streams
 *     nbytes  = 10 * 0x128b1f             # <<<<<<<<<<<<<<
 *     rawdata = np.random.randint(0, 255, nbytes, dtype=np. uint8)
 *     cmpdata = compress_inmem(rawdata.tobytes(), True)[0]
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_12152630);
  __pyx_v_nbytes = __pyx_mstate_global->__pyx_int_12152630;

  /* "indexed_gzip/tests/ctest_zran.pyx":1524
 *     # the data into 10 separate gzip streams
 *     nbytes  = 10 * 0x128b1f
 *     rawdata = np.random.randint(0, 255, nbytes, dtype=np. uint8)             # <<<<<<<<<<<<<<
 *     cmpdata = compress_inmem(rawdata.tobytes(), True)[0]
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_255, __pyx_v_nbytes};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_3, __pyx_callargs+4, 0) < (0)) __PYX_ERR(0, 1524, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_randint, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_rawdata = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1525
 *     nbytes  = 10 * 0x128b1f
 *     rawdata = np.random.randint(0, 255, nbytes, dtype=np. uint8)
 *     cmpdata = compress_inmem(rawdata.tobytes(), True)[0]             # <<<<<<<<<<<<<<
 * 
 *     def _zran_init(data, flags):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_compress_inmem); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_v_rawdata;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tobytes, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, Py_True};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cmpdata = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1527
 *     cmpdata = compress_inmem(rawdata.tobytes(), True)[0]
 * 
 *     def _zran_init(data, flags):             # <<<<<<<<<<<<<<
 *         f = BytesIO(data)
 *         assert not zran.zran_init(&index,
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream_1_zran_init, 0, __pyx_mstate_global->__pyx_n_u_test_skip_crc_with_footer_that_l, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v__zran_init = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1538
 *         return f
 * 
 *     for flags in [zran.ZRAN_AUTO_BUILD,             # <<<<<<<<<<<<<<
 *                   zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK]:
 * 
*/
  __pyx_t_3 = __Pyx_PyLong_From___pyx_anon_enum(ZRAN_AUTO_BUILD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "indexed_gzip/tests/ctest_zran.pyx":1539
 * 
 *     for flags in [zran.ZRAN_AUTO_BUILD,
 *                   zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK]:             # <<<<<<<<<<<<<<
 * 
 *         # check that we can build an index
*/
  __pyx_t_1 = __Pyx_PyLong_From_int((ZRAN_AUTO_BUILD | ZRAN_SKIP_CRC_CHECK)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "indexed_gzip/tests/ctest_zran.pyx":1538
 *         return f
 * 
 *     for flags in [zran.ZRAN_AUTO_BUILD,             # <<<<<<<<<<<<<<
 *                   zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK]:
 * 
*/
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1538, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 1538, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_7 >= 2) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7));
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7);
    #endif
    ++__pyx_t_7;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_flags, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1542
 * 
 *         # check that we can build an index
 *         f   = _zran_init(cmpdata, flags)             # <<<<<<<<<<<<<<
 *         ret = zran.zran_build_index(&index, 0, 0)
 *         assert ret == zran.ZRAN_BUILD_INDEX_OK, ret
*/
    __pyx_t_5 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream__zran_init(__pyx_v__zran_init, __pyx_v_cmpdata, __pyx_v_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1543
 *         # check that we can build an index
 *         f   = _zran_init(cmpdata, flags)
 *         ret = zran.zran_build_index(&index, 0, 0)             # <<<<<<<<<<<<<<
 *         assert ret == zran.ZRAN_BUILD_INDEX_OK, ret
 *         zran.zran_free(&index)
*/
    __pyx_v_ret = zran_build_index((&__pyx_cur_scope->__pyx_v_index), 0, 0);

    /* "indexed_gzip/tests/ctest_zran.pyx":1544
 *         f   = _zran_init(cmpdata, flags)
 *         ret = zran.zran_build_index(&index, 0, 0)
 *         assert ret == zran.ZRAN_BUILD_INDEX_OK, ret             # <<<<<<<<<<<<<<
 *         zran.zran_free(&index)
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_8 = (__pyx_v_ret == ZRAN_BUILD_INDEX_OK);
      if (unlikely(!__pyx_t_8)) {
        __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1544, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1544, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_3, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(0, 1544, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1544, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":1545
 *         ret = zran.zran_build_index(&index, 0, 0)
 *         assert ret == zran.ZRAN_BUILD_INDEX_OK, ret
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *         # check that we can seek
*/
    zran_free((&__pyx_cur_scope->__pyx_v_index));

    /* "indexed_gzip/tests/ctest_zran.pyx":1548
 * 
 *         # check that we can seek
 *         f   = _zran_init(cmpdata, flags)             # <<<<<<<<<<<<<<
 *         ret = zran.zran_seek(&index, nbytes - 1, SEEK_SET, NULL)
 *         assert ret == zran.ZRAN_SEEK_OK, ret
*/
    __pyx_t_3 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream__zran_init(__pyx_v__zran_init, __pyx_v_cmpdata, __pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1549
 *         # check that we can seek
 *         f   = _zran_init(cmpdata, flags)
 *         ret = zran.zran_seek(&index, nbytes - 1, SEEK_SET, NULL)             # <<<<<<<<<<<<<<
 *         assert ret == zran.ZRAN_SEEK_OK, ret
 *         zran.zran_free(&index)
*/
    __pyx_t_3 = __Pyx_PyLong_SubtractObjC(__pyx_v_nbytes, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyLong_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1549, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_ret = zran_seek((&__pyx_cur_scope->__pyx_v_index), __pyx_t_9, SEEK_SET, NULL);

    /* "indexed_gzip/tests/ctest_zran.pyx":1550
 *         f   = _zran_init(cmpdata, flags)
 *         ret = zran.zran_seek(&index, nbytes - 1, SEEK_SET, NULL)
 *         assert ret == zran.ZRAN_SEEK_OK, ret             # <<<<<<<<<<<<<<
 *         zran.zran_free(&index)
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_8 = (__pyx_v_ret == ZRAN_SEEK_OK);
      if (unlikely(!__pyx_t_8)) {
        __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1550, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1550, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_5, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(0, 1550, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1550, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":1551
 *         ret = zran.zran_seek(&index, nbytes - 1, SEEK_SET, NULL)
 *         assert ret == zran.ZRAN_SEEK_OK, ret
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *         # check that we can read
*/
    zran_free((&__pyx_cur_scope->__pyx_v_index));

    /* "indexed_gzip/tests/ctest_zran.pyx":1554
 * 
 *         # check that we can read
 *         buf    = ReadBuffer(nbytes)             # <<<<<<<<<<<<<<
 *         buffer = buf.buffer
 *         f      = _zran_init(cmpdata, flags)
*/
    __pyx_t_3 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_nbytes};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, __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;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1554, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_buf, ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1555
 *         # check that we can read
 *         buf    = ReadBuffer(nbytes)
 *         buffer = buf.buffer             # <<<<<<<<<<<<<<
 *         f      = _zran_init(cmpdata, flags)
 *         ret    = zran.zran_read(&index, buffer, nbytes)
*/
    __pyx_t_10 = __pyx_v_buf->buffer;
    __pyx_v_buffer = __pyx_t_10;

    /* "indexed_gzip/tests/ctest_zran.pyx":1556
 *         buf    = ReadBuffer(nbytes)
 *         buffer = buf.buffer
 *         f      = _zran_init(cmpdata, flags)             # <<<<<<<<<<<<<<
 *         ret    = zran.zran_read(&index, buffer, nbytes)
 *         assert ret == nbytes, ret
*/
    __pyx_t_5 = __pyx_pf_12indexed_gzip_5tests_10ctest_zran_52test_skip_crc_with_footer_that_looks_like_new_stream__zran_init(__pyx_v__zran_init, __pyx_v_cmpdata, __pyx_v_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1557
 *         buffer = buf.buffer
 *         f      = _zran_init(cmpdata, flags)
 *         ret    = zran.zran_read(&index, buffer, nbytes)             # <<<<<<<<<<<<<<
 *         assert ret == nbytes, ret
 *         zran.zran_free(&index)
*/
    __pyx_t_11 = __Pyx_PyLong_As_uint64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1557, __pyx_L1_error)
    __pyx_v_ret = zran_read((&__pyx_cur_scope->__pyx_v_index), __pyx_v_buffer, __pyx_t_11);

    /* "indexed_gzip/tests/ctest_zran.pyx":1558
 *         f      = _zran_init(cmpdata, flags)
 *         ret    = zran.zran_read(&index, buffer, nbytes)
 *         assert ret == nbytes, ret             # <<<<<<<<<<<<<<
 *         zran.zran_free(&index)
 * 
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_nbytes, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1558, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_8)) {
        __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1558, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_5, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(0, 1558, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1558, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":1559
 *         ret    = zran.zran_read(&index, buffer, nbytes)
 *         assert ret == nbytes, ret
 *         zran.zran_free(&index)             # <<<<<<<<<<<<<<
 * 
 *         pybuf = <bytes>(<char *>buffer)[:nbytes]
*/
    zran_free((&__pyx_cur_scope->__pyx_v_index));

    /* "indexed_gzip/tests/ctest_zran.pyx":1561
 *         zran.zran_free(&index)
 * 
 *         pybuf = <bytes>(<char *>buffer)[:nbytes]             # <<<<<<<<<<<<<<
 *         assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == rawdata)
*/
    __Pyx_INCREF(__pyx_v_nbytes);
    __pyx_t_5 = __pyx_v_nbytes;
    __pyx_t_8 = (__pyx_t_5 == Py_None);
    if (__pyx_t_8) {
      __pyx_t_12 = PY_SSIZE_T_MAX;
    } else {
      __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1561, __pyx_L1_error)
      __pyx_t_12 = __pyx_t_13;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_buffer) + 0, __pyx_t_12 - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_pybuf, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":1562
 * 
 *         pybuf = <bytes>(<char *>buffer)[:nbytes]
 *         assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == rawdata)             # <<<<<<<<<<<<<<
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_14 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_frombuffer); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_uint8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_16))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_16);
        assert(__pyx_t_14);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_14, __pyx_v_pybuf};
        __pyx_t_15 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1562, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_17, __pyx_t_15, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1562, __pyx_L1_error)
        __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_15);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1562, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_16 = PyObject_RichCompare(__pyx_t_4, __pyx_v_rawdata, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_16};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __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_16); __pyx_t_16 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_8)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 1562, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 1562, __pyx_L1_error)
    #endif

    /* "indexed_gzip/tests/ctest_zran.pyx":1538
 *         return f
 * 
 *     for flags in [zran.ZRAN_AUTO_BUILD,             # <<<<<<<<<<<<<<
 *                   zran.ZRAN_AUTO_BUILD | zran.ZRAN_SKIP_CRC_CHECK]:
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1510
 * 
 * # pauldmccarthy/indexed_gzip#169
 * def test_skip_crc_with_footer_that_looks_like_new_stream(seed):             # <<<<<<<<<<<<<<
 *     """Test the code with a file where the 8 byte GZIP footer (the CRC and
 *     uncompressed size modulo 2**32) contains bytes which look like a new
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran.test_skip_crc_with_footer_that_looks_like_new_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nbytes);
  __Pyx_XDECREF(__pyx_v_rawdata);
  __Pyx_XDECREF(__pyx_v_cmpdata);
  __Pyx_XDECREF(__pyx_v__zran_init);
  __Pyx_XDECREF(__pyx_v_flags);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */

static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran_ReadBuffer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)o);
  p->mmap_fd = Py_None; Py_INCREF(Py_None);
  p->mmap_path = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran_ReadBuffer(PyObject *o) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)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_12indexed_gzip_5tests_10ctest_zran_ReadBuffer) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_5__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mmap_fd);
  Py_CLEAR(p->mmap_path);
  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_12indexed_gzip_5tests_10ctest_zran_ReadBuffer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->mmap_fd) {
    e = (*v)(p->mmap_fd, a); if (e) return e;
  }
  if (p->mmap_path) {
    e = (*v)(p->mmap_path, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran_ReadBuffer(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer *)o;
  tmp = ((PyObject*)p->mmap_fd);
  p->mmap_fd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mmap_path);
  p->mmap_path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_12indexed_gzip_5tests_10ctest_zran_ReadBuffer[] = {
  {"resize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_3resize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_2resize},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_12indexed_gzip_5tests_10ctest_zran_ReadBuffer_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran_ReadBuffer},
  {Py_tp_doc, (void *)PyDoc_STR("Wrapper around a chunk of memory.\n\n    .. see:: http://docs.cython.org/src/tutorial/memory_allocation.html\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran_ReadBuffer},
  {Py_tp_clear, (void *)__pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran_ReadBuffer},
  {Py_tp_methods, (void *)__pyx_methods_12indexed_gzip_5tests_10ctest_zran_ReadBuffer},
  {Py_tp_new, (void *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran_ReadBuffer},
  {0, 0},
};
static PyType_Spec __pyx_type_12indexed_gzip_5tests_10ctest_zran_ReadBuffer_spec = {
  "indexed_gzip.tests.ctest_zran.ReadBuffer",
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_12indexed_gzip_5tests_10ctest_zran_ReadBuffer_slots,
};
#else

static PyTypeObject __pyx_type_12indexed_gzip_5tests_10ctest_zran_ReadBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "indexed_gzip.tests.ctest_zran.""ReadBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran_ReadBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("Wrapper around a chunk of memory.\n\n    .. see:: http://docs.cython.org/src/tutorial/memory_allocation.html\n    "), /*tp_doc*/
  __pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, /*tp_traverse*/
  __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, /*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_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_defaults(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 1);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_defaults(PyObject *o) {
  struct __pyx_defaults *p = (struct __pyx_defaults *)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_12indexed_gzip_5tests_10ctest_zran___pyx_defaults) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->arg0);
  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_12indexed_gzip_5tests_10ctest_zran___pyx_defaults(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_defaults *p = (struct __pyx_defaults *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->arg0) {
    e = (*v)(p->arg0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_defaults(PyObject *o) {
  PyObject* tmp;
  struct __pyx_defaults *p = (struct __pyx_defaults *)o;
  tmp = ((PyObject*)p->arg0);
  p->arg0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_defaults_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_defaults},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran___pyx_defaults},
  {Py_tp_clear, (void *)__pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_defaults},
  {Py_tp_new, (void *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_defaults},
  {0, 0},
};
static PyType_Spec __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_defaults_spec = {
  "indexed_gzip.tests.ctest_zran.__pyx_defaults",
  sizeof(struct __pyx_defaults),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_defaults_slots,
};
#else

static PyTypeObject __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_defaults = {
  PyVarObject_HEAD_INIT(0, 0)
  "indexed_gzip.tests.ctest_zran.""__pyx_defaults", /*tp_name*/
  sizeof(struct __pyx_defaults), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_defaults, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran___pyx_defaults, /*tp_traverse*/
  __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_defaults, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_defaults, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__[--__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__(PyObject *o) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *)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_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_fd);
  Py_CLEAR(p->__pyx_v_th);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__))))
  {
    __pyx_mstate_global->__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__[__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__++] = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *)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_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_fd) {
    e = (*v)(p->__pyx_v_fd, a); if (e) return e;
  }
  if (p->__pyx_v_th) {
    e = (*v)(p->__pyx_v_th, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ *)o;
  tmp = ((PyObject*)p->__pyx_v_fd);
  p->__pyx_v_fd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_th);
  p->__pyx_v_th = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit___slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__},
  {Py_tp_clear, (void *)__pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__},
  {Py_tp_new, (void *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__},
  {0, 0},
};
static PyType_Spec __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit___spec = {
  "indexed_gzip.tests.ctest_zran.__pyx_scope_struct____cinit__",
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit___slots,
};
#else

static PyTypeObject __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "indexed_gzip.tests.ctest_zran.""__pyx_scope_struct____cinit__", /*tp_name*/
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__, /*tp_traverse*/
  __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn[--__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn(PyObject *o) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *)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_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_return_value);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn))))
  {
    __pyx_mstate_global->__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn[__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn++] = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *)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_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_return_value) {
    e = (*v)(p->__pyx_v_return_value, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn *)o;
  tmp = ((PyObject*)p->__pyx_v_return_value);
  p->__pyx_v_return_value = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn},
  {Py_tp_clear, (void *)__pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn},
  {Py_tp_new, (void *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn},
  {0, 0},
};
static PyType_Spec __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn_spec = {
  "indexed_gzip.tests.ctest_zran.__pyx_scope_struct_1_return_fn",
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn_slots,
};
#else

static PyTypeObject __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn = {
  PyVarObject_HEAD_INIT(0, 0)
  "indexed_gzip.tests.ctest_zran.""__pyx_scope_struct_1_return_fn", /*tp_name*/
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn, /*tp_traverse*/
  __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation[--__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation(PyObject *o) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *)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_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v__zran_init);
  Py_CLEAR(p->__pyx_v_dsize);
  Py_CLEAR(p->__pyx_v_rawdata);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation))))
  {
    __pyx_mstate_global->__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation[__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation++] = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *)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_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v__zran_init) {
    e = (*v)(p->__pyx_v__zran_init, a); if (e) return e;
  }
  if (p->__pyx_v_dsize) {
    e = (*v)(p->__pyx_v_dsize, a); if (e) return e;
  }
  if (p->__pyx_v_rawdata) {
    e = (*v)(p->__pyx_v_rawdata, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation *)o;
  tmp = ((PyObject*)p->__pyx_v__zran_init);
  p->__pyx_v__zran_init = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_dsize);
  p->__pyx_v_dsize = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_rawdata);
  p->__pyx_v_rawdata = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation},
  {Py_tp_clear, (void *)__pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation},
  {Py_tp_new, (void *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation},
  {0, 0},
};
static PyType_Spec __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation_spec = {
  "indexed_gzip.tests.ctest_zran.__pyx_scope_struct_2_test_crc_validation",
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation_slots,
};
#else

static PyTypeObject __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation = {
  PyVarObject_HEAD_INIT(0, 0)
  "indexed_gzip.tests.ctest_zran.""__pyx_scope_struct_2_test_crc_validation", /*tp_name*/
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation, /*tp_traverse*/
  __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding[--__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding(PyObject *o) {
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *)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_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_f);
  Py_CLEAR(p->__pyx_v_paddedcmpdata);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding))))
  {
    __pyx_mstate_global->__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding[__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding++] = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *)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_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_f) {
    e = (*v)(p->__pyx_v_f, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *p = (struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding *)o;
  tmp = ((PyObject*)p->__pyx_v_f);
  p->__pyx_v_f = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding},
  {Py_tp_clear, (void *)__pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding},
  {Py_tp_new, (void *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding},
  {0, 0},
};
static PyType_Spec __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding_spec = {
  "indexed_gzip.tests.ctest_zran.__pyx_scope_struct_3_test_standard_usage_with_null_padding",
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding_slots,
};
#else

static PyTypeObject __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding = {
  PyVarObject_HEAD_INIT(0, 0)
  "indexed_gzip.tests.ctest_zran.""__pyx_scope_struct_3_test_standard_usage_with_null_padding", /*tp_name*/
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding, /*tp_traverse*/
  __pyx_tp_clear_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream[--__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream(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_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream, sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream))))
  {
    __pyx_mstate_global->__pyx_freelist_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream[__pyx_mstate_global->__pyx_freecount_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream++] = ((struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream *)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
  }
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream},
  {Py_tp_new, (void *)__pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream},
  {0, 0},
};
static PyType_Spec __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream_spec = {
  "indexed_gzip.tests.ctest_zran.__pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream",
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER,
  __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream_slots,
};
#else

static PyTypeObject __pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream = {
  PyVarObject_HEAD_INIT(0, 0)
  "indexed_gzip.tests.ctest_zran.""__pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream", /*tp_name*/
  sizeof(struct __pyx_obj_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_12indexed_gzip_5tests_10ctest_zran_ReadBuffer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer)) __PYX_ERR(0, 134, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_12indexed_gzip_5tests_10ctest_zran_ReadBuffer_spec, __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer) < (0)) __PYX_ERR(0, 134, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer = &__pyx_type_12indexed_gzip_5tests_10ctest_zran_ReadBuffer;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer) < (0)) __PYX_ERR(0, 134, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer->tp_dictoffset && __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ReadBuffer, (PyObject *) __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer) < (0)) __PYX_ERR(0, 134, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer) < (0)) __PYX_ERR(0, 134, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_defaults_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults)) __PYX_ERR(0, 1264, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_defaults_spec, __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults) < (0)) __PYX_ERR(0, 1264, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults = &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_defaults;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults) < (0)) __PYX_ERR(0, 1264, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults->tp_dictoffset && __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_defaults->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__)) __PYX_ERR(0, 155, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit___spec, __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__) < (0)) __PYX_ERR(0, 155, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__ = &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__) < (0)) __PYX_ERR(0, 155, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__->tp_dictoffset && __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct____cinit__->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn)) __PYX_ERR(0, 236, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn_spec, __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn) < (0)) __PYX_ERR(0, 236, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn = &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn) < (0)) __PYX_ERR(0, 236, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn->tp_dictoffset && __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_1_return_fn->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation)) __PYX_ERR(0, 1240, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation_spec, __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation) < (0)) __PYX_ERR(0, 1240, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation = &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation) < (0)) __PYX_ERR(0, 1240, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation->tp_dictoffset && __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_2_test_crc_validation->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding)) __PYX_ERR(0, 1348, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding_spec, __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding) < (0)) __PYX_ERR(0, 1348, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding = &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding) < (0)) __PYX_ERR(0, 1348, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding->tp_dictoffset && __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_3_test_standard_usage_with_null_padding->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream)) __PYX_ERR(0, 1510, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream_spec, __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream) < (0)) __PYX_ERR(0, 1510, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream = &__pyx_type_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream) < (0)) __PYX_ERR(0, 1510, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream->tp_dictoffset && __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran___pyx_scope_struct_4_test_skip_crc_with_footer_that_looks_like_new_stream->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_2_5(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "dtype",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArray_Descr),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArray_Descr),
  #else
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArray_Descr),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 229, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "flatiter",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArrayIterObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArrayIterObject),
  #else
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArrayIterObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 274, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "broadcast",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArrayMultiIterObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArrayMultiIterObject),
  #else
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArrayMultiIterObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 278, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "ndarray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArrayObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArrayObject),
  #else
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyArrayObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 317, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "generic",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(1, 826, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "number",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(1, 828, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "integer",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(1, 830, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "signedinteger",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 832, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "unsignedinteger",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 834, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "inexact",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 836, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "floating",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(1, 838, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "complexfloating",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 840, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "flexible",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 842, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "character",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(1, 844, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_2_5(__pyx_t_1, "numpy", "ufunc",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyUFuncObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyUFuncObject),
  #else
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_5(PyUFuncObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_2_5); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 908, __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_ctest_zran(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_ctest_zran},
  #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,
      "ctest_zran",
      0, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__Pyx_PyMODINIT_FUNC PyInit_ctest_zran(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_ctest_zran(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
    PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_ctest_zran(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;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  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 'ctest_zran' 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 "ctest_zran" 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_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
    PyErr_Clear();
    __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
    if (!__Pyx_RefNanny)
        Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  
__Pyx_RefNannySetupContext("PyInit_ctest_zran", 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_indexed_gzip__tests__ctest_zran) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __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, "indexed_gzip.tests.ctest_zran")) {
      if (unlikely((PyDict_SetItemString(modules, "indexed_gzip.tests.ctest_zran", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  (void)__Pyx_modinit_function_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  (void)__Pyx_modinit_function_import_code(__pyx_mstate);
  /*--- Execution code ---*/

  /* "indexed_gzip/tests/ctest_zran.pyx":10
 * from __future__ import division
 * 
 * import                    os             # <<<<<<<<<<<<<<
 * import os.path         as op
 * import itertools       as it
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_os, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_os, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __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_os, __pyx_t_2) < (0)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":11
 * 
 * import                    os
 * import os.path         as op             # <<<<<<<<<<<<<<
 * import itertools       as it
 * import subprocess      as sp
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_os_path, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_os_path, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_path);
  Py_DECREF(__pyx_t_1);
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __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_op, __pyx_t_2) < (0)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":12
 * import                    os
 * import os.path         as op
 * import itertools       as it             # <<<<<<<<<<<<<<
 * import subprocess      as sp
 * import                    sys
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_itertools, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_itertools, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __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_it, __pyx_t_2) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":13
 * import os.path         as op
 * import itertools       as it
 * import subprocess      as sp             # <<<<<<<<<<<<<<
 * import                    sys
 * import                    time
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_subprocess, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_subprocess, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sp, __pyx_t_2) < (0)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":14
 * import itertools       as it
 * import subprocess      as sp
 * import                    sys             # <<<<<<<<<<<<<<
 * import                    time
 * import                    gzip
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_sys, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_2) < (0)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":15
 * import subprocess      as sp
 * import                    sys
 * import                    time             # <<<<<<<<<<<<<<
 * import                    gzip
 * import                    shutil
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_time, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_time, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_time, __pyx_t_2) < (0)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":16
 * import                    sys
 * import                    time
 * import                    gzip             # <<<<<<<<<<<<<<
 * import                    shutil
 * import                    random
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gzip, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_gzip, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_gzip, __pyx_t_2) < (0)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":17
 * import                    time
 * import                    gzip
 * import                    shutil             # <<<<<<<<<<<<<<
 * import                    random
 * import                    hashlib
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_shutil, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_shutil, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_shutil, __pyx_t_2) < (0)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":18
 * import                    gzip
 * import                    shutil
 * import                    random             # <<<<<<<<<<<<<<
 * import                    hashlib
 * import                    tempfile
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_random, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_random, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_random, __pyx_t_2) < (0)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":19
 * import                    shutil
 * import                    random
 * import                    hashlib             # <<<<<<<<<<<<<<
 * import                    tempfile
 * import                    threading
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_hashlib, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_hashlib, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_hashlib, __pyx_t_2) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":20
 * import                    random
 * import                    hashlib
 * import                    tempfile             # <<<<<<<<<<<<<<
 * import                    threading
 * import                    contextlib
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_tempfile, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_tempfile, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __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_tempfile, __pyx_t_2) < (0)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":21
 * import                    hashlib
 * import                    tempfile
 * import                    threading             # <<<<<<<<<<<<<<
 * import                    contextlib
 * 
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_threading, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_threading, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __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_threading, __pyx_t_2) < (0)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":22
 * import                    tempfile
 * import                    threading
 * import                    contextlib             # <<<<<<<<<<<<<<
 * 
 * import numpy as np
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_contextlib, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_contextlib, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __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_contextlib, __pyx_t_2) < (0)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":24
 * import                    contextlib
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * # The stdlib resource module is only
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_numpy, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __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_np, __pyx_t_2) < (0)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":28
 * # The stdlib resource module is only
 * # available on unix-like platforms.
 * try:             # <<<<<<<<<<<<<<
 *     import resource
 * except ImportError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "indexed_gzip/tests/ctest_zran.pyx":29
 * # available on unix-like platforms.
 * try:
 *     import resource             # <<<<<<<<<<<<<<
 * except ImportError:
 *     resource = None
*/
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_resource, 0, 0, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_resource, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L2_error)
      __pyx_t_2 = __pyx_t_5;
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_resource, __pyx_t_2) < (0)) __PYX_ERR(0, 29, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "indexed_gzip/tests/ctest_zran.pyx":28
 * # The stdlib resource module is only
 * # available on unix-like platforms.
 * try:             # <<<<<<<<<<<<<<
 *     import resource
 * except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "indexed_gzip/tests/ctest_zran.pyx":30
 * try:
 *     import resource
 * except ImportError:             # <<<<<<<<<<<<<<
 *     resource = None
 * 
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("indexed_gzip.tests.ctest_zran", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 30, __pyx_L4_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "indexed_gzip/tests/ctest_zran.pyx":31
 *     import resource
 * except ImportError:
 *     resource = None             # <<<<<<<<<<<<<<
 * 
 * 
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_resource, Py_None) < (0)) __PYX_ERR(0, 31, __pyx_L4_except_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;

    /* "indexed_gzip/tests/ctest_zran.pyx":28
 * # The stdlib resource module is only
 * # available on unix-like platforms.
 * try:             # <<<<<<<<<<<<<<
 *     import resource
 * except ImportError:
*/
    __pyx_L4_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_3, __pyx_t_4);
    __pyx_L7_try_end:;
  }

  /* "indexed_gzip/tests/ctest_zran.pyx":37
 * 
 * from posix.types cimport  off_t
 * from io import BytesIO             # <<<<<<<<<<<<<<
 * 
 * from libc.stdio  cimport (SEEK_SET,
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_BytesIO};
    __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_io, __pyx_imported_names, 1, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests_io, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error)
  }
  __pyx_t_8 = __pyx_t_4;
  __Pyx_GOTREF(__pyx_t_8);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_BytesIO};
    __pyx_t_9 = 0; {
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_imported_names[__pyx_t_9]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_9], __pyx_t_7) < (0)) __PYX_ERR(0, 37, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":65
 * 
 * 
 * from . import poll, check_data_valid, tempdir, compress_inmem             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_poll,__pyx_mstate_global->__pyx_n_u_check_data_valid,__pyx_mstate_global->__pyx_n_u_tempdir,__pyx_mstate_global->__pyx_n_u_compress_inmem};
    __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u__2, __pyx_imported_names, 4, __pyx_mstate_global->__pyx_kp_u_indexed_gzip_tests, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
  }
  __pyx_t_8 = __pyx_t_4;
  __Pyx_GOTREF(__pyx_t_8);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_poll,__pyx_mstate_global->__pyx_n_u_check_data_valid,__pyx_mstate_global->__pyx_n_u_tempdir,__pyx_mstate_global->__pyx_n_u_compress_inmem};
    for (__pyx_t_9=0; __pyx_t_9 < 4; __pyx_t_9++) {
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_imported_names[__pyx_t_9]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_9], __pyx_t_7) < (0)) __PYX_ERR(0, 65, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":75
 * cimport indexed_gzip.zran_file_util as zran_file_util
 * 
 * np.import_array()             # <<<<<<<<<<<<<<
 * 
 * cdef read_element(zran.zran_index_t *index, element, nelems, seek=True):
*/
  __pyx_t_6 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 75, __pyx_L1_error)

  /* "indexed_gzip/tests/ctest_zran.pyx":206
 * 
 * 
 *     def resize(self, size_t size):             # <<<<<<<<<<<<<<
 *         """Re-allocate the memory to the given ``size``. """
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_3resize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ReadBuffer_resize, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_12indexed_gzip_5tests_10ctest_zran_ReadBuffer, __pyx_mstate_global->__pyx_n_u_resize, __pyx_t_8) < (0)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ReadBuffer___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_8) < (0)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_10ReadBuffer_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ReadBuffer___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":232
 * 
 * 
 * def error_fn(*args, **kwargs):             # <<<<<<<<<<<<<<
 *     raise Exception("Error")
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_1error_fn, 0, __pyx_mstate_global->__pyx_n_u_error_fn, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_error_fn, __pyx_t_8) < (0)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":236
 * 
 * 
 * def return_fn(return_value):             # <<<<<<<<<<<<<<
 *     return lambda *args, **kwargs: return_value
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_3return_fn, 0, __pyx_mstate_global->__pyx_n_u_return_fn, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_return_fn, __pyx_t_8) < (0)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":240
 * 
 * 
 * def test_fread():             # <<<<<<<<<<<<<<
 *     """Tests Python wrapper C function for fread."""
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_5test_fread, 0, __pyx_mstate_global->__pyx_n_u_test_fread, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_fread, __pyx_t_8) < (0)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":259
 * 
 * 
 * def test_ftell():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_7test_ftell, 0, __pyx_mstate_global->__pyx_n_u_test_ftell, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_ftell, __pyx_t_8) < (0)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":275
 * 
 * 
 * def test_fseek():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_9test_fseek, 0, __pyx_mstate_global->__pyx_n_u_test_fseek, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_fseek, __pyx_t_8) < (0)) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":294
 * 
 * 
 * def test_feof():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_11test_feof, 0, __pyx_mstate_global->__pyx_n_u_test_feof, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_feof, __pyx_t_8) < (0)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":305
 * 
 * 
 * def test_ferror():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_13test_ferror, 0, __pyx_mstate_global->__pyx_n_u_test_ferror, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_ferror, __pyx_t_8) < (0)) __PYX_ERR(0, 305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":315
 * 
 * 
 * def test_fflush():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_15test_fflush, 0, __pyx_mstate_global->__pyx_n_u_test_fflush, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_fflush, __pyx_t_8) < (0)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":329
 * 
 * 
 * def test_fwrite():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_17test_fwrite, 0, __pyx_mstate_global->__pyx_n_u_test_fwrite, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_fwrite, __pyx_t_8) < (0)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":351
 * 
 * 
 * def test_getc():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"dbc")
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_19test_getc, 0, __pyx_mstate_global->__pyx_n_u_test_getc, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_getc, __pyx_t_8) < (0)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":372
 * 
 * 
 * def test_seekable():             # <<<<<<<<<<<<<<
 * 
 *     f = BytesIO(b"abc")
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_21test_seekable, 0, __pyx_mstate_global->__pyx_n_u_test_seekable, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_seekable, __pyx_t_8) < (0)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":380
 * 
 * 
 * def test_init(testfile, no_fds):             # <<<<<<<<<<<<<<
 *     """Tests a bunch of permutations of the parameters to zran_init. """
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_23test_init, 0, __pyx_mstate_global->__pyx_n_u_test_init, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_init, __pyx_t_8) < (0)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":418
 * 
 * 
 * def test_init_file_modes(testfile, no_fds):             # <<<<<<<<<<<<<<
 * 
 *     modes = ['r', 'r+', 'w', 'w+', 'a', 'a+']
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_25test_init_file_modes, 0, __pyx_mstate_global->__pyx_n_u_test_init_file_modes, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_init_file_modes, __pyx_t_8) < (0)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":451
 * 
 * 
 * def test_no_auto_build(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_27test_no_auto_build, 0, __pyx_mstate_global->__pyx_n_u_test_no_auto_build, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_no_auto_build, __pyx_t_8) < (0)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":506
 * 
 * 
 * def test_seek_to_end(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_29test_seek_to_end, 0, __pyx_mstate_global->__pyx_n_u_test_seek_to_end, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_seek_to_end, __pyx_t_8) < (0)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":535
 * 
 * 
 * def test_seek_cur(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_31test_seek_cur, 0, __pyx_mstate_global->__pyx_n_u_test_seek_cur, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_seek_cur, __pyx_t_8) < (0)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":579
 * 
 * 
 * def test_seek_end(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 *     cdef zran.zran_index_t index
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_33test_seek_end, 0, __pyx_mstate_global->__pyx_n_u_test_seek_end, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_seek_end, __pyx_t_8) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":637
 * 
 * 
 * def test_seek_beyond_end(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_35test_seek_beyond_end, 0, __pyx_mstate_global->__pyx_n_u_test_seek_beyond_end, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_seek_beyond_end, __pyx_t_8) < (0)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":691
 * 
 * 
 * def test_sequential_seek_to_end(testfile, no_fds, nelems, niters):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_37test_sequential_seek_to_end, 0, __pyx_mstate_global->__pyx_n_u_test_sequential_seek_to_end, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_sequential_seek_to_end, __pyx_t_8) < (0)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":738
 * 
 * 
 * def test_random_seek(testfile, no_fds, nelems, niters, seed):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_39test_random_seek, 0, __pyx_mstate_global->__pyx_n_u_test_random_seek, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_random_seek, __pyx_t_8) < (0)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":769
 * 
 * 
 * def test_read_all(testfile, no_fds, nelems, use_mmap):             # <<<<<<<<<<<<<<
 * 
 *     filesize = nelems * 8
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_41test_read_all, 0, __pyx_mstate_global->__pyx_n_u_test_read_all, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_read_all, __pyx_t_8) < (0)) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":805
 * 
 * 
 * def test_seek_then_read_block(testfile, no_fds, nelems, niters, seed, use_mmap):             # <<<<<<<<<<<<<<
 * 
 *     filesize  = nelems * 8
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_43test_seek_then_read_block, 0, __pyx_mstate_global->__pyx_n_u_test_seek_then_read_block, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_seek_then_read_block, __pyx_t_8) < (0)) __PYX_ERR(0, 805, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":870
 * 
 * 
 * def test_random_seek_and_read(testfile, no_fds, nelems, niters, seed):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_45test_random_seek_and_read, 0, __pyx_mstate_global->__pyx_n_u_test_random_seek_and_read, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_random_seek_and_read, __pyx_t_8) < (0)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":907
 * 
 * 
 * def test_read_all_sequential(testfile, no_fds, nelems):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_47test_read_all_sequential, 0, __pyx_mstate_global->__pyx_n_u_test_read_all_sequential, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_read_all_sequential, __pyx_t_8) < (0)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":943
 * 
 * 
 * def test_build_then_read(testfile, no_fds, nelems, seed, use_mmap):             # <<<<<<<<<<<<<<
 * 
 *     filesize = nelems * 8
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_49test_build_then_read, 0, __pyx_mstate_global->__pyx_n_u_test_build_then_read, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_build_then_read, __pyx_t_8) < (0)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":990
 * 
 * 
 * def test_readbuf_spacing_sizes(testfile, no_fds, nelems, niters, seed):             # <<<<<<<<<<<<<<
 * 
 *     cdef zran.zran_index_t index
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_51test_readbuf_spacing_sizes, 0, __pyx_mstate_global->__pyx_n_u_test_readbuf_spacing_sizes, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_readbuf_spacing_sizes, __pyx_t_8) < (0)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1070
 * 
 * 
 * def test_export_then_import(testfile, no_fds):             # <<<<<<<<<<<<<<
 *     """Export-import round trip . Test exporting an index, then importing it
 *     back in.
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_53test_export_then_import, 0, __pyx_mstate_global->__pyx_n_u_test_export_then_import, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_export_then_import, __pyx_t_8) < (0)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1122
 * 
 * 
 * def test_export_import_no_points(no_fds):             # <<<<<<<<<<<<<<
 *     """Test exporting and importing an index which does not contain any
 *     seek points.
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_55test_export_import_no_points, 0, __pyx_mstate_global->__pyx_n_u_test_export_import_no_points, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_export_import_no_points, __pyx_t_8) < (0)) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1179
 * 
 * 
 * def test_export_import_format_v0():             # <<<<<<<<<<<<<<
 *     """Test index export and import on a version 0 index file. """
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_57test_export_import_format_v0, 0, __pyx_mstate_global->__pyx_n_u_test_export_import_format_v0, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_export_import_format_v0, __pyx_t_8) < (0)) __PYX_ERR(0, 1179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1240
 * 
 * 
 * def test_crc_validation(concat, seed):             # <<<<<<<<<<<<<<
 *     """Basic test of CRC validation. """
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_59test_crc_validation, 0, __pyx_mstate_global->__pyx_n_u_test_crc_validation, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_crc_validation, __pyx_t_8) < (0)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1348
 * 
 * 
 * def test_standard_usage_with_null_padding(concat):             # <<<<<<<<<<<<<<
 *     """Make sure standard usage works with files that have null-padding after
 *     the GZIP footer.
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_61test_standard_usage_with_null_padding, 0, __pyx_mstate_global->__pyx_n_u_test_standard_usage_with_null_pa_2, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_standard_usage_with_null_pa_2, __pyx_t_8) < (0)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1423
 * 
 * # pauldmccarthy/indexed_gzip#82
 * def test_inflateInit_leak_on_error():             # <<<<<<<<<<<<<<
 *     """Make sure memory is not leaked after a successful call to
 *     inflateInit2(), but then a failure on subsequent zlib calls.
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_63test_inflateInit_leak_on_error, 0, __pyx_mstate_global->__pyx_n_u_test_inflateInit_leak_on_error, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_inflateInit_leak_on_error, __pyx_t_8) < (0)) __PYX_ERR(0, 1423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1461
 * 
 * # pauldmccarthy/indexed_gzip#80
 * def test_read_eof_memmove_rotate_bug(seed):             # <<<<<<<<<<<<<<
 * 
 *     # This bug was triggered by the read buffer rotation
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_65test_read_eof_memmove_rotate_bug, 0, __pyx_mstate_global->__pyx_n_u_test_read_eof_memmove_rotate_bug, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_read_eof_memmove_rotate_bug, __pyx_t_8) < (0)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1510
 * 
 * # pauldmccarthy/indexed_gzip#169
 * def test_skip_crc_with_footer_that_looks_like_new_stream(seed):             # <<<<<<<<<<<<<<
 *     """Test the code with a file where the 8 byte GZIP footer (the CRC and
 *     uncompressed size modulo 2**32) contains bytes which look like a new
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_12indexed_gzip_5tests_10ctest_zran_67test_skip_crc_with_footer_that_looks_like_new_stream, 0, __pyx_mstate_global->__pyx_n_u_test_skip_crc_with_footer_that_l_2, NULL, __pyx_mstate_global->__pyx_n_u_indexed_gzip_tests_ctest_zran, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_skip_crc_with_footer_that_l_2, __pyx_t_8) < (0)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "indexed_gzip/tests/ctest_zran.pyx":1
 * #             # <<<<<<<<<<<<<<
 * # Tests for the zran module.
 * #
*/
  __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_8) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init indexed_gzip.tests.ctest_zran", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init indexed_gzip.tests.ctest_zran");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */
/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(0, 98, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(0, 171, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open); if (!__pyx_builtin_open) __PYX_ERR(0, 391, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 430, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 829, __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
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "indexed_gzip/tests/ctest_zran.pyx":391
 *     cdef FILE             *cfid
 * 
 *     with open(testfile, 'rb') as pyfid:             # <<<<<<<<<<<<<<
 * 
 *         cfid = fdopen(pyfid.fileno(), 'rb')
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1129
 *     cdef void             *buffer
 * 
 *     data   = np.random.randint(1, 255, 100, dtype=np.uint8)             # <<<<<<<<<<<<<<
 *     buf    = ReadBuffer(100)
 *     buffer = buf.buffer
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_255, __pyx_mstate_global->__pyx_int_100); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1135
 *     with tempdir():
 * 
 *         with gzip.open('data.gz', 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(data.tobytes())
 * 
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_data_gz, __pyx_mstate_global->__pyx_n_u_wb); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1138
 *             f.write(data.tobytes())
 * 
 *         with open('data.gz', 'rb')  as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert zran.zran_init(&index,
*/
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_data_gz, __pyx_mstate_global->__pyx_n_u_rb); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1153
 *             assert np.all(np.frombuffer(pybuf, dtype=np.uint8) == data)
 * 
 *             with open('data.gz.index', 'wb') as pyidxfid:             # <<<<<<<<<<<<<<
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'wb')
 *                 assert zran.zran_export_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0
*/
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_data_gz_index, __pyx_mstate_global->__pyx_n_u_wb); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1168
 *                                   0) == 0
 * 
 *             with open('data.gz.index', 'rb') as pyidxfid:             # <<<<<<<<<<<<<<
 *                 cidxfid = fdopen(pyidxfid.fileno(), 'rb')
 *                 assert zran.zran_import_index(&index, NULL if no_fds else cidxfid, <PyObject*>pyidxfid if no_fds else NULL) == 0
*/
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_data_gz_index, __pyx_mstate_global->__pyx_n_u_rb); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 1168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1186
 *     cdef int               ret
 * 
 *     data = np.random.randint(1, 255, 1000000, dtype=np.uint8)             # <<<<<<<<<<<<<<
 *     with tempdir():
 * 
*/
  __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_255, __pyx_mstate_global->__pyx_int_1000000); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1329
 *     # Corrupt a different stream, if we have more than one
 *     if len(strmoffs) > 1:
 *         for off in strmoffs[1:]:             # <<<<<<<<<<<<<<
 *             data        = cmpdata.copy()
 *             data[off-1] = wrap(data[off-1] + 1)
*/
  __pyx_mstate_global->__pyx_slice[0] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1433
 *     # We can target the first call by passing a file containing random noise.
 *     # I haven't yet figured out a reliable way to target the second call.
 *     f = BytesIO(np.arange(1, 100).tobytes())             # <<<<<<<<<<<<<<
 * 
 *     iters = np.arange(1, 10000)
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_100); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1435
 *     f = BytesIO(np.arange(1, 100).tobytes())
 * 
 *     iters = np.arange(1, 10000)             # <<<<<<<<<<<<<<
 *     mem   = np.zeros(10000, dtype=np.uint64)
 * 
*/
  __pyx_mstate_global->__pyx_tuple[8] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_10000); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(0, 1435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1456
 *     # usage for the first few iterations, but then
 *     # it should remain stable
 *     mem = mem[5:]             # <<<<<<<<<<<<<<
 *     assert np.all(mem == mem[0])
 * 
*/
  __pyx_mstate_global->__pyx_slice[1] = PySlice_New(__pyx_mstate_global->__pyx_int_5, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(0, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1484
 * 
 *     with tempdir():
 *         nelems = np.random.randint(524288, 525000, 1)[0]             # <<<<<<<<<<<<<<
 *         data   = np.random.random(nelems)
 *         with gzip.open('test.gz', 'wb') as f:
*/
  __pyx_mstate_global->__pyx_tuple[9] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_524288, __pyx_mstate_global->__pyx_int_525000, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(0, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1486
 *         nelems = np.random.randint(524288, 525000, 1)[0]
 *         data   = np.random.random(nelems)
 *         with gzip.open('test.gz', 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(data.tobytes())
 * 
*/
  __pyx_mstate_global->__pyx_tuple[10] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_test_gz, __pyx_mstate_global->__pyx_n_u_wb); if (unlikely(!__pyx_mstate_global->__pyx_tuple[10])) __PYX_ERR(0, 1486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[10]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[10]);

  /* "indexed_gzip/tests/ctest_zran.pyx":1492
 *         readbuf_size = fsize - 10
 * 
 *         with open('test.gz', 'rb') as pyfid:             # <<<<<<<<<<<<<<
 *             cfid = fdopen(pyfid.fileno(), 'rb')
 *             assert not zran.zran_init(&index,
*/
  __pyx_mstate_global->__pyx_tuple[11] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_test_gz, __pyx_mstate_global->__pyx_n_u_rb); if (unlikely(!__pyx_mstate_global->__pyx_tuple[11])) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[11]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[11]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<12; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      #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_IMMORTAL_REFCNT_LOCAL);
      }
      #else
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_slice;
    for (Py_ssize_t i=0; i<2; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      #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_IMMORTAL_REFCNT_LOCAL);
      }
      #else
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  {
    const struct { const unsigned int length: 10; } index[] = {{8},{15},{32},{62},{17},{30},{35},{18},{20},{0},{1},{1},{2},{7},{13},{7},{8},{11},{6},{11},{11},{11},{15},{2},{11},{11},{11},{8},{19},{29},{33},{23},{26},{21},{28},{24},{21},{26},{25},{27},{25},{29},{22},{27},{28},{23},{9},{9},{15},{11},{50},{39},{34},{2},{15},{15},{41},{11},{15},{15},{25},{36},{11},{7},{15},{2},{12},{7},{5},{20},{11},{10},{28},{30},{17},{6},{0},{1},{3},{6},{4},{18},{5},{3},{7},{6},{7},{8},{4},{16},{7},{26},{27},{17},{18},{5},{5},{7},{14},{6},{11},{10},{4},{7},{4},{5},{5},{10},{13},{6},{3},{9},{9},{3},{8},{6},{8},{3},{12},{11},{11},{8},{7},{7},{7},{6},{1},{8},{6},{5},{8},{4},{5},{5},{2},{6},{10},{5},{8},{9},{12},{3},{7},{7},{4},{7},{1},{2},{5},{6},{6},{12},{29},{7},{3},{2},{8},{13},{2},{5},{5},{9},{6},{8},{4},{8},{3},{7},{4},{5},{10},{8},{6},{6},{7},{6},{6},{2},{5},{3},{2},{4},{2},{7},{3},{6},{3},{13},{7},{6},{4},{4},{3},{5},{7},{5},{11},{5},{8},{11},{12},{1},{7},{6},{7},{2},{4},{11},{12},{13},{9},{10},{17},{13},{6},{6},{8},{6},{3},{9},{27},{12},{9},{14},{1},{3},{2},{4},{4},{10},{11},{8},{9},{7},{10},{8},{4},{12},{10},{12},{19},{10},{6},{4},{4},{2},{7},{8},{7},{5},{4},{4},{8},{10},{3},{3},{6},{4},{7},{8},{8},{20},{19},{43},{39},{33},{28},{28},{23},{9},{11},{11},{10},{10},{10},{11},{9},{30},{9},{20},{18},{16},{25},{13},{24},{32},{26},{20},{13},{13},{25},{16},{13},{31},{27},{72},{52},{57},{37},{8},{9},{4},{7},{7},{6},{6},{5},{8},{3},{6},{12},{1},{2},{10},{12},{4},{5},{5},{3},{10},{2},{2},{7},{5},{11},{351},{7},{276},{252},{205},{291},{281},{540},{396},{249},{197},{64},{49},{59},{11},{52},{278},{9},{500},{421},{352},{4},{10},{280},{161},{70},{88},{180},{147},{184},{69},{207},{50},{310},{124},{514},{175},{193},{152},{348},{211},{205},{3},{3},{3}};
    #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (5018 bytes) */
const char* const cstring = "(\265/\375`\017/\205\234\000\n\241|\"G\340\014\351\0010\314\363D\204\301,\305\363<\317\307\265p-\\\013\327\302\265\230\r\007\007\377\335\227\360\205TW\326~\270\r\303'\217\n\364M\201\207\266\023\203-TO\264\327,\016\307\305\3660\264T\253\255\253TGYo(\374\001\010\002 \002g\216a]KC\321\254\301\3020=a&L\246k%L\307p\t\323g\236\301\362X\222\265\027\252\206!y\313&,\303\316\234\3464\233Y4\263J\246\2660\314(N\035\307\264&\342\320S4\263\212E\215\316N\021\025\263>KqH\304\257,\342T\rM2,UR\315\261Pk\\6\300\343k\206Y\rt\211\027\260JL\024\206Cb\226\211#\t\023\365\353'\217\347\354\245\263y\262NR4q\032\353X\212s\314\304)\306\031T\254j5\35304O\231\212\023Y;\024t~B\035\036\360G\203\017,\373X\010U\221\204p\303a\010\303\013\021pn7F1\266\227\030\316.\"F5\210\001#\214\030\240:\310{ycY;e\332\363<\355y7\005F\030\205!\254\366\212Ig55=\321\031I\316X9=\305\220\025\206b\211I\"2U\t\230\247\231k\243\027\206YL\303\320S\313\032\206\345\321;Ms\324d\236\221\262\\\2220t\206\323:\213g\212\276j%\251\326d:\213i\355\324yv\2162\025\243,}\342\320Y\315\324\345y\252iVO\231\306\262\033\016e\2318-\n\305\002\005^d\251\336\262\312\322*\013%\213b\341\230\321\231\312\272\215$K=cb\014V\226Y\035\312Y\217\350-\233Y5\363,\227\0317\233\325\306\\\276\260&\307[\036M\222U\024ca\025\2171\330\001K%M\322K3\014V\303\031K\022\303<\361,K\234}B\034\006\026\213uC\246g\220\2471\274\340\360\020\300\245\347,W\030W<\325$O\324S\261\227\236i\252\363\242\263\212{y1\223\034G\214\272\234\252\007\202@\2207;S\2307\3039U5\211\2369\236\367\341p\232bo\314(\212g\263<\363\260\227\213H\235SO=M\023\347\350\321<\305\254\275\0210\031\226\201\033\243\021F\036\203\317\033a\024\032\236\326'\360\224\014[\306\305\323{@r\244_\362\252\356a\207\364\235\235\332]\351\005y\213\227l\324\354c9\376\217\227\361\033z\214\273`v\306\t\260\233{f\2534\237\003v\224\213*\211\010\255\0006(\274\023\334\204\306Q\326\216\322\333\3723\027\356\333u\221\317pu\253Z\241\022\027\374\027_\345GXx\311\t\327[D\\\327\016\351>\357B\352\236\351\355X\361\313\274\313\203~\200\211\313C\304E""\370\310\356N\257\253\337p\033?v\033_\241u\017<\246\304!lX=Lo\313\277t\243\020\322>m\340|\230\357\3201\372\017\007y\317\006ZeV\023\006\305Gk\355\340\264\215\267\210)\347B\342#\245\227\324i<\207\3276\215\252]\035sc\034\334\240#\242v\001k\363m\374\367\242rU\246\227\364!x\240\036\303;\216`\247L\357\367I\374\007.\303_v\267;\217\234\353\257\276\213\357<\311\273\250\334U\312\373\265\345\357\340\t\244\274\370\017\3600)o\253\177\275\353E\373\226\303]\245\327\360\274]\233h\005Pz\273\276\301\205V\327\352\261\221K]\274\255\r\202Aq:A2\001\356\326~Y9.^\222\211V_u\270\024\024\034 D\360\300\243\026\351\"}\332H\333\313f;\265\316\272fC\203@f\246v\252\247Z3\3031\305jh\313f\230\207\3102\324C\347\211O\231J\332Pr\350\034z\205'.\277bg\032b\262F\013C\034\206C8\227\021\262*f\030\3544\r\020\20532Dqj\013\315\223T\261\231ej\030\246\344\230c8=\323\263\024\325(\254\014\307\227\326\241\230\212\241Y\323\351\255\226\346\232\231\326r\232\211nY\353\360\225\332p\232\226\270FCq\350-\343P\034\252\252&\231\242ey\242c\036G\214j\364DO\030\354DM=\302\302\3234\3210\2275=D\342\231m(\325d\230\211B\215\232\344\217Lk$\325\026,K\016\354\251\003o\005X\361\200\202\342D\t\021\256\210\037\367\345\250de\337f\342\232|\255fo\271\247\204\223\370\237\276\242\372\361\330Y\301\\\346\263~\304t\337,\344\224k\251\010\370tRV\204\035\371E-\236\235\262Q\027\025\\\265Q4\217\275m]Y\273u\303\313zH\317\300A\016\333\" :mE\332\017?\202\257u\221\236r\024\220\027\227m\221S\016\\i\256\025\317\213\267\204\230\ra\266\262\322\254&\320\004\216\255\0374\257\341_F\tH\030\236\302\210W\311\0218\014\307\272\321\375\017=\000'\361\360\340\017\364\r\034\203\263l\r+\270\232.r_\256F\247\003U\360\021\0009\351z\362(\302\2718\"\227H\273\032uQ!W(\204\033B\203\033s\264\323\232T\034XV\336\036\r9\271\017\016\220\003}lM+\3063@.^ZK\262\035>\007\037\323\340?\033\334!/\337\305\205{\006\n\000\027\374\t<j\246\333\360\217\273\244\245R\316\203\000\336@\361`\363\375\021\025\213\340\227x\021\357\031\320\247\374F\307q\340v\246\335\300\336\374\227\336r\202b\305\036\237""\242r\362c\346\243\376\206\247uGb\273\343:\212\265\031%HG\257\266\203\213]\2617-\354\216\356\210\201]%\345bv\206U\200\342\326\260\033\376\215W\373\315\305ov*\303\325\306\330\214\031\320\245\244\201\371\200\367Si\272k\213~\316OQy`\266\001\315\213Y\t\037\306W\370W\307\3510\274\202\227\366\211\277\266l\375\320=\247\247\250 \255k|\036\006\305\250k\035\251\255\007\026\204%\261\252\337\022\351\\|\305\265\207g\241\274\330\227Xm\275\0020\345\360\227\340/L\271o\357\254\246R.\344\004$\302\366\026\036\307o\027)%\227_\371\232\026\345\267x\230\224Kb\205|\210o\021\222\341(\336\262Q\246\\\014L\013\013\356\270w\240q\037N\364v\276\210c\036\302\323\255*\275-\370\273\276\214M\315F\221v\307A1\240\265hq\337\347\023\371b\036\305\327(\276\260I\207\333q\304\200\0251srO\335\026Y8L\257\371\256\250\272\357\205\366\311\224\202\364{\370\332\221\305\211\201-,$\016\256\312\004.\217\201YN8\2442BX\035\241>\263C\263Ri\211;.\014.\203V\304\307\337\227\031qGP\342\327V\264A_\346\305\342\233\"\233\321\367\031\275\315\344$\303R\271\244\366\305Jh\201\361\311e\257\240\005b\031@\370\330\nV\345\212\005\340\001N@'\217\016\244\224O\300I\000\227\223w\345\344\305\037\034+mJ\273\303\366\244?@B<=aV\245\353\020\020\002C\002\2429\r7\001\311\201\354\010OS~$\"Hg\261O\270\035\300\222\374\026K\351Y9\232^b!\341Dc5X\033\224\373\265\034,\355\337@\237\240\213\330$\307\000 \317\241\257FN$\247\215\323\207\024\014\211\353bA\024\200\350\330\014 \013\364ct\222SY\255\035%\014\236\321\225\333\201\341d\250\000\371iW\255Q\352\353\264\322\231NAk\302\212\231\004G\021\333\030\024\360\250u\304\323\246Z\221u\261\0367\275H\203\t\014\236\342\rHGA+\005z\312\016\241\2614\337&q\371\230\257Sh\005y\320\207\253\t!\370\311\036\241\255x\315\310\371&\236\344Q8\311\005\370k\255oA\323Y\277\257M<\324K\332\264U\303\006\201\347\351\340/\220\316\027\340-\266\344\033(qk\276N\342\362D\357\006F\017\310M\022\373\372\031\277\324\225\274Hv\307G6\200\235O\263rK\366\312\256YM]G@SUBJL6\264\355\263o\326o\325&J\027j\005\317'\220'H\221B\210\234\300`G\033\n\347}<\321""\204ngXed:OO\247\317\235\022\351>.r\"\256\r\345\303\375\0009\221\361\341\240\330\226\337}\321\343p\030A\275\002^\\\312\265pb5\032\320\212\261\226\330\217\325\037\027\340pY\010\037\350\245\273B@oq\333\032\373\265\002\340\026\034\264O\243~\360 \334\342\2640vF\203_\371\256\245\177\030\024#o\213\r\205$\250\363\006\214.\224\314\241\021\221Q\220$i\014\223@ HL \023\216\007\226\342\007\003\366\002%Qa QJ\021B\010B2\201\004\"\"\222D\n\222\2024\007'~\226H~5\260\025l\321m\216\246\240\376\352%\234u\3669\n8\367]*\212\021\306C)\350\351w\202\224\365\035\03005\3162N\231\352z\365H\032\336\271w=\361\2361+N\025&w\201!\220\023#N\260~\347\3760\200\336w\223@\3707\247?R\"\026\370\267G\214u9\246\353\272?\r\252\033\335\210\244\330J\213\036},\234\201\236\224\364\036J\370\3447r\t\022\334\244\342\362<(@\177\034\374\360;\251(X8~.\240\312\006B3 s\211\312\006\361t8\301Z|\222\364=0\272\034X\376\304\363\366\332\376\007\221g\205L!\270\220\205\242E2\000x\371\272[\213jq\324\003\232\356\207f\033\251\326D\311\313\351(\310\322m\331f\367\370\027\257s\352\242\325\340^\001S\324O\317\257\021\332x\007t\266\310${\033\267'q(\231S0f\326\302\311\006\366\0338\377\364\216\214\223\353\372\301F\201.0\026\320\352\010ni\020\325[\210\004Z\250\216J\253\340\236C\227\014\025j\003\311a\207\3240@\215%\032F\3405\364\367\367\300t\r\211fr\321,\313\370\310\007Y\340\366\365\230\343!\\L\206\363{\354\300\363R\014\340\261\345\273+c\366pXb\022Y\255\262;\256X\017 d\231\202=hf\003^\376\233\354\321\341\270&\357\020_\266\3757\254\231z\027\310\327X\204\004VW\305\327\375G\253\210\262\327\244<l\205\274\200\355+}\220v\336\317\253\234\235\001s{\3216\311\221\010\271Z\353\224\216\354\243\207[Vm\224(\312\301\336\034\232\347A\210+s\001\0341-\010\2201\231\336\340\2509\314\211s\322\305(\215\025Q\242\213\225U\253\365\220\205\366\341p\017\257\353\014L*\222\247\240\372\000\255\265I\362^\024\233\020\004\272G\337\005j&\262\227;|\003\013\302A\345f\274\016\243V\225P\316\263\356OZ\326\r\305\3036\364\203,'\300\205p\362\205J\333\201!\210\323zU\177\233\326`""\006\252\302\323\001\263\241\316\374?\021\364$\236\r\017\034W\333\370\201r\234H\200-y\035,\356s\326\032%!\316\306m\250\\&\204w!\367L;\371v~y\205\357i\202\2559M\246V*\323\224\033\024\231\262\213\277\000\255\250\262V\007UA\321i}\215j\024&\023\013\366\025\213\214\253\231g\266\010\024\370\263!\200\326\245\001\000\204Y]AVH\252\020\326r\263\356\010\336\356\347\343\312O\021\026\010-\244[\016\010\250U 4\212\366\321Ey\260\005\247/\007[\246\306\274\014\302\323\2052\366C\312\206\013\256=\024N\222#v\311YK\274\352R\020L*\314\210v\244\337\340\004\353\357Ix\201\r\245`i\203\003/\026:\234\300\300t\337|\334tL\207*\000\372\264\361.\030\0328\306\355\006\356d\224\221\245e\026y\305\240 \343\341\344e\232\014\355\311X\314`\203\014\244\240\247\t\210g\022\031e\260\210A\377\327*hA\017\nhR\213\336\371p\341\367\t\227\304\r6yq\212\322\352g\337b0\237)!\202\204p]\307D\323\213\315R|q\371\362\312\261)\322\215q\3111 \322x\t\210\226\324\215\304be\246\233\346e|\221\026?\340\271\244!B\316\267d\3601O2\2310\225\2239\344\002\"\250\\C\274i\336G\243>J\353j\022\003`s\3448\241,[\r\031\307\007wb}\003\365\323l\340\013q(\310B\356\017\242Y\016\343\341\005\236T-V\212\365\365\305W}\231\022\313\207\311\315E\225U\217\247\327\244n\200\300\035^C\361\230\370\222{D0\207\223\224}\264\034\230\323.&\212r\307>\214\273\361\364\230\367/\354\237\237b(\225:lvj\266=\263\\\277\316j\270{n\271\034\253\323/\235\2130\200\361\371,p\374\244\363\277_%\373\244\337\025;\255Dv\342hHP\005]\031\324\322j.\330;JdQ\216\341\270OT\351\"1\362\354\305\315\334\257\326~\237\320\201\"9\346\022i\000K\030\224_\204\325\233g4@\232\2018\225\005\023\267\302\236\014\013M+3\300\30535\340>z\031\3679\005\\%\372\234\234.\371\231%\374\260Q\2548\377\361\230\306\205\\\202\310H\305\312\005}cN\325\212\217\202\003\266q\272\034r\030\236\0100\002Q\205\356\271\007\277\302d\236BX\345\203D^q\232\237\0132\005\006\302+;\327\035\241\326\237hqG\326\245\207\311A\177\333\206Nx!\204\337\374\n\304\266\027\tG\350\006\257#\316$&\356hQ\324\025\001n\262\211{\216\202\227\232\371\364\363""\237/\343t\310\0075\"]X<\241%\342^\365u\300|\322\0038\242DF\3100\034-e\337&\313\031\212\323\276\202c\214E\226\257\205~\2709\311ua{\257\212\223UgK\034\301\267d\340\225l\363b\327`\337y\r\030\242\006\036\364mA\007eF\346\376\377\236\016*\272\242\322h\373\254D\314Z\306vz`\340\014!\"\306\361T=8z\207\364p\235\324\343\363G\014v\223\223j9?\035\213\273\333\017\247\366\250\276\323\274n\226/B+\006\275C\344<\224`\265!]j\307Ci\215\"\313\263\036\374\235\372\207\333\341\242\356\030\000m-X\340\224G@;\220\3536x\222\276\273F\354uf\206\330mm\206\210)JN\026\331\212\240:\247*\340\324_P\020\202x.M\033\255\347@j\261\314$C\207P\205G9=\000>\022\032\273$\020\177\330\361\350hw\211\261\\ie\252\003\376\376\177\033\r\337\267Hu\334\354N'\276\376\354F\317z\031e\021!\353\n5J\323\342\323\tkbaF\030\335k\245%\323\263\210\241b\363!5{\366=\367\016p\000M\324\270\\\030\362\244\321\221\224S\266\035LL6P\013s\206\252\022\326\006\220\037\200\322sS\366Z\007\341=\216%D\315\251/7lO\367&O\026\262\033;r\004z\0030\326\004\023\004u\300\306Ns\350\237\207\205RI\361l\t\006C\370\3474\007\370\215\225T\005[\230\314\255\205M>j\036:\332\332\202>\222\217\0028M8N\024?\024\264j\204C\240Y\263d\207\274\347\225\200\r\267\366\355K\340J\032\364/\352\350J\030\207\264`\207\036\230\312\010\213x\277Q\353\304\274N\314b\202\300\202\355\251\361\255?.{\363\225n\360/\257\035%\033\332\220z\317\337\000B\312#uQ\016\025\220\346H\347Q\177\210\027\263\253\241\235\270\016\336S\241\370\240\004\037\243\336\004\340qA \273\355\242\210\"\220Gxh\001\210:,\030\322^\025f\314-\374\306\302&>;EW\337F3\361\251\254TDl\226\320D\032O\233\0047qPG/\315%n\216qa)\302\200~\320\000\227x\374\254s\220x\\,k\320\035B\266\024\010^S}N\204W\t\313w\356V\262\312\204\340\230\"\245\310J\253p\000\321_xi\352\013\316\002\016n>\363d\270\261+\373\376eF\310\240\310\311\221+<E.\270\177'\366\240J\212-\036s\223p\226\334\377$F8&\217\360\0166meXx\212\307WU\316<-\n\326\320\0066\034G\377\237q\005n\344x\346\007\303u.\360\372\344\365\240\217\007{\027J\037\021W\334\265x6\227f\310g\346\234\224""\243\225\220\256\334\300=\216^\272\244\017\231\277\302\250\370S\340\260\233\232X\275\\\245\\k\000e\360\202Fs\020\003\\\351\245\220\300\332\273^\313f\004\017\272d\350&,\206+\345V^\305X\010Hs\327\245\307\t\030\376\331\220\322=\362\3076\035|\226\352pBY]\335\265\2567\236O\235\202\240d\371IoI\362TR\263]\331V\320%\037\205\313\255\232\300\320\017\275C\022\257k\3658\353{#\354\367\255{K\204\"\023\351\343\360j\265q<\273\271\245=4\202=\332\257\275`C\025\344FpV\315`\254\355\373\340\246s\022\232C\225j\360\265B\273\376\352~\227\230\253\320M\327\254\360Kw#\010,\302\276;\247,\251\253lL\266\314~,\207e]\211%\2007\226\277_\372I\212\035($\003\233\016b\352&\313Y\362\342\236\252\303}\263&\265\321I\007m\200id\331\220B\254?\315&`\213\362\357\027/\303t\016\251\031'\036\033$k\t\234\206\035\201\177'\002\223'\253,-p\370o\367\260)\372\207\032\201))H\200tU\236\016\002\320\257R\275;4\240\256\320\034\351&\215\317\311\013]\314\222:\022\243M \245m\3117\364o\347\311\247\347\372\0320%\0017\017\364\027ri\355\030\007\346\333Of\001\217B\t\342\317d\226C\324\335\223\\\\\003\217\374\223<h\365\003\232\327\212R\300\273\267\372\376B]r\200\203\207\244I\323s\355\351\314\027'\221\236\344?\267\336xI\314&\013\325\370P\251\022\305\022\327\311\320\216\366\216\220\350\210w=U\360\376\354\272\306\242\321\246\200\365A\260d\254\352\005\225\3171\346\\O\227\n\224l&)\\\212Ef[\247\003\031/\261\375S*\332\220\026HIyl\307\362\001|\307\217\334\221\275l\314z\237#\271mi\211?\322w\264\303`\253l\203\022S\010\261\362\232\020\370\016\212\036^$7\354\274U\247\207\031#\342F\241\204%T\276\202\204\304'>\022\003\005\354\020\301\013\240\001\354<b\240\353\214V?\313\305\227\341F\334\312\232\035\335\030\304b\352\226r\216\335q\002\372U\207n\203X\336M\n\031\\X\364\0131;?{\334\010\254\301\347\306DB\037^\342\370\254\305\355\304\256qx\";\027\204\257+\303J\253\254$?\303!*\364\374\257\345*8\261(\335\345\215\251\277\312\371\020s;\321\322\023b\273h\262 1\307\260\365N\003\247X\371\376\\T\373\265\211\210\351\312\022\207\346\246\245V#\260\340f\2731\377g02""\356\2646^\0217\344\366\253\370A\036\343\247\340{\325S\272\261~U\020\007\025=\023\007\216\313\031\316j\372\230*\006\001\377\330\333\247\2634\265\221v\0233\325*\331O\362\020\331\365\253b\235\006m\005lX\324<\367,\367\2150\346\223\\\307\035\241\371\353Qa\000\302\n\311ND\314&h\311\300\000\343g\345\240N\264\345c\243+";
    PyObject *data = __Pyx_DecompressString(cstring, 5018, 3);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (4904 bytes) */
const char* const cstring = "BZh91AY&SYpgQ\202\000\020q\177\377\377\377\377\377\377\377\377\377\377\377\377\377\277\377\377\377\300@@@@@@@@@@@@\000@\000`\025\037q\346\236\2157@9\260\367;\232\241\254d6\332\350\310\t\025v\031\260h\252J<\003\275mc\000\000\000|\260>\200I\010B\244\324\r=OM\352Q\246\2004\321\210=\252~\223jz\247\241\3552m4\032&\224\232d\3754'\224\217z\251\243 \310\362\232444\320\022H&\010\010\232i\2256\251\371)\354\224\363MQ\262&\324z\232\000\320\036\246\236P=F\200\032\000\0004\365\003j=A\220\004\246\200\222Rd\t\210\306\202\031\35254\304i\201\2420\311\265L\021\243L\t\215\010\3200\000M\030Li\247\250A&\244Jg\252i=I\240\000\001\223\020\000\003&\206\215\000\001\352\006\206\200\036\220\003O\"4h\003M4\032\212\2154\323CFC@\310\032z\004\310\310=F\t\2402\030\236\223\0100\231\032d\300\200`\214\200\001\240H\220!4\004\323 \024\336\203S%\033I\246\215\250\320\r\006\200\001\241\243@\000\006\2004h\000\323 \377\307\241+\270\230\262\275\262\3257\230ziY\241\256h8Y+8\345\342\220t\264S\302\341\213G<r\302\331\371\177K1\364\246\017\250\030\3460\034\330\236cpD\360]\360V\210\022 TdP\226L\030\356\326h\014U\216\311\211MJ\264\317&>\207J\350\243O\246\300\307`<S\234\340\r1l\032\315\307\3562\313\334\330I\240\316I\237\376\016h\202\260\022\003\024H\212\221\005VDH*\220D\213\"$\202\363u\r@\334\004\207^\032LqX\331Z\247H\222\262U+L\253*\354U\021\202\265\204`+^\205\225-\"\2221\202,\005\204PE\000AH\253\010\242\212\242\301\021QD&5\244\230\230\206rk\006\333<\023\004\334\342b6\321\205\205J\200`\254\243z(\262\241I\251\341\215\305\362KTb\306\t\233A\232\3324\3151F\014\213\030\310\242E\210\200\242 \243\005X\214X\n\254\213\021F\010\261DQ\030,\317\3309\006\010)\240\3233@\314\225*\371\220\252\273\311\254\010K\005\227\220\305T)q\003y\214\321b\246\001[Pd5\211\021 P\245PC\032\003l\220F*\301\022EQH1\317\237y\022f\301\211B\340\2558\211\243q\247\032\2600\006\001\313\220\311\353X\003\222\ri \252Z\213Ek\272,\376\013\242>2\022\271\313\361a\221ad\356\235\027\026\357\217M\244\321\254\207k\322\314r\223d3\335t[\021\260Y\233\014\226\3043\r\250`df""^[\022\360\314\221+\005\236*\230\262QL\234\316HL\360C+!YZ\312\301c:Q\214\214\215\203\t\233\036\323\006*\344cR\0052B\222\224\222\202\220e\221\225}\251\211\206\211\027\226B/\022k\233\006\301\231\327\205\345\263\2526\023\t\314Na\234\310YM\031#R\251\022Y\327`Z\306Re\312\330,\226)c\214\254X\317\025\004\330XH\265\201Z\312\3211\274\242*\302j\"\2012d^\256]\022\2766SB\315\342\2355\245$h\221\004\237\021\307\234\236\027\243\237\247\004P\322\264B\266\234i/L]\337\370\347\271y\177G\211\340\346 \336V\362z\376\274\374~?+w?\224\373\225\237\361\366?\247\226\374r\251\217\363u\255\300\343\347ph\323]R\246\271\031\247\366s\270\267\236y\360\330\262R#\275\341[;\t\257\007q\344y\001\036\024\035iy&\026@\217\nF\373\016PHuh\221x\356*UI\216\224\2513\016&f\220\211DM\212\236\222JIt\236\246\202\037\204\0003(\201\330\271\022\231#\257\322\260\242\n\002\363p=&\261aY\006!z\371hIT\251I\200M\022\311i\202&M-\014;\367\235\313\362\260\221J(\366\342\260\360/\014\205$\245\361\004UhR\206\272$\036\316\262\305\205\337/\265\227Oc\263\266\205(x\n%C?|l&\211\235\357L\247'\031\275%dYy\275\277cL\005\201\236\375\017\021\336\341*F\233|\257\232\222\263\351\036_\305Xu,\031\001\330\n&\365\216u\350\327\270\306\346\344\243~\276\271\362\313\303\263\314{\372\nH\333\333\026fv\214^\r\036\340@\317Z\225\354\356\366\033\013]\323\347ux\217[\2474\374do\335\036D\205\000\030!P\027P\272\364w\350\027\367_bn\360d\321\033U\273S\345\264[M\330+\260\224H\300\363yL\222z\254\207\201\343\234\321sr\027\375\232*\010\232\224\200\360\324\257,\346\004\322\2313\2754M#>\347\334\252*\225kS\324U+q\025{\204\245+\211\300\024\004\027\000BA;U@\025*X^\332\344R\243)O\007\253\335\316\331\274\216\254\276\372\263\210\237\256\030\342\2222F\030.c\"\350AB\033\362d\215G\240\257\367\034\316\331\035\323A\322\030\372\266\360\237L\3658\0145\305\304\n\000\326#X\212K\2033\234\202k\317\353e\323\031H\270\263s\346\370&h\250\270g\264\343G\247No\375;\321\307\"\002\241pT\255M}30\005@\240\250\024@~\277>\340.\210GL\275_\035\205;MO\326\210\243Uqu\311f\034\206\206~\2475\213\026\260""\026\t\306\"\210\021\210[\373prH\222\272c\334I:\t\347\354{\366qz<]\375\257\344iV\205\350\006\004\236$\263D\000\300\341(b\351Tt\021<[C\275\205\250\021\021\017\003\353\007x\370\356\253ee\261/\363\321\350\340z\315\273,(\n\241xy%\254\274\370\335\332\225U\315\026\013-7\310\222\261O\347\211\275V\245\344+ar\3272\251QPJ\245B\276\235\345\202\326V\224\211I%kv^\254\n\300V\207HP\222V\237\031\215\214\nw\302^vP\205\260\3556\245\305\262\027\225\325\001\266\2077\232L&C\257V\3176R\266\373\355\3502/\234\245X\276\177\227\207=Z\311\324E\350\355\271)\352\211\347X\321\232(?Q\266\201l\2666#*\014jA<E\346\020\024\215\316\332f\010+N\351$\325\020\342+\201p\312\"n\010.%\223\264f2(\0303\007\031&\027\272f\325d`\3248\2421%\342\355\202L\325\"\206\263QM\031\231\236\tP<\271\301\240\321M\013\\>D\266zs2\003~\337.883`\217V\354\250\t\036\026\241\003\034\232\271l\263\341F\332\177\263\341\013a\262q\315\265\005j\250^\032B\014\210\273)\tz\230\222d\233\264\265\217\216\353m\207\031-m\2560-T\263\272b\313\010\\UH.\326g+\230\354\364\366\233\245&\020\307\024\006\343\000K\007\030\262X\270\354\307h3*,\007\202\006\224\365\224IZ\321B\254JV\255+Z\265Zl\345\317\267(l\317%\266\242\224r\232u^\214\n\373\233]\n\006\370q\034\374'\n\ra\300k\341\330\0343\246 9\003\216C\201\0341(l\354\330Q\034\n\375r\264\315\323+Z\355\344\241\327\232\365\014\0149h\025\364k\243\226\344S\006\004\260\030\020`K\000\030\014\005~S.\242[<~\253Bv\222@\363\372'T'3\344~\255[\271\037{\020\351\275\020e\201s\023\347\215\335\024RY\200Zes/\270\206\330\351\223\272\263\230\235\254D\247\035L\243\230LW\344qe\306\227\037\037\037\rz1\342'\304\316\007\256\216R\351\215\255\224\2126\336\235\375t\353%q\220\366\250i\"\221\001+\2711:\365{_\346\003\333\206\307\230\220B/\327K\320\366\240\205IJ8<\322xE\372Y\002\322\371n\245\315s8\273\013\300\257\222\317g\246\tB\321\010\241\231h\245\347>\025\267 Jzq'\264\210+\321l\010D*F\223k\340\2242\351\324/kN[a\224\3207Y\300\336BB\021+8I\023\272V\332\351q,\266\21268T\300\265\353\026\204J3\310\340\220o\323=M\3237\365\310r=\340\215\347""\214\260\326]\272\003\225\023#9\306\225\"IV$\271\316<upU\337\205\334V\227\026\311\326\343\225\250s#6y\262\370\227\033)\266x\263\367\035\273\016\035\306]\314W\365\250\2742\312C\226\314\3659\353b\320yF\230<\001\202A\313\032\r\034\311o5j\360/H\324\216| \326\327+c\0063\373\262\026S(c\212\356;\366Z\003\314\347 \033\345\2036n\235\034\235w\034\247\"\274\201\213\030kq\3123\333\233\307\325\310\346\206&\035m\346\234\335\236\276\270\216\254\371\372K\265\232\0200cja\2068\034\241\247;\205\216\233W\025\036\023\235l\264n\204\203\240e9\336\355z\270sL\312\206\021\214f\\\001u\t4pE\005\345\264\330\017\253\253\247\277\334\023B&\227q\276\241\274= \314.G\324\300\216\302\0030\3161\3645I\326\272\201\262\037a\374\302+\342\236\353\r\363D\035\014\222y\0012\030\335\322\3029\272\307$X\256IX/\0348l\2348\2150An\255J\306H)6\251\005\007\014`7\016\315\233\022[\213\352\336\200\203/\n\373\257\230\313;\005l@g\327\316\372\354vX\276\327\313'U\244\331]\274<\360\211\223\246\321\031`\326E\252\r\224\020N\017\353S\227h\247\304\312\346Ui\215\261\271\350\034\251s\177\245\347`w\326\215\352\037f\330\006L!\340\034\354\272\262\"\343\030l\0134\233G\233\256\000\225\325\271\335\304\370\355L\"m3\"d\r\205\210|<8\353\326O#WD&=B5\214\34165'\211\257\212WN\374P\363\220\313\213\r\336\355U\2704E\014\216\031\211\224\322c\342\210\246)\236\254\310&\211\215kzu\313\010\317V\364\234\302\322X\231\031\2575\021\227_\026\244\202\366\242\016\326K\213\206-\205c\231k\327@k\333\251\3602{::\335\223\262\304\346mt\331;\014\303-D\036>\334\206\250\033\361\354\217)\0278\230\372j\340 c\301\354\216\274\343\022\334!t$\033\3036\366\364\251\007\355:\351\311d+\025\225\201B\t% SL\242\006\211\315\220\335a\270\033\230\363\337\241\2046\310\321\343\243vcE8)\343\227p\\R]@v\22219p\3049\370\274X\023\355\347\202\353\267^x\324\326\350\rx\010\317+p\342\336\016\275O\307\226\245\252\273\002\262\031\221Me\\(\273-\207y\356\211\213\246\210\336\314\0311\225qc$\267#\234\347\350]\345\336\335\323\273\014X\214\203A\022;w\240\351\235\0355\035\343\276J\034\265\253\347RXtI""\362a\302\031\"\002\347\323h\254\372\363G5)\232\006\303\253<\262\336es\372\266\327\251\335\216M\215}sg8\321\327\263\352\3613\345+\237V:)=Y\337\303m/&y\321\304\342\221\\\324\224\332@C\025\346x\261&\266\014\220c6\360\234\322\rl\35680\223r\036I\333Oo\275\334\203p\033\226\340\334\267\0107\033N3\177>\2759\347\255\206\216\255\326TwA&\"\\\360\2065\027\233%6*4\233\t\320p\310a\206EY:#\001\026\337\307\277\021\207V\326\335hRO\313\002!\316\035<\345+n\366o\2479\347\315\335m\332u\353\272\327\326\326ol\345GK\243\265\335\271\340_\253`\203\336\3536\034\003c\226\335\255\000\271\016\2401L\350j\347!\203\213\202\352o\030\273/ [\022\323%\231\342\364N\263\316T=L\367\3713\"\260\010\254\\\311L%\022\317B\231\212\265\013\206:\304\272\304u\235b\3561/\365\340\275(3\236:_\221\014F\035\337\006d\365\032\216K\367\302,\017\304\353L\335\312\232\033\317&\243\230\221\213u\333p\270\216\321H\260\246\356\244\214\235\355\303\214\002\247\031b\313\214\231\347\237*\307P\354\371\372\271!\254:\225\337Mt\215I-)\006\2204\251sd]\255\260D\016\030\2033^\211D\007\n\025\000\237l\201#\251\211\313\351\016\026\246\277\225\346\303\231\216\250JG\031\236i\034\010\323O~t\256Q\014\3136I\311\006Ln\026\217\330\027\241+\325\367\337\264\355v\375\323\273\257\331\335!\371!\371^v\310\016\0230x\330\372\r\301Q\313@\323D\2637\0205?q\342\364\0207LRS e\211\216a\301\344\037\335y\332\364o-l\213\215\255A\312\324\243*\275\016\325[4\373\003\215' \214\004&\274\334\375\3758j\354\026\223n\"\234dX\260\244\243\305CI\031\017\203\216I\307\027n\321\343\234\365K\332\257z?#\212\207A\221\263M\035\362\245\322\301y%\025\311 \354\247HyckC^\251K\361\002\240K\325\027\212\242q2*@\324\013\363\344\350\331\353\226\225j\nx\003(\366\316\367 \r\216g\324\026\233\224\341\316\023\020\251\272\315\326\330(D\r\235\243b\026R\356\354\n\255\337\357\275\254\262\312\303\275\261Q\026\010Z\203\004\364\270\272\323\204\034\271\220~i-\354\321\021\226\260T\213\003#\304e\213\205\316\021Rj@\264\003vx|\360\374y\2017\003\214s )7\374P\365\315\240\325\t\265\335\215\024oQ%\331\257\302""\300\014\324\203\223\320P\241\306\031\323\310\355T\340H\223\354\355\376M\3141\374\320\22067wn\363\351&\026_\330\365\315\267@\360\314\324\210\253\260\305\345X\240[\367\2016\222x(o\254\331\233\353\342ey[\367~'\230\352J\021E\003\237\215\212\022\005A@\302\031\"\220\275f\336H\357\025\246\n<$V\t\313JC?\334\032\223\312k\225\\\031is\022Le\234\307\014\267\003\300o\023\344\033\223\310\016\376\010'\220\361JH\365\325Q\261D\373-\213Vx.$\022\311\231\217\234o?\277\345\034\217\006\222 9T\327\005\026\022\236\261\344lkwV&\337\232\024\313?z\326\334\227?\257\376\223\372\006\376\377+|\225u\341\033\211\005;\241\255\231\262&M\216\005\305\375\323\343\267\365\317 Lv=\306\370\314\331\232\267 \230ME\225\272p\216\221%<\226\241\r\233\336\313l\211\215t\001w\304T\312\252\023\246w\210\263\302\014\022\260\255#\375\007\311\243=\311\330\026\226\027\3464K\375\220H\220K]VNc\007\256T9\240?\303\006c9\031\217\221\215A\260i\005\034\\l\363\222\343s]G\362\010\025bm\214\203\306Hn\232\260m!\340\322\203bu\330?\317\034\3065\216r5jC\242\\\236\353\347BZt^0_\362\257\022\201\241\313\351&\343msC\250u[->\036]kf\244\201\270\341\340C8S\\\240jR\205(Ld\227\202p\024\205Q\007\247\331Z\326\273\363\352\237[\241\221\260\330\351\006\306[+\177\033\233\246V\035.\235\025\214\007\264\315\277\2444\243\347\034\216\374\232\265\313t\230\360\305'PA-J\255\027{\372\346Npj\202\023\337\324x/\034\326BrZ\352\331\314\031N\206nD\272\3339\013\342\214\205\206\367g\261ja\023j\341\361\232nZ\224f\344\0338B\030\246\257I\353/r\242\n:\352\316\223dM\231\223\224\204\251\276ZiB\315\237\231\256~\356t\212\207b\371\320\204\322T\212\232\306WzE\245\246w\3149\243\304\304\251SL\356\2645^E\025\203\363\2152\020\263\207i\255\034\375\332\017\342\213\364\351\244\276\203\330\026\016\3652\210g\031\257\245\207z\211+\264\237\n\177!\220\313(0\342\2206\2552\236\246\241\244\206\202\216\235~s\275\373\322\276>=\032\024\230\347\030k\344\275\231#\215\207\245S-\346Z\177\353h/\330\215%\007\325YG\234\265q\320\262R\255%*\322\347\310\256\377\314=\321\360_+\334\243\222\224~\247\343""\201\332t\324\326Wu\305\301\242\010\366\206\224,.Hb|\353\027\303\320hR\315\031\363\254\321:\022(\243\247\213-\267\031ni\317\241\363R\207\233#;\271U<\2749K[/\025\311]\033G~\212\314\230\376\326>&\342i\343\350=\231\315\372\013\024\244J\270\340\341\305\205g\305\227l\362Z\205e\225J\317\303\322bN3V}<|\034I\221\304\231c\342\247\177\203\311\333\207\016d\223\307ve\264\310\242+\031\355\357\345I{\0310mnh22G{\272\317rfib\266\334c[+m\357\261\355\211\306\225\017\305\236\303\207kdlY\0349\262\347\314K\200\312\301\334`\356F;\234\356L7\006P\233=\266\266F\304\315\326\036\035\305\367\355u\305\312\246x8\016\025\342l<+\307\375\270}\316\r\262\237\212\205\033\177\227\013\245\313\302\376\356(0=1P\217S\204\336\364\371_o\t\333\355\033w\241z;\375\271-\355\343{t\345\354\255\316\306\352J7{2\237\261\350&.~vl\0260\006\370\356\006\311\313\020\n\260>Z\262\354-!\312\216\036\300\307F\253\3100\246(\027\"$\301\312\224\234A\334w\025\270)\nN\301\362\224c\200\324\200C+ \310\233\317A\306\356\346\r2\003\304\3058/\n\007\266\035s|?\241\332\017$;f\351\253\007\324\333\365\221\327\205)\022\233O\347\376Z<\251T\251(\224\312D,\037-1O(\264\345M\313Z\252r\332&iM8\246\202\010 r\351\243\024\023\023E$\356\237;l\2345}\316\236\306m\237\037cP\024\246b\264\224\rd\234eeT\017\014\234k\324\326\265\204P\\\273D\006\013\033\010\336?]\330l\177x\310m\2127\016mw3;\242\361!\311\227)=\331(\253z\035\346f\251\246a\332h\037\367\226\214R\242K\310\335\261\246\255\221\003\221\260\226\010\361\220\365^\340\344\313\243g\227\347\232\335\213w\021!#\"h\006\222j\251)\371\304\212\350\243D\204J\322'\017\023\026c\204\354\355,\222\010[\204\351R\232\231V\320\210\273\210\335\031\000\323\266h\342kYx\352\365\250\271H\332\323\356vHs&\010\215\256\213\276\231\362f\316#\336\253Xk\\\253\324Q\020\347\023\tT&\322\213p\312\235#\234w\273w\341\334*\335\013\020\266%\344\241\331\362\335\323\362\307\331\022\211\202\246\t\201\313F\023z(zf\343\2435\253\231\211\271b\375A\312Q\377\305\334\221N\024$\034\031\324`\200";
    PyObject *data = __Pyx_DecompressString(cstring, 4904, 2);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (5067 bytes) */
const char* const cstring = "x\332\275YK[\333V\267\216\023 \2068\211\315\035\322\024\033\002\004\222:\345\322@\350\345;\206\204$m\31795$\315\255\255\036Y\226\215\023\333\262%\03104\247\031z\250\241\206\032j\250\241\206\0362\364\320C\377\204\374\204\363\256-\371\006\016\241=|'\017\221\266\366u\355\265\336\365\256\265\267\017\337\007C\337\007\017\337\037\256}\035^L\274\017*\242 e\343\312\006\237\315JjP\026\225\324\201\030\344\203\0311\223\341s91\036\344e\231/\206\202\301\r)\227\302\247\242\312\"\237\t&d)\023|s\370>\370\025\346\372=\250J-\037\267Q\312\361\361x*\233\014\306\212\252\250\314=\222eI\016\362j0'\245\262jp:\376\237bF\222\213_\321\022\324\253.\314\343u\032<\367\213;\330YK\t\276\221\344\024\276 \331\032[ \034\016\377R\304\024\334\226\310\247\323\222\020L\360\2514\312\361\365B\"!\312\301T6\245\262\272\360\277\370;q^\345\303\311\003\367\025Ne\343\342~<\245\360\261\264\030/d2ET\212i1#fU\232\\\314R\203\270\237\303\312qV\261\237SD\361\235[T\305t\232\212\t\247\340\374;|\237\024\222\222Z\037\201b}\004\212\365\021\341T|?\254frl}1\316%\017R\2710t\243*\341\016U\260\211*\356\253\351T\254\265\361\036k\274'\320\213;\220\371l8W\334\3570\232\212\035\252wxe\347\330\214u\t\244N\225\252(\253\222\224V:\264e\013\231\\\261C\275\244t\254\014\347xu\247C\013\266\020\2272\235\032DE*\310\202\330\241I\331)\250\251t\247\206B,'K\202\250t\222A)v\252U\305L.\221JwZF\335!{\002\205\235\332R\0311\2458P\211\223\2370\260e\031\326\327\352\230\310\022\252\350\023E)\030\027\023|!\255\0069N\006\354\004\221\343\202\361\202H~\223\225\262_\251rj7\305\247\321*\020v9\216\3517\314\t\222,\2063\030\227b^\310\226\201\017bT*\223\223d\265\265[!\003\035\237\350!\337\241m\304\n\t\216\344\344\016\337\323g]2\242\201\367\301{x\255\005\335\335\242\034t\335Aq\234\034\025\360\267\240\003i6\206\212\324\307\375\014\006\225\035\251\220\216\007c\314=\017]\202\t\276Qr\337\037\276\277\313\374\026\205\337\033K)9\036\333L\262FH\346\266\263U\032nu\370\236T\r$\337\206_\211\220\204O\222Ls{w\016\327\366\235\025\360^'\215?\375oF/\034\367Kq\037\377\037\246\004""\225\373/8\317\226\230\330z\276\035y\374\210\333~\364\363f\223\036\232\245p\303\032BQ\335\221\262\034\327\326\246\210\252\242\362j\307V\207(\2371\220\360 !\036PN\212\274\234Tx\245\230\025R\022\\X\226\200\324\254\250\3042R\\\304F\361\267\215A16\203\273q\367\245\010\211T\\\330\021\205w\034\021\025\267\313\247\361\r\312@u\003\024\341\357\300u|Z\371!L\337`\350\016-\337\245\371L,\316\377\200\2464\257(\\RT\341\307\324\023.#r\251,\247\312\274 \306x\341\235\220\226@\376$\233\220\311\321\252\202\224\001\355aP*\213\311AA\002\257:O@]\025\233\234$H\271\242P\220\t\0034.N;\210\253\305\234\310\200\3055 \306\355\311)\020`V\314\nXE\314b+\260\241(\323\253\220\021eL*J\320\005Y/\221\025\367Sp.\264\355\323\226@\266\364\007[\306\n\251t\334-\263\251\235\"C!+\212q\227\257]\256vy\032/\2501A\376\235\3453\"{K\364T\330\0032'\322|\222\376+\211tA\331Id\023\222\014'\"\324;6b\246\341\270D!+p\244I\271\240\360I\221\025\035`p x\227\371]\252'\226\250\363l*\316\270\203=\026\330s\221=\267\035\374w\242\375\006\263\273\026Nes\340f\205\003\034va=\205k\240*\305\354\252\020I+\r\246~\267G\010\254c\000\000\200\"3<\214\316Q<\177\247\020\337\221\301\351?4\215W!\215]\200o\240 <\031\2039\304\345<sY\266@V\342\022q%\233c|#%\022RN\312A\231\212\313\354\220\010\1779\374\361q\n\374b\334E\224\233\005\340\205A\3243'\245\323\030\233\223\221\006\200\254\341{j\256\010e\347\212\260\026\350\np\317\025\331\243\216}D8\316Uv\276\300\247\035Ae\n\034\230\302\211\0372\277G\213\3111\262\203Kw\344hu\346S\216\225\225&@\033l|\202\t\032\025\342>\0253\322\256\350\370|=4\341\rb\226E\372+\310Y\000\270Q8\351\216n\023\360X\020\345\002l\262/\303\317\344B\226\023d\201c\306W\224\030b\n\360\033'\014\323\177\216eK-%*R\314\251\0230\253\300R\364j\366\200\225\341\006\351\004#0\327\262(\271\021\250\205\326\270\016\024\347Py\016\324\341\304Y\246/\030F\311\271\254]\177\001Z\254\rzgS W\313\320\177\030ZiFb\245\220A\344E\037\270\014\271\007\0010\236\222\353q\227c[w\237\314\3179uG\31427gu\244\035\306\205\274\232\"\3729Q\325Tu\2736O\357J\036\306\221\213\235""\332mO\346s\254\203\203M\316\211\250\234\303\022\334\356\327\035\332\340(\216!Z\333\330\226\234\016\254:\001\322s\013D}N\221Q\220Sl\354>A\346tJ\216\362\250D\234*\262\"t\352\020F*\013\026S\305\247\024\013\322\"\377\216\203%\233S7\366\311b\005S;\363\177V\007\201yx\257\243|V\343\370\024\327X\272\345\233C\261i\033*\200\230\322m\037\350\227/\200\344\221\3154\353\261_F@\360!N\226\030\336b\205d\243\235\371\245\003+\027S\324\302\026\214\211E\234N\020.\342\315:D\236\346G[K\003;\\\0146|\327\322 \265u$\037j\3738\351\260ns}/'\247y\227\3121\340\354\245\324\035@B\242\260\246\356\000\027iIz\247p\351\324;\221\313\212{\234s\206\371$\366\376\346<\316\030\025v\340\3458\347\204#62[\200\356]\272\375\364b\237\031H\235\010\037\215\334\227\022]UbQA\225\030\360\n\000\367\322\"=\357/\323s\265\240\210,\265\204\0031vSv) I\264jB\332\333\213\355!\314I{D\307N\311\2610\271\026\233\017|*)\010\200MI\017\224\003\365\361\353\247\017_^\270P\2712e,|\360T\273\372Js\332\202\026\371\340\371\350\277\320=\250-T\273\006Z\037\265\336\253\245h\351\255\336k\004\252\336\353\245]-\252\211\372\212q\313\340k\370\334\327\016\214\200\0212\026\252\223\363\346]\213\257N~e\276\262\322\345Pur\252\361\307:VFn\233\0363`\336\266\246\254h\355j@\013hs\372\242\376\2339f\205\252\276\001\355\276\036\320\357\030/\314\207\226\247\352\033\251\214\314\241o\310\\\265V\355\357\312\273Go*/\223\225\244RQT\352\273\254\025\364\r=ox>-\\\365\314\302\235\227(\336Q\335\203\201\267i\301\232oX\343\265\274\216\361n\2014}\245\004\205\177\274v\241\333WZ,\275\320\236\350\021}\333\3506^\231\tk\035\322\365\3725\017I3\204\021\207\306\234\271P\365]-\375\n\333<\324\275\206\307\221\363\216\376\332\310\327e\234\326\367\214\270\311D^\325\327\214h\325\037\320F\365a}\027\262?\206\264\020\003-\225\033w\315\210\0315w,\301\016T}A\303\003\245\3346C\377h\302\300\220\026\255\014\317\032E\250\306?\256\317`\262Qs\304\352\262\"\370\254\214\327Wz[F\363\210\246\352K\272`\004\332TS=\241\232J\327\222\265P\365B;U\337\204\236w\0377t\210\337\374\304\343c\360B\357u\030\333""\003\211\362Uo\177\245\037\0106\"\220m\303\314\223\275UmI\313\032\221\306\304\037{\332\007h\363\320xTO\032\277\232\213\346\266\325g\207\352\2432-r\321\250~m\\_\320#Uo@\033\320\330\213\2767\r\014\030\322^\223\271\215\021\323\013\035t\030_sv2\010\373>1\036c\245(\351sQ{\006\rL\352?\031y\363\262\271kmY\305\362\2452\341\341\356\205\276\200\346\2415\372\265\025\246\243U`m\321\212\002\022n\345,\301\270\372ihxG4Y\037\322y\375\300\204\037\214h\273\372\226\236\257\333\367\025\234\341\023\3665x\330~f\266\355o\376N\315\327\257\315\352\375\360\210-\322\374\260\366\226Af\326\0342\337\332\036`\25220o\316Z\023e\362\016\327\305V\314)3\212\315x\211BV\260\317H\265\213\364\261\257\027\315K\246\303$\332S6\341\340\315\266\327\320\361\n\366\372?\263\316\314l\315\353+mj\241\232\257i\261.\363G\213\257\371\256\227\024m\n\225\177\231|u\"l\242\346*\241U\321\247\364(\254\037\030&\214/X#\266\307\036\264_\227\325\243\0058Bs\236@s\206C(sb\036\276tr\006h\3552l\335eF\330\340\006\r|ZE\364\241b\223\223\306\206\241`\342sa_\322\303\265\322\216\026\0030}~\315\253_\324\347\215u#f^4\347\255\037m\276\272\374\203\315C\344\253#\r3\217Y\223\326\206uP\0168\374\246\0006y\332\262\n\251Cl3#\032p\321PG\025x\271\013\360\345\261\341\242\345e\020a\343nc+\221\372$\241Z\003,\253\346\022\220\324c'\313\321V\305\364\374\277+f@[\003\037\360\372\276\241\232k\326\257\366\n:\234ZY\231\370\326^\202\322:u\302t\225\201[\340\243\250\221\004\273\\\241\216\255K(P\370\246=\013\2656g[\263\247\354h\365\014\235^\225cG\236\326\331\376\002\307\366\224\223G\321\226\216\233e\341(\320:[\336\354\265\372\255\245\023]Y\323\265O\315\320\000\014\371~JW\341\334\223\346\023\204(\301\356\247\230B\352%\244S\340\2709k\344k-,0g\255\331\277\226\227\312\374\271\000\246\211\215\276c\330(\032\275\346\000\\\253\236\2460\371\251\260\244\361\347\222\261\3245\265g\010\346\270u\337\036\001\333\265U\006\252g\350S\3636\331s\324\302\220\372g\210\242\304*\242\302k\306\331\023s\324\367dM\257C\325K:\337(\324|D\353_a~\"\357\263~\\\255y\311\371\275\320\270L\242\367k""\267\365\220\276j,A\312~\363\201\025\201j*\327\021d\215\036R\223#I\264\225\337o[s\204r\307O\207\264\210\266\255_\306\354I\363\245\365\312N\225\363\325\256AV\331\203\370J\331\302\302\361\212\025\204[V\365B\217\300\236}\327\352F\252\0357\222\257\264\301\370\3659\354\375\204\034\252:=\343\374\021\t\277$\340!\225\034\001r|\345\315\243;\225\347\177T\376x[y\233\253\344\220\225\355Vv\213\225\342\001\303\034\226\271\352/\311\210\341\033 \020\004\315\353\237\370\250\371FA\214S\372\013\343\021\324\201\220M\210\\!6\257!\313\tQ.\360\301S\353\362\225\"\245\347\332\214\336\255\377j|c\272\025\257\201\355\253c\372\027\306oV\200\222\273\336R\037\224;\305\022\r7\321\235\327\237\242\350\033a,\026\252:\356@a:\252\213P\355-\2231\360(R\311\237\315np\207\347\357\354\363\270\240d\275\007\330\326!\224\031C\256\221\247,\366Z)\t\r\363\037\"\224\335\370J\313%\010\200\004j\232r\000\362\367\014F>\204O1\024:\255H\035\200c\262\306\217\032\030\217\275>D\250\360\230\316\013\307\022\354)\362\243h\253\017Q\207|)\302\344\252\371\207\265\035=\206TepB\227\215a\243`>\265~+\017\227e\020\026\252\024\2264\017\016k\tdh\317\214!c\307dk\021\207\000\207T\354-\005J\323\245=b\204\216K\233<\222\300\026vw\"m\2776\002\303\206j]\375\332\244\366\030\200_@\0149\260F\355a[\006\311\262\352G\310\214Bm!\347<\263\017'U@*\375%\234\330\321E\243\324\342^\267(\267j\372\333\202\233Q\260\303E\243P\363#\375F\262\271\202\343\010r\2223~\004\234\360\3368\206\364\225\356hQ\347 r\255\264\005\225\356\200\256\024c\032F\331D\350\007\251^%P\203\377Q\330\306\231\344\237\037LF\316@\266\323\306\266\211\235\217\351\343n6\377\304\212\324\331N$E|6\223\336\267\025\204\337\323\216&7*7\034\210\354Y;v\372h\256\262\355\270\022\234\350\317\312\237\177}\274p\341?.F.V\033.t\036[:\017\201\260\3707@\341\200\021\251\265Q\361\214}\311>\313\031\203i\246\332\244\260\217\243\027\272C\006\014Kt7\013q\002\310\333\237\263\351\226\354Dy\275\314\223\315\337\350\327\0205T\234B\226\255<\365\355c\373E\341\222\316^8\314Q\024\270^\212i\227\3413y\343\022\350\020~cF\310""\347\206\220\350G\351\334\007\250,\232/\254\2076sE\360=M\216\007\\\271\322w\017[\347-\305\016a#]\336R7\016\304\033\000]\037\205\306\353\314\317\013\304e\204\344$xy\235\302)\322\213\205\232\227|\223\257~\t\356\252\366\217\202\213_\0023\353\246`\005\254Y\033\374\325O\356\006\"Y\207\227\341#D\222\366|\034$q\261\273k\225k\023\356i\200\345\226\304v{\225a\034\\Ygb\266Z\3275\326\223\235\034\003P\3230b\346\000\035\035\334\356\232\204\245?\331\033Ju\372)8E\005Z\372\371JO`\257\307\306\"F\243\303b\351\031@6\251\375\304\362\240]s\313,\222Ua\244\376\263\033i\017\207\355\270\r~\353\3768L\333\374\303COh{\000\253>\320\211\356\273\375\220X\324\231\226/\202BU\346\270\024\355\350\270\325E\342\335w\354y\346\216\336\017J)TZ\323\266\210\213)\036\254\262\323\262o\034\342\016\321q\023\204A\007gD\360[\340\026\225\261n\036\ng@%4\3367\002$\245\257\264\242Mk\215\311\307+S\313H\177\261\235\353g\020\345\237\365\326F\365\2006\006\271b\024\356\240\355q\212\022\001\262`+\232\275V\217\025\003#\243:\213\230\364\302xb>\264\272\351P\356\352\272\267\324K\204X\205\203\357\232\321\346U\303\030]\022t\272\233X\251\214\177my:\\N8#\032\227\023\016\230\307\341\026\3160\375\036\000\365\371\313\211\247\204\311\216\227\023;\224=6.'\332\322@J\201\006\341-1\375\n\304}l\336\307qa\225\016.\224\355xK\227Ky\315S\355\247+\243\033\330\210b\205\330%V\351\021\313\233\362\365\226\207\326%k\241c\313\206Y\240x\322\332\3225\246O \253\271\201#&\234\237\320\324[\352)\361H9\020\342Ga\010\357M\375\017P\311Oh\236rO\337\250\342\314\210\371\206y\000;}-\264\n\330>\245s\327\360\263q\262\036\371\310\261\272\266m\206\300Xw\000\320S%\034\323B\255\342,\333\371\317J\007\n\253vM\032\367@P\323lSo\216\330e\340\017\372\200~\252r\252]\335\037\236\303\321\332uKg!G\240\003\202\216\261\206\204\361\252\035\265\205\362@\371\361\321\302Q\244!\346\004\335p\300\0024\331\235r\264\312xU`\253v\224\331\331*\223\272\3265\241\377\017\002\224\210\323\243`\337(39\277\305\340\3001\201\257\224\226 \211\374\031\343:\222.\0343\361#k\000\035\017\313S\345mh\244\263H""\203u\221.\022\233\302\245\237\021!\022\231\256\263\224\226ID\037\tv\262\330\244\023d\215\305\223\350g2\324\231\331\326\303Z\234\035\274\351\264\332v\221\367\000I#;*\344\265n7#\367\222\266\311\010WJS,\0225\270\374\226\243\\=\332f~\327\2065\350\346&\030\373\320\232\262\266\211\350OT\234\202\315\226\256/\354\310\t\230\234O\3533;pJ+\023\3614\213\376\216l\363[\200e\220n4>\347\260\225\261y\267\373\000\311\324\375\3417\242\340\366j'\203\367cD/\343H\377\030{\221\033\263\032JDY]\243\200P\340g@\031\205\321\247\214\227H>6(\203\241\312\273 \374>\030\231\241\243\247\224\322\3764\036@\304-s\337\312\333}\345P\333I\r\305J\377\252}\031\336\r@\370\211P~\304\370K\304\351\264\324\270\261L\367\036m\251a\255\375V5l\246\241\300\231\005k\314\276\213\210\335v\277\352\327.a$S \266\030\030\004I\013\220y\014\371e\210n\023qZJS#\030y\331|o\343\014\205S\322\r}\231\316I\265\3011\2549\217&r \324\0171q\253\255\347\324\026\330|\t\304^aN\034h\241\223c\365\177\313k\211\230o\221Q;\333\330\217 *\353\360\320c\327\277\344ho\315^H\334E\231\352\013v\262\337F\236*\203\005\236\330\233\345\3112\313V\246)U@\241y?p\342\010V\217\225|\365\3464\235\272\2537oc\342/\200\273\233_\272\177\241I'\372}CnL\367\t\273\332+\272q\242\243\220\237\235\310^\260\004\321\377\005\222L<\326\021x_\202\357\004k\304\276\210\224\002\251\365C\244\226u(|o\277\000\005\372\331\365\022\200\363-x\021\251q\255\355\372{\013\361q\036\373\230=\n\324\332N3?\332\261\262\3079\317UF\302,\266/BV\377\r\027,{f\034\376\265\005\"\204\n\330\021\217N\r{\354@{\326\257\003\272\232k\251\021\2555\204\004\336n\355\025C\230^\264\336\224/\226C\356\225\264\300\022\326~\372\361b\2642\272h\205\000\010\336\372\263\374}\345\227(\273\347\247$f\023gS\001y\301\002\375.p\213\362,W)S\354\200\271\014\003\036\277\337\246D\222.\234Y$\336d\277i,\031oq\362yd\0171\241\376]\207\355\366\363t\017bb\373\275\375\000\363\264S\304m\002\223\022\250\177\217\230M\014\276d?\316\334\234\301\034-W\242t\360\252\237\377Uv\345\307\316\363\316\357\t\335f\364\344\357\t-\033x\300`}\356\2027\003e""\232\201|\252\034\255\271\211'<\221&b\267\034-r9Y9\223\252#\023x:\361\300\246=C\360l\360\300\271\310\336\362\343\363,\326\210t@K\323{ic\356\235Mg\206H\"\212\256\333q\004\214NN\316~\033\2332_[2\375\326\332\nGr\241o\235Nm\307\366av\375B\267\305\003H\374S\304*\024\036V\3649\346{\241&\n>a\363\026\355\222\336\002-\001\3209J\214\300\021\260\256\023\006\247Yfs\216.w\014\267\325\323pK\237\331F\344j\203q\003.m\330\375\350\243{\203\327\354^\200\242|\375B\352\034\304o;*\261\333\357\231\223\267\372M\t\351\230/ A\240\037F!\207\277\342\247Le\t\324\373\247\375\375\021\232\257T\256\334p~#\346cB\034\177\242\360\277\371(\033d";
    PyObject *data = __Pyx_DecompressString(cstring, 5067, 1);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #else /* compression: none (12303 bytes) */
const char* const bytes = "{} != {}{:0.2f} secondsCannot resize a memmapped array!  Copied stream from [{} - {}] to [{} - {}] ({} padding bytes)Error at point %dMemory-mapping {:0.2f} GB ({})Padding streams [orig size: {}] ...PyMem_Realloc failReadBuffer init fail.?a+data.gzdata.gz.indexdisabledummy.gzelement: {}enableexpread: {}expseek: {}exptell: {}ftell:       {}gcgotread: {}gotseek: {}gottell: {}.idx.tmpindexed_gzip.tests.indexed_gzip.tests.contextlibindexed_gzip/tests/ctest_zran.pyxindexed_gzip.tests.gzipindexed_gzip.tests.hashlibindexed_gzip.tests.ioindexed_gzip.tests.itertoolsindexed_gzip.tests.numpyindexed_gzip.tests.osindexed_gzip.tests.os.pathindexed_gzip.tests.randomindexed_gzip.tests.resourceindexed_gzip.tests.shutilindexed_gzip.tests.subprocessindexed_gzip.tests.sysindexed_gzip.tests.tempfileindexed_gzip.tests.threadingindexed_gzip.tests.timeisenabledmmap failnbytes:      {}nelems:  {}no default __reduce__ due to non-trivial __cinit__numpy._core.multiarray failed to importnumpy._core.umath failed to importr+readbuf_mmap_{}readelems:   {}{} / {}: reading {} elements from {} ... seek:    {}seekelem:    {}  should be: {}{} != {} [sp={}, size={}]{} / {}: spacing={}, bufsize={} ... tell:    {}test.gz(tree fragment)w+{:x} != {:x}BytesIOError__Pyx_PyDict_NextRefRUSAGE_SELFReadBufferReadBuffer.__reduce_cython__ReadBuffer.__setstate_cython__ReadBuffer.resizeThreadaallarangeargsasyncio.coroutinesbmodebufbufSizebufferbufsizebufsizescfidcheck_data_validcidxfid__cinit__.<locals>.initmem__cinit__.<locals>.<lambda>__class_getitem__cline_in_tracebackclosecmodecmpdatacompress_inmemconcatconcatenatecontextlibcopycurelemdatadsizedtypeelems_readelems_writtenencodeend__enter__enumerateeoferror_fnexists__exit__expexpect_buildexpect_readexpect_seekexpectedexpreadexpseekexptellexpvalffilenamefilenofilesfilesizeflagflagsflushfnformatfrombufferfsize__func__getrusage__getstate__gotgotreadgottellgziphashlibiidindexindex1index2indexSpacingindexed_gzip.tests.ctest_zraninitmeminpiois_alive_is_coroutineititemsi""tersitertoolskwargs<lambda>last__main__memmkstempmodemodes__module____name__nbytesnelemsnelemspnitersno_fdsnpnumpyoffopopenosos.pathoutoutputpadpaddedcmpdatapaddingpadoffpathpollpopprintproductpybufpyexportfidpyfidpyidxfid__pyx_state__qualname__rrandintrandomrawdatarbreadreadbufSizereadbuf_sizereadbuf_sizesreadelems__reduce____reduce_cython____reduce_ex__removeresizeresourceresultretreturn_fnreturn_fn.<locals>.<lambda>return_valueru_maxrss_run_crc_testsssbiseseedseekseek_pointseek_pointsseekableseekelemsseeklocseekpointsseekstepself__set_name__setdefault__setstate____setstate_cython__shouldpassshutilsizesortspspacingspacingsst_sizestartstatstrmstrmoffssubprocesssumsystargettelltempdirtempfile__test__test_build_then_readtest_crc_validationtest_crc_validation.<locals>._run_crc_teststest_crc_validation.<locals>._zran_inittest_crc_validation.<locals>.wraptest_export_import_format_v0test_export_import_no_pointstest_export_then_importtest_feoftest_ferrortest_fflushtest_freadtest_fseektest_ftelltest_fwritetest_getctest_inflateInit_leak_on_errortest_inittest_init_file_modestest_no_auto_buildtest_random_seektest_random_seek_and_readtest_read_alltest_read_all_sequentialtest_read_eof_memmove_rotate_bugtest_readbuf_spacing_sizestest_seek_beyond_endtest_seek_curtest_seek_endtest_seek_then_read_blocktest_seek_to_endtest_seekabletest_seekable.<locals>.<lambda>test_sequential_seek_to_endtest_skip_crc_with_footer_that_looks_like_new_stream.<locals>._zran_inittest_skip_crc_with_footer_that_looks_like_new_streamtest_standard_usage_with_null_padding.<locals>._zran_inittest_standard_usage_with_null_paddingtestfilethreadingtimetobytestowriteuint32uint64uint8use_mmapvalvaluesversion_infowwbwindowSizewindow_sizeswrapwritezeroszip_zran_initzsztGZIDX\000\000\320\013#\2401\200\001\330\004\n\210)\2201\220A\200\001\360\020\000\005\024\2201\330\004\023\2201\330\004\023\2201\330\004\023\2201\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021""\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330\"#\340\010\017\210x\320\027(\250\001\250\021\250(\260#\260Q\340\r\021\220\021\220)\2302\230\\\250\031\260!\330\014\023\2206\230\021\230+\240W\250D\260\001\330\014\027\320\027)\250\021\250!\2508\2608\270<\300v\310[\320Xg\320gs\320st\330\014\023\2204\220u\230C\230q\240\001\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\330\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330\"#\340\r\021\220\021\220)\2302\230\\\250\031\260!\330\014\023\2206\230\021\230+\240W\250D\260\001\330\014\027\320\027)\250\021\250!\2508\2608\270<\300v\310[\320Xg\320gs\320st\330\014\023\2204\220u\230C\230q\240\001\340\010\030\230\001\230\021\230(\240!\2401\340\014\026\220a\220q\230\001\330\014\026\220a\220q\230\001\200\001\330\004\013\2101\200\001\360\016\000\005\014\2102\210W\220H\230A\230S\240\005\240Y\250f\260B\260a\330\t\020\220\001\340\r\021\220\025\220a\220{\240)\2501\330\014\r\210V\2201\220D\230\010\240\001\340\r\021\220\021\220+\230Z\240q\330\014\023\2206\230\021\230%\230w\240d\250!\330\014\023\2208\230:\240Q\330\020\021\220\030\230\026\230v\240W\250G\2608\2701\340\014\023\2208\320\033,\250A\250Q\250h\260c\270\021\330\014 \240\001\240\021\240(\250!\340\r\021\220\021\220+\230Z\240q\330\014\023\2206\230\021\230%\230w\240d\250!\330\014\023\2208\230:\240Q\330\020\021\220\030\230\026\230v\240W\250G\2608\2701\340\021\025\220Q\320\026'\240y\260\001\330\020\032\230&\240\001\240\030\250\027\260\004\260A\330\020\032\320\032,\250A\250Q\250h\260j\300\001\330\020\027\220t\2303\230c\240\021\340\010\030\230\001\230\021\230(\240!\2401\330\014\026\220a\220q\230\001\330\014\026\220a\220q\230\001\320\0043\2601\330\010\013\2101\330\014\037\230q\330\014\037\230q\330\014\033\2301\340\014\037\230q\330\014\037\230q\330\014\037\230q\360 \000\t\017\210j\230\001\230\026\230q\330\010\022\320\022#\2401\240A\240W\250C\250q\330\010\017\210t\2203\220n\240A\330\014\026\220a""\220q\230\001\360\006\000\t\017\210j\230\001\230\026\230q\330\010\022\220*\230A\230Q\230g\240V\2502\250S\260\n\270!\330\010\017\210t\2203\220m\2401\330\014\026\220a\220q\230\001\360\006\000\t\022\220\032\2301\230A\330\010\021\220\023\220A\330\010\021\220\032\2301\230F\240!\330\010\025\220Z\230q\240\001\240\027\250\010\260\001\330\010\017\210t\2203\220m\2401\330\014\026\220a\220q\230\001\340\010\013\2101\330\014\024\220H\230H\240G\2502\250Q\330\014\023\2202\220T\230\021\230\"\230K\240q\250\007\250v\260R\260y\300\003\3001\200\001\360,\000\n\021\220\001\330\010\021\220\022\2207\230(\240!\2408\2508\2602\260Q\260a\330\010\021\220\022\2207\230'\240\021\240!\330\r\021\220\025\220a\220{\240)\2501\330\014\r\210V\2201\220D\230\010\240\001\340\010\027\220r\230\025\230a\230z\250\021\330\010\027\220v\230R\230q\340\r\021\220\021\220+\230Y\240a\330\014\023\2206\230\021\230%\230w\240d\250!\330\014\023\2208\230:\240Q\240a\240q\330&'\330&'\330&'\330&'\330&'\330*+\340\014\022\220'\230\022\2302\230R\230q\330\014\026\220j\240\001\240\021\240'\250\025\250j\270\001\340\014\023\320\023*\250'\260\037\300\001\330\014\027\220z\240\021\240!\2407\250#\250Q\200\001\360\010\000\005\024\2207\230\"\230A\330\004\026\220a\220x\230y\250\003\2501\330\004\023\2201\220I\230R\230q\330\024\035\230R\230q\330\024\035\230R\230q\330\024\025\330\024\035\230R\230q\330\024\035\230R\230q\330\024\035\230R\230q\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330&'\340\010\014\210F\220!\340\014\025\220Z\230q\240\001\240\027\250\004\250J\260a\340\014\017\210s\220#\220Z\230\177\250a\330\037.\250a\340\014\r\330\020\027\220s\230#\230Q\360\006\000\021\026\220Q\320\0261\260\027\270\001\270\024\270Z\300t\3101\330\020\021\340\014\025\220Z\230q\240\001\240\021\340\014\017\210s\220#\220Z\230{\250!\330\037*\250!\340\014\r\330\020\027\220s\230#\230Q\360\006\000\021\026\220Q\220j\240\007\240q\250\004\250A""\330\020\021\340\014\026\220a\220q\230\001\200\001\360\010\000\005\024\2207\230\"\230A\330\004\026\220a\220x\230y\250\003\2501\330\004\026\220a\220t\2307\240\"\240C\240s\250!\330\004\023\2201\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330&'\340\010\016\210h\220b\230\001\340\014\020\220\010\230\002\230*\240B\240b\250\002\250*\260J\270a\3304>\270a\360\006\000\r\027\220j\240\001\240\021\240'\250\031\260\"\260C\260z\300\021\330\014\023\2204\220s\230%\230q\340\014\017\210t\2207\230!\330\020\021\340\014\027\220q\330\014\025\220Z\230q\240\001\240\021\330\014\022\220,\230a\230q\240\007\240y\260\010\270\001\340\014\023\2204\220s\230(\240\"\240A\330\014\023\2204\220s\230!\340\014\027\220z\240\021\240!\2408\2503\250j\270\006\270g\300Q\340\014\026\220a\220q\230\001\200\001\360\006\000\005\024\2207\230\"\230A\330\004\026\220a\220x\230y\250\003\2501\330\004\026\220a\220t\2307\240\"\240C\240s\250!\330\004\023\2201\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330&'\340\010\023\220:\230Q\230a\230x\240t\250:\260V\2707\300!\330\010\023\220:\230Q\230a\230x\240t\250:\260V\2707\300!\330\010\023\220:\230Q\230a\320\037;\2703\270a\330\010\023\220:\230Q\230a\230x\240t\250:\260V\2707\300!\340\010\023\320\023$\240A\240Q\240g\250S\260\013\2703\270a\340\010\023\220:\230Q\230a\230x\240s\250*\260F\270'\300\021\330\010\023\220:\230Q\230a\320\037:\270#\270Q\330\010\023\220:\230Q\230a\230x\240s\250*\260F\270'\300\021\330\010\023\220:\230Q\230a\320\037:\270#\270Y\300b\310\001\340\010\023\220:\230Q\230a\230x\240\177\260j\300\006\300g\310Q\330\010\023\220:\230Q\230a\320\037F\300c\310\021\330\010\023\220:\230Q\230a\230x\240q\250\t\260\022\2603\260j\300\006\300g\310Q\330\010\023\220:\230Q\230a\230x\240q\250\016\260j\300\006\300g\310Q\330\010\023\220:""\230Q\230a\320\037F\300c\310\021\340\010\016\210h\220b\230\001\330\014\026\220i\230t\2407\250\"\250H\260B\260c\270\022\2701\340\014\017\210x\220s\230#\230Z\240q\330\035'\240q\340\014\027\220z\240\021\240!\2407\250)\260:\270V\3003\300a\340\014\017\210t\2207\230!\330\020\021\340\014\027\220q\330\014\025\220Z\230q\240\001\240\021\330\014\022\220,\230a\230q\240\007\240y\260\010\270\001\340\014\023\2204\220s\230(\240\"\240A\330\014\023\2204\220s\230!\340\014\026\220a\220q\230\001\200\001\360\n\000\005\024\2207\230\"\230A\330\004\026\220a\220y\240\t\250\023\250A\330\004\023\2201\330\004\023\220:\230Q\230a\330\004\023\2203\220a\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330\"#\340\010\023\220:\230Q\230a\230w\240c\250\032\2606\270\027\300\001\330\010\023\220:\230Q\230a\230w\240c\250\021\330\010\023\220:\230Q\230a\230w\240c\250\032\2606\270\027\300\001\330\010\023\220:\230Q\230a\230w\240c\250\021\340\010\026\220j\240\001\240\021\240'\250\030\260\021\330\010\026\220j\240\001\240\021\240!\340\010\013\2108\2202\220Z\230z\250\021\330\037)\250\021\340\010\013\2108\2202\220Z\230z\250\021\330\037)\250\021\340\010\t\330\014\023\2208\2303\230a\330\014\023\2208\2303\230a\340\014\021\220\021\220-\230w\240a\240q\330\014\021\220\021\220-\230w\240a\240q\330\014\021\220\021\220-\230w\240a\240q\330\014\021\220\021\220-\230w\240a\240q\330\014\r\340\010\020\220\010\230\010\240\007\240r\250\021\330\010\022\220(\230!\2308\2403\240c\250\022\2509\260A\340\010\017\320\017\037\230q\240\006\240a\340\010\013\2108\2202\220Q\330\014\027\220z\240\021\240!\2407\250(\260)\2707\300!\200\001\360\006\000\005\025\220A\220S\230\007\230w\240g\250X\260Y\270i\300q\330\004\024\220A\220S\230\006\230g\240W\250G\2601\330\004\024\220A\220S\230\006\230g\240W\250G\2607\270!\330\004\024\220A\220W\230A\360\n\000\n\016\210Q\210j\230\t\240\021\340\010\017\210v\220Q\220e\2307\240$\240a\340\010""\014\210C\210s\220#\220U\230\"\230H\240A\240Q\330%&\330%&\330%&\340\014\025\220X\230Z\240q\250\001\250\027\260\010\270\014\300F\310+\320U^\320^j\320jp\320ps\320sv\320vy\320yz\340\014\027\220q\360\n\000\r\020\210r\220\023\220C\220t\2301\330\014\017\210r\220\023\220C\220t\2301\330\014\017\210r\220\023\220C\220t\2301\340\014\030\230\002\230#\230W\240E\250\022\2502\250Q\340\014\023\2207\230#\230Q\340\020\032\230!\2301\230A\200\001\340\004\014\210A\210U\220&\230\005\230V\2405\250\001\340\004\014\210A\210Z\220q\330\r\031\230\034\240\\\260\021\360\016\000\005\t\210\n\220(\230#\230Q\230g\240Q\340\r\021\220\021\220*\230I\240Q\340\014\027\220t\2307\240!\330\014\027\220q\330\014\027\220v\230Q\230e\2407\250$\250a\360\006\000\r\030\220u\230L\250\005\250S\260\001\340\014\025\220X\230Z\240q\250\001\250\027\260\010\270\014\300F\310+\320U^\320^j\320jp\320ps\320sv\320vy\320yz\340\014\023\2207\230#\230Q\340\020\032\230!\2301\230A\340\010\013\2109\220C\220{\240$\240b\250\007\250q\260\001\330\014\016\210g\220Q\220a\200A\360\006\000\t\014\2104\210q\330\014\022\320\022%\240Q\240a\340\010\016\210m\2301\230D\240\t\250\021\340\010\013\2104\210q\330\014\022\220+\230Q\230a\340\010\014\210J\220a\330\010\014\210J\220a\200A\330\010\014\210G\2201\220A\330\010\017\210x\220z\240\021\240!\2401\330\"#\330\"-\250Q\330\"#\330\"#\330\"#\330\"#\330\010\017\210q\210A\340\020\032\230!\340\020\026\220h\230b\240\001\340\024\037\230r\240\026\240u\250I\260\\\300\026\300r\310\021\330\024\037\230s\240!\2401\340\024\026\220f\230A\230T\240\025\240h\250a\200A\330\010\017\210t\2202\220Q\200A\330\010\t\210\021\210%\210w\220a\220q\330\010\017\210x\220z\240\021\240!\2401\330\"#\330\"-\250Q\250a\250q\330\"#\330\"#\330\"#\330&'\200\001\360\010\000\005\022\220\027\230\002\230!\340\004\022\220\"\220G\2308\2401\240C\240z\260\030\270\026\270r\300\021\330\004\022\220\"\220E\230\021\230!\330\004\026\220a\220x\230y\250\003\2501\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240""\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330&'\340\010\014\210F\220!\340\014\017\210s\220#\220Q\330\020\036\230a\330\020\032\230!\340\020\036\230a\330\020\032\230!\340\014\027\220z\240\021\240!\2407\250$\250j\270\001\330\014\027\220z\240\021\240!\2401\340\014\r\330\020\027\220u\230C\230q\330\020\027\220u\230C\230q\340\020\025\220Q\220m\2407\250!\2501\330\020\025\220Q\220m\2407\250!\2501\330\020\025\220Q\220m\2407\250!\2501\330\020\025\220Q\220m\2407\250!\2501\330\020\021\360\006\000\r\027\220a\220q\230\001\200\001\330\004\n\210+\220Q\200\001\360\016\000\005\016\210R\210w\220h\230a\230s\240%\240u\250F\260\"\260A\330\004\r\210Z\220q\230\001\330\004\r\210S\220\001\340\t\020\220\001\340\r\021\220\025\220a\220{\240)\2501\330\014\r\210V\2201\220D\230\010\240\001\340\r\021\220\021\220+\230Z\240q\330\014\023\2206\230\021\230%\230w\240d\250!\330\014\027\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330\"%\240S\250\001\330\014\031\230\032\2401\240A\240W\250H\260A\330\014\023\2208\2303\230e\2401\340\014\024\220H\230H\240G\2502\250Q\330\014\023\2202\220T\230\021\230\"\230K\240q\250\007\250v\260R\260x\270s\300!\340\021\025\220Q\320\026'\240y\260\001\330\020\032\230&\240\001\240\030\250\027\260\004\260A\330\020\033\320\033-\250Q\250a\250w\260h\270l\310)\320S^\320^j\320jv\320v|\320|\177\360\000\000@\002A\002\330\020\032\230!\2301\230A\340\r\021\220\021\220+\230Z\240q\330\014\023\2206\230\021\230%\230w\240d\250!\330\014\027\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330\"%\240S\250\001\340\021\025\220Q\320\026'\240y\260\001\330\020\032\230&\240\001\240\030\250\027\260\004\260A\330\020\033\320\033-\250Q\250a\250w\260h\270l\310)\320S^\320^j\320jv\320v|\320|\177\360\000\000@\002A\002\330\014\023\2205\230\t\240\023\240A\340\014\027\220z\240\021\240!\2407\250(\260&\270\003\2701\330\014\024\220H\230H\240G\2502\250Q\330\014\023\2202\220T\230\021\230\"\230K\240q\250\007\250v\260R""\260x\270s\300!\330\020\032\230!\2301\230A\200\001\360\030\000\005!\240\001\330\004\030\230\002\230'\240\030\250\021\250#\250U\260&\270\003\2703\270f\300B\300a\330\004\r\210[\230\016\240a\240t\2508\2604\260q\330\004\030\230\n\240!\2401\330\004\030\230\003\2301\330\004\030\230\001\230\021\360\006\000\005\017\210b\220\007\220x\230q\240\003\2405\250\003\2501\250A\360\010\000\005\025\220I\230Q\230c\240\021\240)\2502\250W\260D\270\001\360\010\000\005\016\210Q\330\004\r\210Q\330\004\t\210\021\320\n/\250w\260a\260s\270!\2701\330\004\010\210\005\210W\220C\220q\230\n\240!\340\010\017\210w\220a\220u\230A\340\010\025\220Q\220g\230W\240B\240c\250\021\250)\2601\340\010\r\210Q\210a\330\036%\240Q\330\022\030\230\005\230X\240W\250B\250c\260\021\260'\270\021\340\010\022\220#\220Q\220f\230B\230a\330\010\022\220!\360\006\000\005\006\360\024\000\005\017\210a\330\004\016\320\016\037\230q\240\001\240\027\250\003\2501\330\004\013\2104\210w\320\026,\250A\330\010\022\220!\2201\220A\340\004\016\210a\330\004\016\210j\230\001\230\021\230'\240\026\240r\250\023\250J\260a\330\004\013\2104\210w\220o\240Q\330\010\022\220!\2201\220A\340\004\016\210a\330\004\016\210j\230\001\230\021\230'\240\030\250\021\330\004\013\2104\210s\220'\230\021\330\010\022\220!\2201\220A\340\004\014\210H\220H\230G\2402\240Q\330\004\013\2102\210T\220\021\220\"\220K\230q\240\007\240v\250R\250y\270\003\2701\200\001\360\022\000\005!\240\001\330\004\030\230\002\230'\240\030\250\021\250#\250U\260&\270\003\2703\270f\300B\300a\330\004\r\210[\230\016\240a\240w\250h\260d\270!\340\004\005\360\026\000\005\006\360^\001\000\005\006\360\010\000\005\023\220!\2209\230A\360\006\000\005\020\210w\220e\2301\330\004\010\210\002\210%\210t\2201\220D\230\002\230#\230R\230q\330\004\022\220!\2206\230\021\360\006\000\005\020\210w\220e\2301\330\004\010\210\002\210%\210t\2201\220D\230\002\230#\230R\230q\330\004\022\220!\2206\230\021\360\006\000\005\010\200s\210!\210:\220R\220q\330\010\014\210G\2208\2301\230A\330\014\032\230'\240\025\240a\330\014\020""\220\001\220\023\220A\220U\230$\230a\230t\2401\240C\240q\250\003\2502\250Q\330\014\032\230!\2306\240\021\360\010\000\005\014\2107\220%\220q\330\004\022\220!\2206\230\032\320#4\260F\270!\340\004\017\210w\220e\2301\330\004\010\210\002\210%\210t\2201\220D\230\002\230#\230R\230q\330\004\022\220!\2206\230\032\320#4\260F\270!\340\004\017\210w\220e\2301\330\004\010\210\002\210%\210t\2201\220D\230\002\230#\230R\230q\330\004\022\220!\2206\230\032\320#4\260F\270!\220\030\230\021\220\031\230$\230b\240\t\250\021\200\001\360\032\000\005\022\220\021\330\004\016\210b\220\007\220x\230q\240\003\2405\250\010\260\006\260b\270\001\330\004\016\210n\230A\230W\240H\250D\260\005\260Q\260a\340\004\005\360\026\000\005\t\210\t\220\025\220a\330\026'\240v\250Q\360\006\000\t\017\210j\230\001\230\031\240!\330\010\022\320\022#\2401\240A\240W\250C\250q\330\010\017\210t\2207\320\0320\260\001\330\014\026\220a\220q\230\001\360\006\000\t\017\210j\230\001\230\031\240!\330\010\022\220*\230A\230Q\230g\240W\250B\250c\260\032\2701\330\010\017\210t\2207\230/\250\021\330\014\026\220a\220q\230\001\360\006\000\t\022\220\032\2301\230A\330\010\021\220\023\220A\330\010\021\220\032\2301\230I\240Q\330\010\025\220Z\230q\240\001\240\027\250\010\260\001\330\010\017\210t\2203\220h\230a\330\014\026\220a\220q\230\001\340\010\020\220\010\230\010\240\007\240r\250\021\330\010\017\210r\220\024\220Q\220b\230\013\2401\240G\2506\260\022\2608\2703\270a\200\001\340\004\010\210\007\210q\220\001\330\022 \240\001\240\033\250C\250s\260!\330\004\013\2101\210E\220\023\220C\220q\330\022 \240\001\240\033\250D\260\003\2601\330\004\013\2101\210E\220\023\220C\220q\330\022 \240\001\240\033\250C\250u\260A\330\004\013\2101\210E\220\023\220C\220q\330\004\031\230\037\250\001\250\033\260C\260s\270!\360\006\000\005\t\210\006\210a\210q\330\010\t\210\030\220\021\330\010\035\230^\2501\250K\260s\270#\270Z\300t\3101\330\010\035\230_\250A\250[\270\003\2703\270a\330\010\023\2201\200\001\340\004\010\210\007\210q\220\001\330\004\031\230\037\250\001\250\033""\260C\260s\270!\330\004\023\2201\220L\240\001\330\004\031\230\037\250\001\250\033\260C\260s\270!\330\004\017\210q\330\004\031\230\037\250\001\250\033\260C\260s\270!\200\001\340\004\010\210\007\210q\220\001\330\022!\240\021\240+\250Q\330\004\031\230\037\250\001\250\033\260C\260s\270!\360\006\000\005\t\210\006\210a\210q\330\010\t\210\031\220!\330\010\035\230_\250A\250[\270\003\2704\270q\330\010\035\230_\250A\250[\270\003\2703\270a\330\010\023\2201\200\001\340\004\010\210\007\210q\220\001\330\004\025\220Q\330\004\"\240/\260\021\260%\260s\270#\270[\310\001\330\004\013\210>\230\023\230A\330\004\013\2101\210E\220\023\220C\220q\330\004\031\230\037\250\001\250\033\260C\260s\270!\330\004\005\200U\210!\2101\330\004\013\2101\210E\220\023\220C\220q\360\n\000\005\t\210\006\210a\210z\230\031\240!\240:\250S\260\r\270Q\270c\300\023\300G\3101\310A\330\010\t\210\031\220!\330\010\037\230\177\250a\250u\260C\260s\270+\300Q\330\010\017\210w\220c\230\023\230A\330\010\035\230_\250A\250[\270\003\2703\270a\330\010\023\2201\200\001\360\006\000\005\t\210\007\210q\220\001\340\004\037\230~\250Q\250e\2603\260c\270\033\300A\330\004\013\210;\220c\230\021\330\004\013\2101\210E\220\023\220C\220q\330\004\013\2103\210a\210r\220\023\220C\220q\330\004\031\230\037\250\001\250\033\260C\260s\270!\360\006\000\005\t\210\006\210a\210z\230\031\240!\2401\330\010\t\210\030\220\021\330\010\035\230^\2501\250E\260\023\260C\260{\300#\300S\310\001\330\010\035\230_\250A\250[\270\003\2703\270a\330\010\023\2201\200\001\360\024\000\005\t\210\007\210q\220\002\220'\230\021\230#\230T\240\030\250\021\340\004\014\210B\210g\220Q\220c\230\021\330\004\014\210B\210f\220A\220W\230F\240\"\240A\340\004\010\210\005\210Q\330\010\017\210x\220z\240\021\240!\2401\330\"#\330\"-\250Q\330\"#\330\"#\330\"#\330&'\330\010\023\220:\230Q\230a\230w\240d\250*\260F\270!\330\020\021\330\014\026\220a\220q\230\001\340\010\013\2109\220G\2301\330\014\017\210q\220\005\220X\230Z\240q\250\010\260\r\270Q\360\n\000\005\013\210#\210Q\210a\330\004\013\2102\210T""\220\021\220$\220c\230\023\230A\230Q\200\001\340\004\010\210\007\210q\220\001\330\004\005\200U\210!\2101\340\004\031\230\035\240a\240{\260#\260S\270\003\2701\340\004\031\230\035\240a\240{\260#\260S\270\003\2701\330\004\031\230\037\250\001\250\033\260C\260s\270!\200\001\340\004\010\210\007\210q\220\001\330\004\031\230\035\240a\240{\260#\260W\270A\330\004\031\230\037\250\001\250\033\260C\260s\270!\330\004\031\230\035\240a\240{\260#\260W\270A\330\004\031\230\037\250\001\250\033\260C\260s\270!\330\004\031\230\035\240a\240{\260#\260W\270A\330\004\031\230\037\250\001\250\033\260C\260s\270!\330\004\031\230\035\240a\240{\260#\260T\270\021\330\004\031\230\037\250\001\250\033\260C\260s\270!\330\004\031\230\035\240a\240{\260#\260S\270\003\2701\360\006\000\005\t\210\006\210a\210z\230\031\240!\2401\330\010\t\210\030\220\021\330\010\035\230]\250!\250;\260c\270\024\270Q\330\010\035\230_\250A\250[\270\003\2703\270a\330\010\023\2201\200\001\340\004\010\210\007\210q\220\001\330\004\031\320\031*\250!\250;\260c\270\023\270A\330\004\005\200\\\220\021\330\004\031\320\031*\250!\250;\260c\270\023\270A\200\001\360\010\000\005\020\210q\220\t\230\031\240!\330\020\031\230\031\240!\330\004\017\210q\220\t\230\031\240)\2501\330\020\031\230\031\240)\2501\330\020\031\230\031\240!\340\004\020\220\002\220'\230\030\240\021\240#\240X\250W\260C\260q\330\004\020\220\002\220,\230b\240\n\250*\260A\340\004\010\210\006\210i\220|\2409\250A\250R\250x\260q\270\n\300!\340\r\021\220\021\220*\230I\240Q\340\014\021\220\021\320\0228\270\007\270q\330\020\021\330\020\023\2201\220J\230b\240\003\2401\240A\330\020\031\230\032\2404\240q\340\014\023\2206\230\021\230%\230w\240d\250!\340\014\023\2208\230:\240Q\240a\240q\330&.\250l\270!\330&1\260\031\270,\300a\330&'\330&'\330&'\330*+\340\014\020\220\003\2206\230\031\240!\2401\360\010\000\021\024\2203\220c\230\030\240\031\250!\330!*\250!\340\020\026\220l\240!\2401\240G\2504\250}\270A\340\020\021\330\024\033\2304\230s\240!\340\024\031\230\021\230*\240G\2501\250E\260\021\330""\024\025\340\014\021\220\021\330\020\032\230!\2301\230A\200\001\340\004\010\210\007\210q\220\001\330\004\031\230\036\240q\250\013\2603\260c\270\021\330\004\005\200U\210!\2101\330\004\031\230\036\240q\250\013\2603\260c\270\021\330\004\031\230\037\250\001\250\033\260C\260s\270!\360\006\000\005\t\210\006\210a\210z\230\031\240!\2401\330\010\t\210\030\220\021\330\010\035\230^\2501\250K\260s\270$\270a\330\010\035\230_\250A\250[\270\003\2703\270a\330\010\023\2201\200\001\340\004\020\220\007\220r\230\021\340\004\026\220a\220x\230y\250\003\2501\330\004\023\220:\230Q\230j\250\t\260\021\330\004\023\2202\220W\230H\240A\240S\250\007\250r\260\023\260H\270F\300\"\300A\360\006\000\005%\240C\240q\360\006\000\n\016\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\022\220*\230A\230Q\230a\330\035%\240\\\260\021\330\035(\250\t\260\034\270Q\330\035\036\330\035\036\330\035\036\330!\"\330\010\017\210t\2205\230\001\340\010\014\210C\210v\220Y\230a\230q\360\006\000\r\020\210s\220#\220W\230B\230a\330\020\034\230A\340\020\034\230B\230g\240X\250Q\250c\260\027\270\002\270!\340\014\024\220D\230\005\230Q\340\014\021\220\021\320\022=\270W\300A\330\020\023\2203\220a\220|\240;\250e\2604\260q\340\014\027\220z\240\021\240!\2407\250#\250R\250s\260*\270F\300'\310\021\340\014\031\230\032\2401\240A\240W\250H\260J\270b\300\001\340\014\r\330\020\027\320\027.\250c\260\032\2702\270Q\330\020\033\230:\240Q\240a\240w\250d\260#\260R\260{\300\"\300A\340\020\025\220Q\320\026'\240w\250a\250q\330\020\025\220Q\320\026'\240w\250a\250q\330\020\025\220Q\320\026'\240w\250a\250q\330\020\025\220Q\320\026'\240w\250a\250z\270\022\2701\330\020\025\220Q\320\026'\240w\250e\260:\270Q\270a\270q\330\020\025\220Q\320\026'\240w\250b\260\003\2602\260[\300\002\300!\330\020\021\340\014\026\220c\230\021\230'\240\022\2401\330\014\030\320\0302\260!\2603\260a\260|\300=\320PQ\340\014\023\320\023#\2401\240F\250$\250c\260\022\2601\340\014\022\220$\220e\2301\340\014\021\220\021\320\022#\2407\250!\2504\250r\260\021\340""\014\026\220a\220q\230\001\200\001\360\010\000\005\020\210w\220b\230\001\340\004\023\2201\220F\230(\240!\2403\240j\260\004\260E\270\025\270a\270q\330\004\026\220a\220x\230y\250\003\2501\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330&'\340\010\014\210F\220!\340\014\027\220z\240\021\240!\2407\250$\250j\270\006\270c\300\021\340\014\025\220Z\230q\240\001\240\021\340\014\023\2203\220c\230\021\340\014\026\220a\220q\230\001\200\001\360\010\000\005\020\210w\220b\230\001\340\004\023\2202\220W\230H\240A\240S\250\010\260\001\330\004\026\220a\220x\230y\250\003\2501\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330&'\340\010\014\210F\220!\360\006\000\r\020\210s\220#\220X\230Y\240a\330\035&\240a\340\014\022\220,\230a\230q\240\007\240t\2508\2601\340\014\r\330\020\027\220t\2303\230a\340\020\025\220Q\220j\240\007\240q\250\005\250Q\330\020\021\340\014\026\220a\220q\230\001\200\001\360\010\000\005\020\210w\220b\230\001\340\004\023\2209\230B\230a\330\004\026\220a\220x\230y\250\003\2501\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330&'\340\010\023\220:\230Q\230a\230w\240l\260*\270F\300#\300Q\340\010\021\220\032\2301\230A\230Q\340\010\017\210s\220#\220Q\340\014\026\220a\220q\230\001\200\001\340\004\017\210w\220b\230\001\340\004\026\220a\220x\230y\250\003\2501\330\004\023\220:\230Q\230j\250\001\330\004\023\2202\220W\230H\240A\240S\250\007\250r\260\023\260F\270&\300\002\300!\360\006\000\005%\240C\240q\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330&'\340\010\017\210x\320\027(\250""\001\250\021\250'\260\023\260A\340\010\014\210F\220!\340\014\027\220z\240\021\240!\2407\250#\250R\250s\260*\270F\300#\300Q\340\014\017\210s\220#\220W\230B\230a\330\020\034\230A\340\020\034\230B\230g\240X\250Q\250g\260W\270B\270d\300!\340\014\031\230\032\2401\240A\240W\250H\260J\270b\300\001\340\014\023\320\023*\250#\250Z\260r\270\021\330\014\027\220z\240\021\240!\2407\250$\250c\260\022\260;\270b\300\001\340\014\024\220H\230H\240G\2502\250Q\330\014\026\220h\230a\230w\240c\250\023\250B\250i\260q\340\014\020\220\003\2207\230)\2401\240F\250!\330\020\027\220t\2303\230a\340\014\026\220a\220q\230\001\200\001\360\010\000\005\020\210w\220b\230\001\340\004\026\220a\220x\230y\250\003\2501\360\006\000\005\021\220\002\220'\230\030\240\021\240#\240W\250B\250c\260\027\270\006\270b\300\001\330\004\020\220\002\220%\220q\230\001\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330&'\340\010\014\210F\220!\340\014\022\220,\230a\230q\240\007\240t\2508\2601\330\014\r\330\020\027\220t\2303\230a\340\020\025\220Q\220j\240\007\240q\250\005\250Q\330\020\025\220Q\220n\240G\2501\250E\260\021\330\020\021\340\014\026\220a\220q\230\001\200\001\340\004\017\210w\220b\230\001\330\004\026\220a\220x\230y\250\003\2501\360\014\000\005\016\210Z\220q\230\n\240)\2501\330\004\r\210S\220\001\340\t\r\210Q\210j\230\t\240\021\330\010\017\210v\220Q\220e\2307\240$\240a\340\010\017\210x\220z\240\021\240!\2401\330\"*\250,\260a\330\"-\250Y\260l\300!\330\"#\330\"#\330\"#\330&'\340\010\025\220Z\230q\240\001\240\027\250\010\260\001\340\010\017\320\017&\240c\250\021\330\010\023\220:\230Q\230a\230w\240c\250\021\340\014\026\220a\220q\230\001\340\004\016\210c\220\021\220'\230\022\2301\330\004\020\320\020*\250!\2503\250a\250|\270=\310\001\340\004\013\320\013\033\2301\230F\240!abcdbcdec";
    PyObject *data = NULL;
    CYTHON_UNUSED_VAR(__Pyx_DecompressString);
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 322; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 67) 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 = 322; i < 370; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
      stringtab[i] = string;
      pos += bytes_length;
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    Py_XDECREF(data);
    for (Py_ssize_t i = 0; i < 370; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 322;
      for (Py_ssize_t i=0; i<48; ++i) {
        #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        #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_IMMORTAL_REFCNT_LOCAL);
        }
        #else
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
        #endif
      }
    }
    #endif
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
    int8_t const cint_constants_1[] = {0,1,2,3,4,5,8,10,100};
    int16_t const cint_constants_2[] = {255,500,1000,1500,2000,5000,8192,10000,16384,24576};
    int32_t const cint_constants_4[] = {32768L,65536L,131072L,262144L,524288L,525000L,1000000L,1048575L,1048576L,1048577L,2097152L,4194304L,8388608L,10485760L,12152630L};
    for (int i = 0; i < 34; i++) {
      numbertab[i] = PyLong_FromLong((i < 9 ? cint_constants_1[i - 0] : (i < 19 ? cint_constants_2[i - 9] : cint_constants_4[i - 19])));
      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<34; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      #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_IMMORTAL_REFCNT_LOCAL);
      }
      #else
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
typedef struct {
    unsigned int argcount : 3;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 1;
    unsigned int nlocals : 5;
    unsigned int flags : 10;
    unsigned int first_line : 11;
} __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 175};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_towrite, __pyx_mstate->__pyx_n_u_zeros};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_initmem, __pyx_mstate->__pyx_kp_b_iso88591_A_hb_r_uI_r_s_1_fAT_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 188};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_b, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS), 237};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kwargs};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 376};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591__5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1253};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_flags, __pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_zran_init, __pyx_mstate->__pyx_kp_b_iso88591_A_G1A_xz_1_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1264};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_shouldpass, __pyx_mstate->__pyx_n_u_flags, __pyx_mstate->__pyx_n_u_expect_build, __pyx_mstate->__pyx_n_u_expect_seek, __pyx_mstate->__pyx_n_u_expect_read, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_ret, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_pybuf};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_run_crc_tests, __pyx_mstate->__pyx_kp_b_iso88591_31_1_q_q_1_q_q_q_j_q_1AWCq_t3nA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1311};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_wrap, __pyx_mstate->__pyx_kp_b_iso88591_A_t2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1393};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_zran_init, __pyx_mstate->__pyx_kp_b_iso88591_A_waq_xz_1_Qaq, 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), 1527};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_flags, __pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_zran_init, __pyx_mstate->__pyx_kp_b_iso88591_A_G1A_xz_1_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 206};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_buf};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_resize, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_Qa_m1D_4q_Qa_Ja_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) 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[10] = __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, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) 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[11] = __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, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS), 232};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kwargs};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_error_fn, __pyx_mstate->__pyx_kp_b_iso88591_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 236};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_return_value};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_return_fn, __pyx_mstate->__pyx_kp_b_iso88591_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 240};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_elems_read, __pyx_mstate->__pyx_n_u_fn};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_fread, __pyx_mstate->__pyx_kp_b_iso88591_q_Qe3c_A_c_1E_Cq_3ar_Cq_Cs_az_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 259};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_fn};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_ftell, __pyx_mstate->__pyx_kp_b_iso88591_q_q_3c_U_1_q_3c_Cs_az_1_1Ks_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 275};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_fn};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_fseek, __pyx_mstate->__pyx_kp_b_iso88591_q_Cs_1E_Cq_D_1_1E_Cq_CuA_1E_Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 294};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_feof, __pyx_mstate->__pyx_kp_b_iso88591_q_U_1_a_S_1_a_S_1_Cs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 305};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_ferror, __pyx_mstate->__pyx_kp_b_iso88591_q_Cs_1L_Cs_q_Cs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 315};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_fn};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_fflush, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_Cs_aq__A_4q__A_3a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 329};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_inp, __pyx_mstate->__pyx_n_u_elems_written, __pyx_mstate->__pyx_n_u_fn, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_fwrite, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_s_A_1E_Cq_Cs_U_1_1E_Cq_az_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 351};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_fn};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_getc, __pyx_mstate->__pyx_kp_b_iso88591_q_a_WA_Cs_a_WA_Cs_a_WA_Cs_a_T_C, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 372};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_seekable, __pyx_mstate->__pyx_kp_b_iso88591_q_c_A_c_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 380};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_spacings, __pyx_mstate->__pyx_n_u_window_sizes, __pyx_mstate->__pyx_n_u_readbuf_sizes, __pyx_mstate->__pyx_n_u_flags, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_expected};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_init, __pyx_mstate->__pyx_kp_b_iso88591_AS_wgXYiq_AS_gWG1_AS_gWG7_AWA_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 418};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_modes, __pyx_mstate->__pyx_n_u_files, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_bmode, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_expected, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_init_file_modes, __pyx_mstate->__pyx_kp_b_iso88591_AU_V5_AZq_QgQ_IQ_t7_q_vQe7_a_uL, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 451};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_bufSize, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_gotread_2, __pyx_mstate->__pyx_n_u_gottell_2, __pyx_mstate->__pyx_n_u_expread_2, __pyx_mstate->__pyx_n_u_exptell_2, __pyx_mstate->__pyx_n_u_pybuf, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_no_auto_build, __pyx_mstate->__pyx_kp_b_iso88591_7_A_ay_A_1_Qa_3a_Qj_vQe7_a_xz_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 506};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_seek_point, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_zt};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_seek_to_end, __pyx_mstate->__pyx_kp_b_iso88591_wb_9Ba_axy_1_Qj_vQe7_a_xz_1_a_Y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 535};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_seekstep, __pyx_mstate->__pyx_n_u_curelem, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_exp, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_zt, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_seek_cur, __pyx_mstate->__pyx_kp_b_iso88591_7_A_axy_1_at7_Cs_1_Qj_vQe7_a_xz, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 579};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_seekstep, __pyx_mstate->__pyx_n_u_curelem, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_seekloc, __pyx_mstate->__pyx_n_u_exp, __pyx_mstate->__pyx_n_u_zt, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_seek_end, __pyx_mstate->__pyx_kp_b_iso88591_7_A_axy_1_at7_Cs_1_Qj_vQe7_a_xz_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 637};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_seekpoints, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_sp, __pyx_mstate->__pyx_n_u_zs, __pyx_mstate->__pyx_n_u_expected, __pyx_mstate->__pyx_n_u_zt};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_seek_beyond_end, __pyx_mstate->__pyx_kp_b_iso88591_7_A_axy_1_1IRq_Rq_Rq_Rq_Rq_Rq_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 691};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_niters, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_seek_points, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_sp, __pyx_mstate->__pyx_n_u_expseek_2, __pyx_mstate->__pyx_n_u_exptell_2, __pyx_mstate->__pyx_n_u_seek, __pyx_mstate->__pyx_n_u_tell};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_sequential_seek_to_end, __pyx_mstate->__pyx_kp_b_iso88591_G81Cz_r_E_axy_1_Qj_vQe7_a_xz_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 738};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_niters, __pyx_mstate->__pyx_n_u_seed, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_seekpoints, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_sp, __pyx_mstate->__pyx_n_u_zt, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_random_seek, __pyx_mstate->__pyx_kp_b_iso88591_wb_1F_3j_E_aq_axy_1_Qj_vQe7_a_x, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 769};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_use_mmap, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_nelemsp, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_nbytes_2, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_read_all, __pyx_mstate->__pyx_kp_b_iso88591_wb_axy_1_Zq_1_S_Qj_vQe7_a_xz_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 23, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 805};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_niters, __pyx_mstate->__pyx_n_u_seed, __pyx_mstate->__pyx_n_u_use_mmap, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_seekelems, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_nelemsp, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_ret, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_se, __pyx_mstate->__pyx_n_u_readelems_2, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_nbytes_2, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_end};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_seek_then_read_block, __pyx_mstate->__pyx_kp_b_iso88591_r_axy_1_Qj_2WHAS_r_HF_A_Cq_Qj_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 870};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_niters, __pyx_mstate->__pyx_n_u_seed, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_seekelems, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_se, __pyx_mstate->__pyx_n_u_expval, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_random_seek_and_read, __pyx_mstate->__pyx_kp_b_iso88591_wb_2WHAS_axy_1_Qj_vQe7_a_xz_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 907};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_seekelems, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_se, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_read_all_sequential, __pyx_mstate->__pyx_kp_b_iso88591_wb_axy_1_WBc_b_q_Qj_vQe7_a_xz_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 943};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_seed, __pyx_mstate->__pyx_n_u_use_mmap, __pyx_mstate->__pyx_n_u_filesize, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_seekelems, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_se, __pyx_mstate->__pyx_n_u_readelems_2, __pyx_mstate->__pyx_n_u_nbytes_2, __pyx_mstate->__pyx_n_u_pybuf, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_build_then_read, __pyx_mstate->__pyx_kp_b_iso88591_wb_axy_1_Qj_2WHAS_r_F_Cq_Qj_vQe, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 18, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 990};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_niters, __pyx_mstate->__pyx_n_u_seed, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_spacings, __pyx_mstate->__pyx_n_u_bufsizes, __pyx_mstate->__pyx_n_u_seekelems, __pyx_mstate->__pyx_n_u_sbi, __pyx_mstate->__pyx_n_u_spacing, __pyx_mstate->__pyx_n_u_bufsize, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_se, __pyx_mstate->__pyx_n_u_expval, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_readbuf_spacing_sizes, __pyx_mstate->__pyx_kp_b_iso88591_q_q_1_1_XWCq_b_A_i_9ARxq_IQ_8_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, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1070};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_testfile, __pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_index1, __pyx_mstate->__pyx_n_u_index2, __pyx_mstate->__pyx_n_u_indexSpacing, __pyx_mstate->__pyx_n_u_windowSize, __pyx_mstate->__pyx_n_u_readbufSize, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_pyexportfid, __pyx_mstate->__pyx_n_u_ret};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_export_then_import, __pyx_mstate->__pyx_kp_b_iso88591_1_1_1_1_Qj_vQe7_a_xz_1_a_Yl_x_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1122};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_no_fds, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_output, __pyx_mstate->__pyx_n_u_pybuf, __pyx_mstate->__pyx_n_u_pyidxfid, __pyx_mstate->__pyx_n_u_cidxfid};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_export_import_no_points, __pyx_mstate->__pyx_kp_b_iso88591_Rwhas_uF_A_Zq_S_a_1_V1D_Zq_6_wd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1179};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_index1, __pyx_mstate->__pyx_n_u_index2, __pyx_mstate->__pyx_n_u_ret, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_pyidxfid, __pyx_mstate->__pyx_n_u_cidxfid};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_export_import_format_v0, __pyx_mstate->__pyx_kp_b_iso88591_2WHAS_YfBa_a_1_V1D_Zq_6_wd_8_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1240};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_concat, __pyx_mstate->__pyx_n_u_seed, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_ret, __pyx_mstate->__pyx_n_u_dsize, __pyx_mstate->__pyx_n_u_rawdata, __pyx_mstate->__pyx_n_u_cmpdata, __pyx_mstate->__pyx_n_u_strmoffs, __pyx_mstate->__pyx_n_u_zran_init, __pyx_mstate->__pyx_n_u_zran_init, __pyx_mstate->__pyx_n_u_run_crc_tests, __pyx_mstate->__pyx_n_u_run_crc_tests, __pyx_mstate->__pyx_n_u_wrap, __pyx_mstate->__pyx_n_u_wrap, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_off};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_crc_validation, __pyx_mstate->__pyx_kp_b_iso88591_U_3fBa_awhd_9A_we1_t1D_Rq_6_we1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1348};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_concat, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_ret, __pyx_mstate->__pyx_n_u_dsize, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_cmpdata, __pyx_mstate->__pyx_n_u_strmoffs, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_padding, __pyx_mstate->__pyx_n_u_paddedcmpdata, __pyx_mstate->__pyx_n_u_padoff, __pyx_mstate->__pyx_n_u_last, __pyx_mstate->__pyx_n_u_off, __pyx_mstate->__pyx_n_u_pad, __pyx_mstate->__pyx_n_u_strm, __pyx_mstate->__pyx_n_u_zran_init, __pyx_mstate->__pyx_n_u_zran_init, __pyx_mstate->__pyx_n_u_pybuf};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_standard_usage_with_null_pa_2, __pyx_mstate->__pyx_kp_b_iso88591_U_3fBa_at84q_1_1_b_xq_5_1A_IQc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1423};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_iters, __pyx_mstate->__pyx_n_u_mem, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_inflateInit_leak_on_error, __pyx_mstate->__pyx_kp_b_iso88591_q_T_BgQc_BfAWF_A_Q_xz_1_Q_Qawd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1461};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_seed, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_cfid, __pyx_mstate->__pyx_n_u_nelems_2, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_fsize, __pyx_mstate->__pyx_n_u_readbuf_size, __pyx_mstate->__pyx_n_u_pyfid, __pyx_mstate->__pyx_n_u_eof, __pyx_mstate->__pyx_n_u_got};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_read_eof_memmove_rotate_bug, __pyx_mstate->__pyx_kp_b_iso88591_7_882Qa_7_a_1_V1D_r_az_vRq_Ya_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1510};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_seed, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_ret, __pyx_mstate->__pyx_n_u_nbytes_2, __pyx_mstate->__pyx_n_u_rawdata, __pyx_mstate->__pyx_n_u_cmpdata, __pyx_mstate->__pyx_n_u_zran_init, __pyx_mstate->__pyx_n_u_zran_init, __pyx_mstate->__pyx_n_u_flags, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_pybuf};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_indexed_gzip_tests_ctest_zran_py, __pyx_mstate->__pyx_n_u_test_skip_crc_with_footer_that_l_2, __pyx_mstate->__pyx_kp_b_iso88591_b_xq_5_b_nAWHD_Qa_a_vQ_j_1AWCq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CythonFunctionShared.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* 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
}

/* 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 */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
          #if CYTHON_COMPILING_IN_LIMITED_API
            return PyObject_Vectorcall(func, args, _nargs, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, _nargs, NULL);
            }
          #endif
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* 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;
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
    }
    calculate_long:
        CYTHON_UNUSED_VAR(a);
        CYTHON_UNUSED_VAR(b);
        lla = a;
        goto calculate_long_long;
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla * llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_MultiplyObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) * (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_MultiplyObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_MultiplyObjC(op1, op2, inplace);
}
#endif

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op2);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a + b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla + llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
}
#endif

/* PyDictVersioning (used by GetModuleGlobalName) */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    Py_INCREF(key);
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) {
        return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared);
    } else
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) {
            return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared);
        } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            return __Pyx_NewRef(PyList_GET_ITEM(o, n));
        }
    } else
    #if !CYTHON_AVOID_BORROWED_REFS
    if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            return __Pyx_NewRef(PyTuple_GET_ITEM(o, n));
        }
    } else
    #endif
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_subscript) {
            PyObject *r, *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (is_list || likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}

/* TupleAndListFromArray (used by fastcall) */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        Py_INCREF(src[i]);
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
    }
    return res;
}
#elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* py_dict_items (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
}

/* py_dict_values (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
}

/* OwnedDictNext (used by ParseKeywordsImpl) */
#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

/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywordsImpl (used by ParseKeywords) */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos = NULL;
    #else
    Py_ssize_t pos = 0;
    #endif
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (
        #if CYTHON_AVOID_BORROWED_REFS
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL)
        #else
        PyDict_Next(kwds, &pos, &key, NULL)
        #endif
    ) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        #endif
    }
    __Pyx_END_CRITICAL_SECTION();
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(pos);
    #endif
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}

/* ParseKeywords */
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

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

/* RaiseClosureNameError */
static void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* dict_setdefault (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
    PyObject* value;
#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
    PyDict_SetDefaultRef(d, key, default_value, &value);
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[] = {d, key, default_value};
    value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* SetItemOnTypeDict (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType (used by FetchCommonType) */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_vectorcall_offset = memb->offset;
                    changed = 1;
                }
#endif  // CYTHON_METH_FASTCALL
#if !CYTHON_COMPILING_IN_PYPY
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
#endif  // !CYTHON_COMPILING_IN_PYPY
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_COMPILING_IN_PYPY
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
#else
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#endif  // !CYTHON_COMPILING_IN_PYPY
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
      PyObject *module_dict = PyImport_GetModuleDict();
      PyObject *m;
      if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
          return NULL;
      }
      if (m != NULL && PyModule_Check(m)) {
          return m;
      }
      Py_XDECREF(m);
      m = PyModule_NewObject(name);
      if (m == NULL)
          return NULL;
      if (PyDict_CheckExact(module_dict)) {
          PyObject *new_m;
          (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
          Py_DECREF(m);
          return new_m;
      } else {
           if (PyObject_SetItem(module_dict, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
            }
            return m;
      }
  }
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *py_name = PyUnicode_FromString(name);
      if (!py_name) return NULL;
      PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
      Py_DECREF(py_name);
      return module;
  }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif

/* FetchSharedCythonModule (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* FetchCommonType (used by CommonTypesMetaclass) */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    cached_type = __Pyx_PyType_FromMetaclass(
        metaclass,
        CYTHON_USE_MODULE_STATE ? module : abi_module,
        spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass (used by 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;
}

/* CallTypeTraverse (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* PyMethodNew (used by CythonFunctionShared) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#endif

/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i;
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos;
    #else
    Py_ssize_t pos;
    #endif
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = 0;
    i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(pos);
    #endif
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared (used by CythonFunction) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
    PyObject *result;
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#else
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
#endif
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
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(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_annotations_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore:
        PyErr_Clear();
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
#else
    {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
#endif
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#endif
#if CYTHON_METH_FASTCALL
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_dict = NULL;
#endif
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_dict);
#elif PY_VERSION_HEX < 0x030d0000
    _PyObject_ClearManagedDict((PyObject*)m);
#else
    PyObject_ClearManagedDict((PyObject*)m);
#endif
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    Py_CLEAR(m->defaults);
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    {
        int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func_dict);
#else
    {
        int e =
#if PY_VERSION_HEX < 0x030d0000
            _PyObject_VisitManagedDict
#else
            PyObject_VisitManagedDict
#endif
                ((PyObject*)m, visit, arg);
        if (e != 0) return e;
    }
#endif
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_annotations);
    Py_VISIT(m->func_is_coroutine);
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_SIZE
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(argc < 0)) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            __Pyx_CyFunction_raise_type_error(
                cyfunc, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            cyfunc, "takes no keyword arguments");
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes no arguments", nargs);
        return NULL;
    }
    return meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes exactly one argument", nargs);
        return NULL;
    }
    return meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    #if PY_VERSION_HEX < 0x030e00A6
    size_t nargs_value = (size_t) nargs;
    #else
    Py_ssize_t nargs_value = nargs;
    #endif
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
}
#endif
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if CYTHON_METH_FASTCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_METH_FASTCALL
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_DICT |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

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

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *pos = NULL;
#else
        Py_ssize_t pos = 0;
#endif
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
#if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(pos);
#endif
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    const char* function_name,
    PyObject *kw)
{
#if CYTHON_COMPILING_IN_PYPY && !defined(PyArg_ValidateKeywordArguments)
    CYTHON_UNUSED_VAR(function_name);
    CYTHON_UNUSED_VAR(kw);
    return 0;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
#if PY_VERSION_HEX >= 0x03090000
        CYTHON_UNUSED_VAR(function_name);
#else
        Py_ssize_t kwsize;
        #if CYTHON_ASSUME_SAFE_SIZE
        kwsize = PyTuple_GET_SIZE(kw);
        #else
        kwsize = PyTuple_Size(kw);
        if (unlikely(kwsize < 0)) return -1;
        #endif
        for (Py_ssize_t pos = 0; pos < kwsize; pos++) {
            PyObject* key = NULL;
            #if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, pos);
            #else
            key = PyTuple_GetItem(kw, pos);
            if (unlikely(!key)) return -1;
            #endif
            if (unlikely(!PyUnicode_Check(key))) {
                PyErr_Format(PyExc_TypeError,
                    "%.200s() keywords must be strings", function_name);
                return -1;
            }
        }
#endif
    } else {
        if (unlikely(!PyArg_ValidateKeywordArguments(kw))) return -1;
    }
    return 0;
#endif
}

/* PyLongCompare */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) == 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal == 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* PyObjectLookupSpecial */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
    }
    calculate_long:
        {
            long q, r;
            q = a / b;
            r = a - q*b;
            q -= ((r != 0) & ((r ^ b) < 0));
            return PyLong_FromLong(q);
        }
    calculate_long_long:
        {
            PY_LONG_LONG q, r;
            q = lla / llb;
            r = lla - q*llb;
            q -= ((r != 0) & ((r ^ llb) < 0));
            return PyLong_FromLongLong(q);
        }
    
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    return __Pyx_Fallback___Pyx_PyLong_FloorDivideObjC(op1, op2, inplace);
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return PyLong_FromLong(-intval);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a - b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla - llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_SubtractObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) - (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_SubtractObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace);
}
#endif

/* PyObjectVectorCallMethodKwBuilder */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    PyObject *result;
    PyObject *obj = PyObject_GetAttr(args[0], name);
    if (unlikely(!obj))
        return NULL;
    result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    return result;
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
    }
    calculate_long:
        if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
                || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) {
            return PyFloat_FromDouble((double)a / (double)b);
        }
        return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_TrueDivideObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) / (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_TrueDivideObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_TrueDivideObjC(op1, op2, inplace);
}
#endif

/* RaiseUnboundLocalError */
static void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_RemainderObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
    }
    calculate_long:
        {
            long x = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx = lla % llb;
            llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyLong_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_RemainderObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    return __Pyx_Fallback___Pyx_PyLong_RemainderObjC(op1, op2, inplace);
}
#endif

/* SetItemInt */
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (unlikely(!j)) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
            Py_INCREF(v);
            return PyList_SetItem(o, n, v);
        } else if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old;
            Py_INCREF(v);
            old = PyList_GET_ITEM(o, n);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 0;
        }
    } else
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_ass_subscript) {
            int r;
            PyObject *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return -1;
            r = mm->mp_ass_subscript(o, key, v);
            Py_DECREF(key);
            return r;
        }
        if (is_list || likely(sm && sm->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return sm->sq_ass_item(o, i, v);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_SetItem(o, i, v);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
}

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyLong_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyLong_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* SliceObject */
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#endif
    {
        int result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyLong_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyLong_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_ass_subscript(obj, py_slice, value);
#else
        result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object does not support slice %.10s",
        obj_type_name, value ? "assignment" : "deletion");
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return -1;
}

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

/* PyObjectCallNoArg (used by PyObjectCallMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}
#endif

/* PyObjectCallMethod0 (used by PyType_Ready) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[1] = {obj};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_CallNoArg;
    return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
#endif
}

/* ValidateBasesTuple (used by PyType_Ready) */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !CYTHON_USE_TYPE_SLOTS
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* DelItemOnTypeDict (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetFullyQualifiedName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_2_5
#define __PYX_HAVE_RT_ImportType_3_2_5
static PyTypeObject *__Pyx_ImportType_3_2_5(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_5 check_size)
{
    PyObject *result = 0;
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    if (size == 0) {
        return (PyTypeObject *)result;
    }
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_2_5 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_2_5 && (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

/* ImportImpl (used by Import) */
static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
    PyObject *imported_module = PyImport_GetModule(qualname);
    if (unlikely(!imported_module)) {
        *module = NULL;
        if (PyErr_Occurred()) {
            return -1;
        }
        return 0;
    }
    *module = imported_module;
    return 1;
}
static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
    PyObject *imported_module;
    PyObject *top_level_package_name;
    Py_ssize_t i;
    int status, module_found;
    Py_ssize_t dot_index;
    module_found = __Pyx__Import_GetModule(qualname, &imported_module);
    if (unlikely(!module_found || module_found == -1)) {
        *module = NULL;
        return module_found;
    }
    if (imported_names) {
        for (i = 0; i < len_imported_names; i++) {
            PyObject *imported_name = imported_names[i];
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
            int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
#else
            int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
            if (unlikely(has_imported_attribute == -1)) goto error;
#endif
            if (!has_imported_attribute) {
                goto not_found;
            }
        }
        *module = imported_module;
        return 1;
    }
    dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
    if (dot_index == -1) {
        *module = imported_module;
        return 1;
    }
    if (unlikely(dot_index == -2)) goto error;
    top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
    if (unlikely(!top_level_package_name)) goto error;
    Py_DECREF(imported_module);
    status = __Pyx__Import_GetModule(top_level_package_name, module);
    Py_DECREF(top_level_package_name);
    return status;
error:
    Py_DECREF(imported_module);
    *module = NULL;
    return -1;
not_found:
    Py_DECREF(imported_module);
    *module = NULL;
    return 0;
}
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *from_list = 0;
    int module_found;
    if (!qualname) {
        qualname = name;
    }
    module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
    if (likely(module_found == 1)) {
        return module;
    } else if (unlikely(module_found == -1)) {
        return NULL;
    }
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
#if CYTHON_COMPILING_IN_CPYTHON
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
#else
        from_list = PyList_New(len_imported_names);
        if (unlikely(!from_list)) goto bad;
        for (Py_ssize_t i=0; i<len_imported_names; ++i) {
            if (PyList_SetItem(from_list, i, __Pyx_NewRef(imported_names[i])) < 0) goto bad;
        }
#endif
    }
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, moddict, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, moddict, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(from_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
    return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
}

/* 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__3);
        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;
}

/* CLineInTraceback (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
#else
PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
    PyObject **dict_ptr = _PyObject_GetDictPtr(o);
    return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
}
#endif
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline = NULL;
    PyObject *ptype, *pvalue, *ptraceback;
    PyObject *cython_runtime_dict;
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
    cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, cython_runtime_dict,
            __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
    }
    if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    Py_XDECREF(cython_runtime_dict);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache (used by AddTraceback) */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            code_cache->count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
        if (unlikely(!code_object)) goto bad;
        py_py_line = PyLong_FromLong(py_line);
        if (unlikely(!py_py_line)) goto bad;
        if (c_line) {
            py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        } else {
            py_funcname = PyUnicode_FromString(funcname);
        }
        if (unlikely(!py_funcname)) goto bad;
        dict = PyDict_New();
        if (unlikely(!dict)) goto bad;
        {
            PyObject *old_code_object = code_object;
            code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
            Py_DECREF(old_code_object);
        }
        if (unlikely(!code_object)) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    if (c_line) {
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_mstate_global->__pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* 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;\
    }

/* Declarations */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsf(b.real) >= fabsf(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                float r = b.imag / b.real;
                float s = (float)(1.0) / (b.real + b.imag * r);
                return __pyx_t_float_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            float r = b.real / b.imag;
            float s = (float)(1.0) / (b.imag + b.real * r);
            return __pyx_t_float_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            float denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_float_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_float(a, a);
                    case 3:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, a);
                    case 4:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = powf(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2f(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_float(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
      return ::std::complex< long double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
      return x + y*(__pyx_t_long_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
      __pyx_t_long_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        __pyx_t_long_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        __pyx_t_long_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        __pyx_t_long_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsl(b.real) >= fabsl(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                long double r = b.imag / b.real;
                long double s = (long double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_long_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            long double r = b.real / b.imag;
            long double s = (long double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_long_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            long double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_long_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
        __pyx_t_long_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
        __pyx_t_long_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtl(z.real*z.real + z.imag*z.imag);
          #else
            return hypotl(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
            __pyx_t_long_double_complex z;
            long double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    long double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_long__double(a, a);
                    case 3:
                        z = __Pyx_c_prod_long__double(a, a);
                        return __Pyx_c_prod_long__double(z, a);
                    case 4:
                        z = __Pyx_c_prod_long__double(a, a);
                        return __Pyx_c_prod_long__double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = powl(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2l(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_long__double(a);
                theta = atan2l(a.imag, a.real);
            }
            lnr = logl(r);
            z_r = expl(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosl(z_theta);
            z.imag = z_r * sinl(z_theta);
            return z;
        }
    #endif
#endif

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyLong_As_size_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyLong_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && 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 (size_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(size_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(size_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
        } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        size_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (size_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (size_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (size_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (size_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((size_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((size_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (size_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int64_t __Pyx_PyLong_As_int64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyLong_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) {
                            return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) {
                            return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) {
                            return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (int64_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int64_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int64_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x))
        } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        int64_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int64_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int64_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int64_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int64_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int64_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int64_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int64_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int64_t");
    return (int64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int64_t");
    return (int64_t) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint64_t(uint64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint64_t) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From___pyx_anon_enum(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int64_t(int64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int64_t) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyLong_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (int) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
static CYTHON_INLINE uint32_t __Pyx_PyLong_As_uint32_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        uint32_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (uint32_t) -1;
        val = __Pyx_PyLong_As_uint32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) {
                            return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) {
                            return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) {
                            return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (uint32_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(uint32_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(uint32_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
        } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        uint32_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (uint32_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (uint32_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (uint32_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (uint32_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((uint32_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((uint32_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (uint32_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint32_t");
    return (uint32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint32_t");
    return (uint32_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE uint16_t __Pyx_PyLong_As_uint16_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        uint16_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (uint16_t) -1;
        val = __Pyx_PyLong_As_uint16_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT)) {
                            return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT)) {
                            return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT)) {
                            return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (uint16_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(uint16_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(uint16_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x))
        } else if ((sizeof(uint16_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        uint16_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (uint16_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (uint16_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (uint16_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (uint16_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(uint16_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((uint16_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(uint16_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((uint16_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((uint16_t) 1) << (sizeof(uint16_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (uint16_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint16_t");
    return (uint16_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint16_t");
    return (uint16_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        uint64_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (uint64_t) -1;
        val = __Pyx_PyLong_As_uint64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT)) {
                            return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT)) {
                            return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT)) {
                            return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (uint64_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(uint64_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(uint64_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
        } else if ((sizeof(uint64_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        uint64_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (uint64_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (uint64_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (uint64_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (uint64_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(uint64_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((uint64_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(uint64_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((uint64_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((uint64_t) 1) << (sizeof(uint64_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (uint64_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint64_t");
    return (uint64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint64_t");
    return (uint64_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE npy_intp __Pyx_PyLong_As_npy_intp(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        npy_intp val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (npy_intp) -1;
        val = __Pyx_PyLong_As_npy_intp(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(npy_intp, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_intp) >= 2 * PyLong_SHIFT)) {
                            return (npy_intp) (((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_intp) >= 3 * PyLong_SHIFT)) {
                            return (npy_intp) (((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_intp, 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(npy_intp) >= 4 * PyLong_SHIFT)) {
                            return (npy_intp) (((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (npy_intp) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(npy_intp) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_intp, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_intp, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(npy_intp, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(npy_intp) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
                            return (npy_intp) (((npy_intp)-1)*(((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
                            return (npy_intp) ((((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
                            return (npy_intp) (((npy_intp)-1)*(((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
                            return (npy_intp) ((((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_intp) - 1 > 4 * PyLong_SHIFT)) {
                            return (npy_intp) (((npy_intp)-1)*(((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_intp, 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(npy_intp) - 1 > 4 * PyLong_SHIFT)) {
                            return (npy_intp) ((((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(npy_intp) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_intp, long, PyLong_AsLong(x))
        } else if ((sizeof(npy_intp) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_intp, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        npy_intp val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (npy_intp) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (npy_intp) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (npy_intp) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (npy_intp) 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(npy_intp) * 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 |= ((npy_intp) 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(npy_intp) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((npy_intp) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((npy_intp) 1) << (sizeof(npy_intp) * 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 (npy_intp) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_intp");
    return (npy_intp) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_intp");
    return (npy_intp) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint32_t(uint32_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint32_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint32_t) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyLong_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (long) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(long) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(long) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static __Pyx_TypeName
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
{
    PyObject *module = NULL, *name = NULL, *result = NULL;
    #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
    name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_qualname);
    #else
    name = PyType_GetQualName(tp);
    #endif
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
    module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_module);
    if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
    if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
        result = name;
        name = NULL;
        goto done;
    }
    result = PyUnicode_FromFormat("%U.%U", module, name);
    if (unlikely(result == NULL)) goto bad;
  done:
    Py_XDECREF(name);
    Py_XDECREF(module);
    return result;
  bad:
    PyErr_Clear();
    if (name) {
        result = name;
        name = NULL;
    } else {
        result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__4);
    }
    goto done;
}
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* 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;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
#elif PY_VERSION_HEX >= 0x030B0000
  static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                         PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                         PyObject *fv, PyObject *cell, PyObject* fn,
                                         PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
    if (likely(result))
        result->_co_firsttraceable = 0;
    #endif
    return result;
  }
#elif !CYTHON_COMPILING_IN_PYPY
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
) {
    PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
    Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
    PyObject *varnames_tuple = PyTuple_New(var_count);
    if (unlikely(!varnames_tuple)) return NULL;
    for (Py_ssize_t i=0; i < var_count; i++) {
        Py_INCREF(varnames[i]);
        if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
    if (!varnames_tuple_dedup) {
        if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
        varnames_tuple_dedup = varnames_tuple;
    }
    #else
    varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
    if (unlikely(!varnames_tuple_dedup)) goto done;
    #endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(varnames_tuple_dedup);
    #endif
    if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
        Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(line_table_length == -1)) goto done;
        #endif
        Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
        code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
        if (unlikely(!code_bytes)) goto done;
        char* c_code_bytes = PyBytes_AsString(code_bytes);
        if (unlikely(!c_code_bytes)) goto done;
        memset(c_code_bytes, 0, (size_t) code_len);
    }
    code_obj = (PyObject*) __Pyx__PyCode_New(
        (int) descr.argcount,
        (int) descr.num_posonly_args,
        (int) descr.num_kwonly_args,
        (int) descr.nlocals,
        0,
        (int) descr.flags,
        code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        varnames_tuple_dedup,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        filename,
        funcname,
        (int) descr.first_line,
        (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
    );
done:
    Py_XDECREF(code_bytes);
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(varnames_tuple_dedup);
    #endif
    Py_DECREF(varnames_tuple);
    return code_obj;
}

/* DecompressString */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
    PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
    const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
    PyObject *methodname = PyUnicode_FromString("decompress");
    if (unlikely(!methodname)) return NULL;
    #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
    if (algo == 3) {
        PyObject *fromlist = Py_BuildValue("[O]", methodname);
        if (unlikely(!fromlist)) goto bad;
        module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
    } else
    #endif
        module = PyImport_ImportModule(module_name);
    if (unlikely(!module)) goto import_failed;
    decompress = PyObject_GetAttr(module, methodname);
    if (unlikely(!decompress)) goto import_failed;
    {
        #ifdef __cplusplus
            char *memview_bytes = const_cast<char*>(s);
        #else
            #if defined(__clang__)
              #pragma clang diagnostic push
              #pragma clang diagnostic ignored "-Wcast-qual"
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic push
              #pragma GCC diagnostic ignored "-Wcast-qual"
            #endif
            char *memview_bytes = (char*) s;
            #if defined(__clang__)
              #pragma clang diagnostic pop
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic pop
            #endif
        #endif
        #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
        int memview_flags = 0x100;
        #else
        int memview_flags = PyBUF_READ;
        #endif
        compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
    }
    if (unlikely(!compressed_bytes)) {
        Py_DECREF(decompress);
        goto bad;
    }
    decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
    Py_DECREF(compressed_bytes);
    Py_DECREF(decompress);
    Py_DECREF(module);
    Py_DECREF(methodname);
    return decompressed;
import_failed:
    PyErr_Format(PyExc_ImportError,
        "Failed to import '%.20s.decompress' - cannot initialise module strings. "
        "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
        module_name, algo);
bad:
    Py_XDECREF(module);
    Py_DECREF(methodname);
    return NULL;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
}
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  else if (!PyErr_Occurred()) {
      PyErr_SetString(PyExc_TypeError,
                      "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyLong_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return __Pyx_NewRef(b ? Py_True: Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


/* MultiPhaseInitModuleState */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
#else
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
#endif
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
#error "Module state with PEP489 requires atomics. Currently that's one of\
 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
#endif
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#define __Pyx_ModuleStateLookup_Lock()
#define __Pyx_ModuleStateLookup_Unlock()
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(__cplusplus) && __cplusplus >= 201103L
#include <mutex>
static std::mutex __Pyx_ModuleStateLookup_mutex;
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
#include <threads.h>
static mtx_t __Pyx_ModuleStateLookup_mutex;
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
    mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
}
#define __Pyx_ModuleStateLookup_Lock()\
  call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  mtx_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(_WIN32)
#include <Windows.h>  // synchapi.h on its own doesn't work
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#else
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
 Requires C standard >= C11, or C++ standard >= C++11,\
 or pthreads, or the Windows 32 API, or Python >= 3.13."
#endif
typedef struct {
    int64_t id;
    PyObject *module;
} __Pyx_InterpreterIdAndModule;
typedef struct {
    char interpreter_id_as_index;
    Py_ssize_t count;
    Py_ssize_t allocated;
    __Pyx_InterpreterIdAndModule table[1];
} __Pyx_ModuleStateLookupData;
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
#else
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
#endif
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
        __Pyx_InterpreterIdAndModule* table,
        Py_ssize_t count,
        int64_t interpreterId) {
    __Pyx_InterpreterIdAndModule* begin = table;
    __Pyx_InterpreterIdAndModule* end = begin + count;
    if (begin->id == interpreterId) {
        return begin;
    }
    while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
        __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
        if (halfway->id == interpreterId) {
            return halfway;
        }
        if (halfway->id < interpreterId) {
            begin = halfway;
        } else {
            end = halfway;
        }
    }
    for (; begin < end; ++begin) {
        if (begin->id >= interpreterId) return begin;
    }
    return begin;
}
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return NULL;
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
    {
        __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        if (likely(data)) {
            __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
            if (likely(data == new_data)) {
                goto read_finished;
            }
        }
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        __Pyx_ModuleStateLookup_Lock();
        __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
        data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
        __Pyx_ModuleStateLookup_Unlock();
    }
  read_finished:;
#else
    __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_InterpreterIdAndModule* found = NULL;
    if (unlikely(!data)) goto end;
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            found = data->table+interpreter_id;
        }
    } else {
        found = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
    }
  end:
    {
        PyObject *result=NULL;
        if (found && found->id == interpreter_id) {
            result = found->module;
        }
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
#endif
        return result;
    }
}
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
    while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
}
#else
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
#endif
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
    Py_ssize_t to_allocate = (*old_data)->allocated;
    while (to_allocate <= interpreter_id) {
        if (to_allocate == 0) to_allocate = 1;
        else to_allocate *= 2;
    }
    __Pyx_ModuleStateLookupData *new_data = *old_data;
    if (to_allocate != (*old_data)->allocated) {
         new_data = (__Pyx_ModuleStateLookupData *)realloc(
            *old_data,
            sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
        if (!new_data) {
            PyErr_NoMemory();
            return -1;
        }
        for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
            new_data->table[i].id = i;
            new_data->table[i].module = NULL;
        }
        new_data->allocated = to_allocate;
    }
    new_data->table[interpreter_id].module = module;
    if (new_data->count < interpreter_id+1) {
        new_data->count = interpreter_id+1;
    }
    *old_data = new_data;
    return 0;
}
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
    __Pyx_InterpreterIdAndModule *read = data->table;
    __Pyx_InterpreterIdAndModule *write = data->table;
    __Pyx_InterpreterIdAndModule *end = read + data->count;
    for (; read<end; ++read) {
        if (read->module) {
            write->id = read->id;
            write->module = read->module;
            ++write;
        }
    }
    data->count = write - data->table;
    for (; write<end; ++write) {
        write->id = 0;
        write->module = NULL;
    }
    data->interpreter_id_as_index = 0;
}
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    int result = 0;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_ModuleStateLookupData *new_data = old_data;
    if (!new_data) {
        new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
        if (!new_data) {
            result = -1;
            PyErr_NoMemory();
            goto end;
        }
        new_data->allocated = 1;
        new_data->interpreter_id_as_index = 1;
    }
    __Pyx_ModuleStateLookup_wait_until_no_readers();
    if (new_data->interpreter_id_as_index) {
        if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
            result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
            goto end;
        }
        __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
    }
    {
        Py_ssize_t insert_at = 0;
        {
            __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                new_data->table, new_data->count, interpreter_id);
            assert(lower_bound);
            insert_at = lower_bound - new_data->table;
            if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                lower_bound->module = module;
                goto end;  // already in table, nothing more to do
            }
        }
        if (new_data->count+1 >= new_data->allocated) {
            Py_ssize_t to_allocate = (new_data->count+1)*2;
            new_data =
                (__Pyx_ModuleStateLookupData*)realloc(
                    new_data,
                    sizeof(__Pyx_ModuleStateLookupData) +
                    (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
            if (!new_data) {
                result = -1;
                new_data = old_data;
                PyErr_NoMemory();
                goto end;
            }
            new_data->allocated = to_allocate;
        }
        ++new_data->count;
        int64_t last_id = interpreter_id;
        PyObject *last_module = module;
        for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
            int64_t current_id = new_data->table[i].id;
            new_data->table[i].id = last_id;
            last_id = current_id;
            PyObject *current_module = new_data->table[i].module;
            new_data->table[i].module = last_module;
            last_module = current_module;
        }
    }
  end:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
#else
    __Pyx_ModuleStateLookup_data = new_data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return result;
}
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
#endif
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            data->table[interpreter_id].module = NULL;
        }
        goto done;
    }
    {
        __Pyx_ModuleStateLookup_wait_until_no_readers();
        __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
        if (!lower_bound) goto done;
        if (lower_bound->id != interpreter_id) goto done;
        __Pyx_InterpreterIdAndModule *end = data->table+data->count;
        for (;lower_bound<end-1; ++lower_bound) {
            lower_bound->id = (lower_bound+1)->id;
            lower_bound->module = (lower_bound+1)->module;
        }
    }
    --data->count;
    if (data->count == 0) {
        free(data);
        data = NULL;
    }
  done:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
#else
    __Pyx_ModuleStateLookup_data = data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return 0;
}
#endif

/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
