/* Generated by Cython 3.2.4 */

#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_4"
#define CYTHON_HEX_VERSION 0x030204F0
#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__HTSeq___HTSeq
#define __PYX_HAVE_API__HTSeq___HTSeq
/* 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"
#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[] = {
  "src/HTSeq/_HTSeq.pyx",
  "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd",
  "src/HTSeq/_HTSeq.pxd",
  "<stringsource>",
  "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>

/* BufferFormatStructs.proto (used by BufferFormatCheck) */
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  const struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  const __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  const __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;

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

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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_5HTSeq_6_HTSeq_GenomicInterval;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition;
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence;
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities;
struct __pyx_obj_5HTSeq_6_HTSeq_Alignment;
struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment;
struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector;
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray;
struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation;
struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment;
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__;
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement;
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end;
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end;
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals;
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals;
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement;
struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar;
struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list;
struct __pyx_opt_args_5HTSeq_6_HTSeq_quotesafe_split;

/* "HTSeq/_HTSeq.pxd":23
 *    cdef public str name
 *    cdef public str descr
 *    cpdef Sequence get_reverse_complement(self, bint rename=?)             # <<<<<<<<<<<<<<
 *    cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_)
 *    cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=?)
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement {
  int __pyx_n;
  int rename;
};

/* "HTSeq/_HTSeq.pxd":25
 *    cpdef Sequence get_reverse_complement(self, bint rename=?)
 *    cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_)
 *    cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=?)             # <<<<<<<<<<<<<<
 *    cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=?)
 * 
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end {
  int __pyx_n;
  float mismatch_prop;
};

/* "HTSeq/_HTSeq.pxd":26
 *    cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_)
 *    cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=?)
 *    cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=?)             # <<<<<<<<<<<<<<
 * 
 * 
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end {
  int __pyx_n;
  float mismatch_prop;
};

/* "HTSeq/_HTSeq.pxd":36
 *    cdef _fill_qual_arr(SequenceWithQualities self)
 *    cpdef object add_qual_to_count_array(SequenceWithQualities self, numpy.ndarray count_array_)
 *    cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *          Sequence pattern, int max_mm_qual=?)
 *    cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self,
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals {
  int __pyx_n;
  int max_mm_qual;
};

/* "HTSeq/_HTSeq.pxd":38
 *    cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,
 *          Sequence pattern, int max_mm_qual=?)
 *    cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *          Sequence pattern, int max_mm_qual=?)
 * 
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals {
  int __pyx_n;
  int max_mm_qual;
};

/* "HTSeq/_HTSeq.pyx":1365
 *         return sio.getvalue()
 * 
 *     cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):             # <<<<<<<<<<<<<<
 *         cdef SequenceWithQualities res
 *         if rename:
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement {
  int __pyx_n;
  int rename;
};

/* "HTSeq/_HTSeq.pyx":1529
 * 
 * 
 * cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."):             # <<<<<<<<<<<<<<
 *     cdef list split_cigar, cl
 *     cdef int size
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar {
  int __pyx_n;
  int ref_left;
  PyObject *chrom;
  PyObject *strand;
};

/* "HTSeq/_HTSeq.pyx":1547
 * 
 * 
 * cpdef list build_cigar_list(list cigar_pairs, int ref_left=0, str chrom="", str strand="."):             # <<<<<<<<<<<<<<
 *     cdef list split_cigar, res
 *     cdef int rpos, qpos, size
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list {
  int __pyx_n;
  int ref_left;
  PyObject *chrom;
  PyObject *strand;
};

/* "HTSeq/_HTSeq.pyx":2072
 * # Helpers
 * ###########################
 * cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'):             # <<<<<<<<<<<<<<
 *     cdef list l = []
 *     cdef int i = 0
*/
struct __pyx_opt_args_5HTSeq_6_HTSeq_quotesafe_split {
  int __pyx_n;
  PyObject *split;
  PyObject *quote;
};

/* "HTSeq/_HTSeq.pxd":3
 * cimport numpy
 * 
 * cdef class GenomicInterval:             # <<<<<<<<<<<<<<
 * 
 *    cdef public str chrom
*/
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval {
  PyObject_HEAD
  struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *__pyx_vtab;
  PyObject *chrom;
  long start;
  long end;
  PyObject *_strand;
};


/* "HTSeq/_HTSeq.pxd":15
 *    cpdef extend_to_include(GenomicInterval self, GenomicInterval iv)
 * 
 * cdef class GenomicPosition( GenomicInterval ):             # <<<<<<<<<<<<<<
 *    pass
 * 
*/
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval __pyx_base;
};


/* "HTSeq/_HTSeq.pxd":19
 * 
 * 
 * cdef class Sequence(object):             # <<<<<<<<<<<<<<
 *    cdef public bytes seq
 *    cdef public str name
*/
struct __pyx_obj_5HTSeq_6_HTSeq_Sequence {
  PyObject_HEAD
  struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence *__pyx_vtab;
  PyObject *seq;
  PyObject *name;
  PyObject *descr;
};


/* "HTSeq/_HTSeq.pxd":29
 * 
 * 
 * cdef class SequenceWithQualities(Sequence):             # <<<<<<<<<<<<<<
 *    cdef readonly bytes _qualstr
 *    cdef readonly bytes _qualstr_phred
*/
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence __pyx_base;
  PyObject *_qualstr;
  PyObject *_qualstr_phred;
  PyObject *_qualscale;
  PyObject *_qualarr;
};


/* "HTSeq/_HTSeq.pxd":42
 * 
 * 
 * cdef class Alignment(object):             # <<<<<<<<<<<<<<
 *    cdef public SequenceWithQualities _read
 *    cdef public GenomicInterval iv
*/
struct __pyx_obj_5HTSeq_6_HTSeq_Alignment {
  PyObject_HEAD
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *_read;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *iv;
};


/* "HTSeq/_HTSeq.pxd":46
 *    cdef public GenomicInterval iv
 * 
 * cdef class AlignmentWithSequenceReversal(Alignment):             # <<<<<<<<<<<<<<
 *    cdef public SequenceWithQualities read_as_aligned
 *    cdef public SequenceWithQualities _read_as_sequenced
*/
struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal {
  struct __pyx_obj_5HTSeq_6_HTSeq_Alignment __pyx_base;
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *read_as_aligned;
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *_read_as_sequenced;
};


/* "HTSeq/_HTSeq.pxd":50
 *    cdef public SequenceWithQualities _read_as_sequenced
 * 
 * cdef class SAM_Alignment(AlignmentWithSequenceReversal):             # <<<<<<<<<<<<<<
 *    cdef public list cigar
 *    cdef public int aQual
*/
struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment {
  struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal __pyx_base;
  PyObject *cigar;
  int aQual;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *mate_start;
  PyObject *pe_which;
  int inferred_insert_size;
  int proper_pair;
  int not_primary_alignment;
  int failed_platform_qc;
  int pcr_or_optical_duplicate;
  int supplementary;
  PyObject *original_sam_line;
  int _flag;
  PyObject *optional_fields;
};


/* "HTSeq/_HTSeq.pyx":310
 * 
 * 
 * cdef class ChromVector(object):             # <<<<<<<<<<<<<<
 *     """Counting vector covering a chromosome.
 * 
*/
struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector {
  PyObject_HEAD
  PyObject *array;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *iv;
  int offset;
  int is_vector_of_sets;
  PyObject *_storage;
  PyObject *typecode;
  PyObject *memmap_dir;
};


/* "HTSeq/_HTSeq.pyx":598
 * 
 * 
 * cdef class GenomicArray(object):             # <<<<<<<<<<<<<<
 *     """Coverage vector including multiple chromosomes.
 * 
*/
struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray {
  PyObject_HEAD
  PyObject *chrom_vectors;
  int stranded;
  PyObject *typecode;
  PyObject *auto_add_chroms;
  PyObject *storage;
  PyObject *memmap_dir;
  PyObject *header;
};


/* "HTSeq/_HTSeq.pyx":1486
 * 
 * 
 * cdef class CigarOperation(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef public str type
*/
struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation {
  PyObject_HEAD
  PyObject *type;
  int size;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *ref_iv;
  int query_from;
  int query_to;
};


/* "HTSeq/_HTSeq.pyx":1662
 * 
 * 
 * cdef class BowtieAlignment(AlignmentWithSequenceReversal):             # <<<<<<<<<<<<<<
 *     """When reading in a Bowtie file, objects of the class BowtieAlignment
 *     are returned. In addition to the 'read' and 'iv' fields (see Alignment
*/
struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment {
  struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal __pyx_base;
  PyObject *reserved;
  PyObject *substitutions;
};


/* "HTSeq/_HTSeq.pyx":552
 *             raise TypeError("Illegal index type")
 * 
 *     def __iadd__(self, value):             # <<<<<<<<<<<<<<
 *         if not self.is_vector_of_sets:
 *             self.array[self.iv.start - self.offset: self.iv.end -
*/
struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ {
  PyObject_HEAD
  PyObject *__pyx_v_value;
};



/* "HTSeq/_HTSeq.pyx":31
 * 
 * 
 * cdef class GenomicInterval:             # <<<<<<<<<<<<<<
 *     """A range of consecutive positions on a reference genome.
 * 
*/

struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval {
  PyObject *(*is_contained_in)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch);
  PyObject *(*contains)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch);
  PyObject *(*overlaps)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch);
  PyObject *(*extend_to_include)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *__pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval;


/* "HTSeq/_HTSeq.pyx":259
 * 
 * 
 * cdef class GenomicPosition(GenomicInterval):             # <<<<<<<<<<<<<<
 *     """Position of a nucleotide or base pair on a reference genome.
 * 
*/

struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicPosition {
  struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval __pyx_base;
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicPosition *__pyx_vtabptr_5HTSeq_6_HTSeq_GenomicPosition;


/* "HTSeq/_HTSeq.pyx":1099
 * 
 * 
 * cdef class Sequence(object):             # <<<<<<<<<<<<<<
 *     """A Sequence, typically of DNA, with a name."""
 * 
*/

struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*get_reverse_complement)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement *__pyx_optional_args);
  PyObject *(*add_bases_to_count_array)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, PyArrayObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*trim_left_end)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end *__pyx_optional_args);
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*trim_right_end)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end *__pyx_optional_args);
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence *__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence;


/* "HTSeq/_HTSeq.pyx":1248
 * 
 * 
 * cdef class SequenceWithQualities(Sequence):             # <<<<<<<<<<<<<<
 *     """A Sequence with base-call quality scores.
 *     It now has property  'qual', an integer NumPy array of Sanger/Phred
*/

struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities {
  struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence __pyx_base;
  PyObject *(*_fill_qual_arr)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *);
  PyObject *(*add_qual_to_count_array)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, PyArrayObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*trim_left_end_with_quals)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals *__pyx_optional_args);
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*trim_right_end_with_quals)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals *__pyx_optional_args);
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*get_reverse_complement)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args);
};
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities;
/* #### 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);

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

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

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

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

/* Intern.proto */
static PyObject* __Pyx_Intern(PyObject* s);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PySliceAccessors.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PySlice_Start(o) PyObject_GetAttr(o, __pyx_mstate_global->__pyx_n_u_start)
#define __Pyx_PySlice_Stop(o) PyObject_GetAttr(o, __pyx_mstate_global->__pyx_n_u_stop)
#define __Pyx_PySlice_Step(o) PyObject_GetAttr(o, __pyx_mstate_global->__pyx_n_u_step)
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
#define __Pyx_PySlice_Start(o) GraalPySlice_Start(o)
#define __Pyx_PySlice_Stop(o) GraalPySlice_Stop(o)
#define __Pyx_PySlice_Step(o) GraalPySlice_Step(o)
#elif CYTHON_COMPILING_IN_GRAAL
#define __Pyx_PySlice_Start(o) __Pyx_NewRef(PySlice_Start((PySliceObject*)o))
#define __Pyx_PySlice_Stop(o) __Pyx_NewRef(PySlice_Stop((PySliceObject*)o))
#define __Pyx_PySlice_Step(o) __Pyx_NewRef(PySlice_Step((PySliceObject*)o))
#else
#define __Pyx_PySlice_Start(o) __Pyx_NewRef(((PySliceObject*)o)->start)
#define __Pyx_PySlice_Stop(o) __Pyx_NewRef(((PySliceObject*)o)->stop)
#define __Pyx_PySlice_Step(o) __Pyx_NewRef(((PySliceObject*)o)->step)
#endif

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

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

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

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

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

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

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

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

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

/* unicode_tailmatch.proto */
static int __Pyx_PyUnicode_Tailmatch(
    PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction);

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

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

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

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

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

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

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

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

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

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

/* PyIOError_Check.proto */
#define __Pyx_PyExc_IOError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_IOError)

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

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

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

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

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

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

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

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

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

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

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

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

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

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

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

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

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

/* IsLittleEndian.proto (used by BufferFormatCheck) */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);

/* BufferFormatCheck.proto (used by BufferGetAndValidate) */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              const __Pyx_TypeInfo* type);

/* BufferGetAndValidate.proto */
#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
    ((obj == Py_None || obj == NULL) ?\
    (__Pyx_ZeroBuffer(buf), 0) :\
    __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
  const __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static void __Pyx_ZeroBuffer(Py_buffer* buf);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };

/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);

#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2))
#endif

/* PySequenceMultiply.proto */
#define __Pyx_PySequence_Multiply_Left(mul, seq)  __Pyx_PySequence_Multiply(seq, mul)
#if !CYTHON_USE_TYPE_SLOTS
#define  __Pyx_PySequence_Multiply PySequence_Repeat
#else
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
#endif

/* BufferFallbackError.proto */
static void __Pyx_RaiseBufferFallbackError(void);

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

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

/* ModInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);

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

/* DivInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);

/* SetStringIndexingError.proto (used by GetItemIntUnicode) */
static void __Pyx_SetStringIndexingError(const char* message, int has_gil);

/* GetItemIntUnicode.proto */
#define __Pyx_GetItemInt_Unicode(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_Unicode_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, has_gil) :\
    (__Pyx_SetStringIndexingError("string index out of range", has_gil), (Py_UCS4)-1))
static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i,
                                                           int wraparound, int boundscheck, int has_gil);

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

/* FloatExceptionCheck.proto */
#define __PYX_CHECK_FLOAT_EXCEPTION(value, error_value)\
    ((error_value) == (error_value) ?\
     (value) == (error_value) :\
     (value) != (value))

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

/* GetItemIntBytes.proto */
#define __Pyx_GetItemInt_Bytes(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_Bytes_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, has_gil) :\
    (__Pyx_SetStringIndexingError("string index out of range", has_gil), -1))
static CYTHON_INLINE int __Pyx_GetItemInt_Bytes_Fast(PyObject* bytes, Py_ssize_t index,
                                                     int wraparound, int boundscheck, int has_gil);

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

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

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

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

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

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

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

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

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

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

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_2_4
#define __PYX_HAVE_RT_ImportType_proto_3_2_4
#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_4(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_4(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_4 {
   __Pyx_ImportType_CheckSize_Error_3_2_4 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_2_4 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_2_4 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_4(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_4 check_size);
#endif

/* ClassMethod.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include "descrobject.h"
#endif
CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method);

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

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

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

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

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

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

/* BufferStructDeclare.proto */
typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

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

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

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

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

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE npy_uint8 __Pyx_PyLong_As_npy_uint8(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_intp(npy_intp value);

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

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

/* 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*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_is_contained_in(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_contains(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_overlaps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_extend_to_include(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_8Sequence_add_bases_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyArrayObject *__pyx_v_count_array_, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_left_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end *__pyx_optional_args); /* proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_right_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities__fill_qual_arr(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto*/
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args); /* proto*/
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement__pyx_wrap_1(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_add_qual_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyArrayObject *__pyx_v_count_array_, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals *__pyx_optional_args); /* proto*/
static struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals *__pyx_optional_args); /* 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" */

/* Module declarations from "HTSeq._HTSeq" */
static PyObject *__pyx_v_5HTSeq_6_HTSeq_strand_plus = 0;
static PyObject *__pyx_v_5HTSeq_6_HTSeq_strand_minus = 0;
static PyObject *__pyx_v_5HTSeq_6_HTSeq_strand_nostrand = 0;
static PyObject *__pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation = 0;
static PyObject *__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i;
static PyObject *__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x;
static PyObject *__pyx_f_5HTSeq_6_HTSeq_reverse_complement(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_parse_cigar(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_build_cigar_list(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq__parse_SAM_optional_field_value(PyObject *); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_quotesafe_split(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_quotesafe_split *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_CigarOperation__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *, PyObject *); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_Alignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *, PyObject *); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_AlignmentWithSequenceReversal__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *, PyObject *); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_BowtieAlignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *, PyObject *); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_SAM_Alignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "HTSeq._HTSeq"
extern int __pyx_module_is_main_HTSeq___HTSeq;
int __pyx_module_is_main_HTSeq___HTSeq = 0;

/* Implementation of "HTSeq._HTSeq" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_enumerate;
/* #### Code section: string_decls ### */
static const char __pyx_k_read_iv[] = "_read, iv";
static const char __pyx_k_flag__read__read_as_sequenced_a[] = "_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary";
static const char __pyx_k_query_from_query_to_ref_iv_size[] = "query_from, query_to, ref_iv, size, type";
static const char __pyx_k_read__read_as_sequenced_iv_read[] = "_read, _read_as_sequenced, iv, read_as_aligned";
static const char __pyx_k_read__read_as_sequenced_iv_read_2[] = "_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions";
/* #### Code section: decls ### */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_chrom, long __pyx_v_start, long __pyx_v_end, PyObject *__pyx_v_strand); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand___set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_strand); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand_2__get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_2__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_4__copy__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_8__str__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_newLength); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_newStartd); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5end_d___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10__richcmp__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_other, int __pyx_v_op); /* proto */
static Py_hash_t __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12__hash__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_16contains(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_20range(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_step); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_22range_d(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_step); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_26copy(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_GenomicInterval_from_directional(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chrom, long __pyx_v_start_d, long __pyx_v_length, PyObject *__pyx_v_strand); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self, PyObject *__pyx_v_chrom, long __pyx_v_pos, PyObject *__pyx_v_strand); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self, long __pyx_v_newValue); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6length___get__(CYTHON_UNUSED struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_4__str__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_8copy(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_create(PyTypeObject *__pyx_v_cls, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, PyObject *__pyx_v_typecode, PyObject *__pyx_v_storage, PyObject *__pyx_v_memmap_dir); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2_create_view(PyTypeObject *__pyx_v_cls, struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_vec, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_4extend_to_include(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__setitem__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__iadd___addval(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10__iadd__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_12__iter__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_14values(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_16steps(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_18apply(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_fun); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_20__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_22__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8typecode___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8typecode_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8typecode_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_2_ChromVector_unpickle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_iv, PyObject *__pyx_v_offset, PyObject *__pyx_v_is_vector_of_sets, PyObject *__pyx_v__storage); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_chroms, int __pyx_v_stranded, PyObject *__pyx_v_typecode, PyObject *__pyx_v_storage, PyObject *__pyx_v_memmap_dir, PyObject *__pyx_v_header); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_2__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_4__setitem__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6add_chrom(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_length, PyObject *__pyx_v_start_index); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10__contains__(CYTHON_UNUSED struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_12write_bedgraph_file(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_file_or_filename, PyObject *__pyx_v_strand, PyObject *__pyx_v_track_options, PyObject *__pyx_v_separator); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_14from_bedgraph_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_file_or_filename, PyObject *__pyx_v_strand, PyObject *__pyx_v_typecode); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file_write_with_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bw, PyObject *__pyx_v_entries, PyObject *__pyx_v_bufsize, PyObject *__pyx_v_newentry); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_16write_bigwig_file(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_strand); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_18from_bigwig_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename, PyObject *__pyx_v_strand, PyObject *__pyx_v_typecode); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_20steps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8stranded___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8typecode___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_7storage___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6header___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6header_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6header_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_4_GenomicArray_unpickle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stranded, PyObject *__pyx_v_typecode, PyObject *__pyx_v_chrom_vectors); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_6_make_translation_table_for_complementation(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8reverse_complement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence___init__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_2get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, int __pyx_v_rename); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_4__str__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_6__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_5HTSeq_6_HTSeq_8Sequence_8__len__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_10__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_12__getstate__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_14__setstate__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_16__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_fasta_file, PyObject *__pyx_v_characters_per_line); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_20add_bases_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyArrayObject *__pyx_v_count_array_); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_22trim_left_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, float __pyx_v_mismatch_prop); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_24trim_right_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, float __pyx_v_mismatch_prop); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities___init__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_name, PyObject *__pyx_v_qualstr, PyObject *__pyx_v_qualscale); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_newvalue); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_6write_to_fastq_file(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_fastq_file); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8get_fastq_str(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_v_convert_to_phred); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_v_rename); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_12add_qual_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyArrayObject *__pyx_v_count_array_); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14trim_left_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_v_max_mm_qual); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_16trim_right_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_v_max_mm_qual); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation___init__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_type_, int __pyx_v_size, int __pyx_v_rfrom, int __pyx_v_rto, int __pyx_v_qfrom, int __pyx_v_qto, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand, int __pyx_v_check); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4check(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_10parse_cigar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cigar_string, int __pyx_v_ref_left, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12build_cigar_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cigar_pairs, int __pyx_v_ref_left, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment___init__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_read, PyObject *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_4read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_10paired_end___get__(CYTHON_UNUSED struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_7aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_4__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_6__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal___init__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_read_as_aligned, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_2__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment___init__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_bowtie_line); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved___get__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions___get__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_2__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_4__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_to_pysam_AlignedSegment(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_2to_pysam_AlignedRead(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4from_pysam_AlignedRead(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_read, PyObject *__pyx_v_samfile); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_6from_pysam_AlignedSegment(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_read, PyObject *__pyx_v_samfile); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8from_SAM_line(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_line); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10get_sam_line(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12has_optional_field(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_tag); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_14optional_field(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_tag); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_16raw_optional_fields(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14quotesafe_split(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s, PyObject *__pyx_v_split, PyObject *__pyx_v_quote); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_16__pyx_unpickle_CigarOperation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_18__pyx_unpickle_Alignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_20__pyx_unpickle_AlignmentWithSequenceReversal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_22__pyx_unpickle_BowtieAlignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5HTSeq_6_HTSeq_24__pyx_unpickle_SAM_Alignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicInterval(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicPosition(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_Sequence(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_SequenceWithQualities(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_Alignment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_SAM_Alignment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_ChromVector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_CigarOperation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_BowtieAlignment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(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_5HTSeq_6_HTSeq_GenomicInterval;
  PyObject *__pyx_type_5HTSeq_6_HTSeq_GenomicPosition;
  PyObject *__pyx_type_5HTSeq_6_HTSeq_Sequence;
  PyObject *__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities;
  PyObject *__pyx_type_5HTSeq_6_HTSeq_Alignment;
  PyObject *__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
  PyObject *__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment;
  PyObject *__pyx_type_5HTSeq_6_HTSeq_ChromVector;
  PyObject *__pyx_type_5HTSeq_6_HTSeq_GenomicArray;
  PyObject *__pyx_type_5HTSeq_6_HTSeq_CigarOperation;
  PyObject *__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment;
  PyObject *__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_Sequence;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_Alignment;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_ChromVector;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment;
  PyTypeObject *__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type__upper;
  PyObject *__pyx_k_;
  PyObject *__pyx_k__16;
  PyObject *__pyx_slice[5];
  PyObject *__pyx_tuple[17];
  PyObject *__pyx_codeobj_tab[74];
  PyObject *__pyx_string_tab[615];
  PyObject *__pyx_number_tab[17];
/* #### 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_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *__pyx_freelist_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__[8];
int __pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__;
#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_Automatic_adding_of_chromosomes __pyx_string_tab[0]
#define __pyx_kp_u_Cannot_assign_to_zero_length_int __pyx_string_tab[1]
#define __pyx_kp_u_Cannot_extend_an_interval_to_inc __pyx_string_tab[2]
#define __pyx_kp_u_Cannot_extend_an_interval_to_inc_2 __pyx_string_tab[3]
#define __pyx_kp_u_Cannot_extend_an_interval_to_inc_3 __pyx_string_tab[4]
#define __pyx_kp_u_Cannot_subset_to_zero_length_int __pyx_string_tab[5]
#define __pyx_kp_u_Chromosome_name_mismatch __pyx_string_tab[6]
#define __pyx_kp_u_Illegal_CIGAR_string_s __pyx_string_tab[7]
#define __pyx_kp_u_Illegal_base_letter_encountered __pyx_string_tab[8]
#define __pyx_kp_u_Illegal_index_type __pyx_string_tab[9]
#define __pyx_kp_u_Illegal_index_type_2 __pyx_string_tab[10]
#define __pyx_kp_u_Illegal_quality_scale_s __pyx_string_tab[11]
#define __pyx_kp_u_Illegal_storage_mode __pyx_string_tab[12]
#define __pyx_kp_u_Inconsistent_CIGAR_operation __pyx_string_tab[13]
#define __pyx_kp_u_Indefinite_length_chromosomes_ca __pyx_string_tab[14]
#define __pyx_kp_u_MIDNSHP_X __pyx_string_tab[15]
#define __pyx_kp_u_Malformatted_SAM_optional_field __pyx_string_tab[16]
#define __pyx_kp_u_Malformed_SAM_line_MRNM_although __pyx_string_tab[17]
#define __pyx_kp_u_Malformed_SAM_line_RNAME_althoug __pyx_string_tab[18]
#define __pyx_kp_u_Non_stranded_index_used_for_stra __pyx_string_tab[19]
#define __pyx_kp_u_None __pyx_string_tab[20]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[21]
#define __pyx_kp_u_Paired_end_read __pyx_string_tab[22]
#define __pyx_kp_u_Please_Install_PySam_to_use_this __pyx_string_tab[23]
#define __pyx_kp_u_Quality_string_has_not_the_same __pyx_string_tab[24]
#define __pyx_kp_u_Quality_string_missing __pyx_string_tab[25]
#define __pyx_kp_u_Quality_string_missing_2 __pyx_string_tab[26]
#define __pyx_kp_u_Required_assignment_signature_no __pyx_string_tab[27]
#define __pyx_kp_u_SAM_line_does_not_contain_at_lea __pyx_string_tab[28]
#define __pyx_kp_u_SAM_optional_field_tag_s_not_fou __pyx_string_tab[29]
#define __pyx_kp_u_SAM_optional_field_tag_s_not_uni __pyx_string_tab[30]
#define __pyx_kp_u_SAM_optional_field_with_illegal __pyx_string_tab[31]
#define __pyx_kp_u_Sequence_in_SAM_file_contains_wh __pyx_string_tab[32]
#define __pyx_kp_u_Sequence_in_SAM_file_contains_wh_2 __pyx_string_tab[33]
#define __pyx_kp_u_Start_of_interval_is_after_its_e __pyx_string_tab[34]
#define __pyx_kp_u_Strand_mismatch __pyx_string_tab[35]
#define __pyx_kp_u_Strand_must_be_or __pyx_string_tab[36]
#define __pyx_kp_u_Strand_must_be_specified_for_str __pyx_string_tab[37]
#define __pyx_kp_u_Strand_specified_in_unstranded_G __pyx_string_tab[38]
#define __pyx_kp_u_The_new_interval_must_match_the __pyx_string_tab[39]
#define __pyx_kp_u_Too_large_quality_value_encounte __pyx_string_tab[40]
#define __pyx_kp_u_Typecode_not_supported __pyx_string_tab[41]
#define __pyx_kp_u_Unknown_CIGAR_code_s_encountered __pyx_string_tab[42]
#define __pyx_kp_u__10 __pyx_string_tab[43]
#define __pyx_kp_u__11 __pyx_string_tab[44]
#define __pyx_kp_u__12 __pyx_string_tab[45]
#define __pyx_kp_u__14 __pyx_string_tab[46]
#define __pyx_kp_u__15 __pyx_string_tab[47]
#define __pyx_kp_u__17 __pyx_string_tab[48]
#define __pyx_kp_u__18 __pyx_string_tab[49]
#define __pyx_kp_u__19 __pyx_string_tab[50]
#define __pyx_kp_u__2 __pyx_string_tab[51]
#define __pyx_kp_u__20 __pyx_string_tab[52]
#define __pyx_kp_u__21 __pyx_string_tab[53]
#define __pyx_kp_u__22 __pyx_string_tab[54]
#define __pyx_kp_u__23 __pyx_string_tab[55]
#define __pyx_kp_u__24 __pyx_string_tab[56]
#define __pyx_kp_u__25 __pyx_string_tab[57]
#define __pyx_kp_u__26 __pyx_string_tab[58]
#define __pyx_kp_u__27 __pyx_string_tab[59]
#define __pyx_kp_u__28 __pyx_string_tab[60]
#define __pyx_kp_u__29 __pyx_string_tab[61]
#define __pyx_kp_u__3 __pyx_string_tab[62]
#define __pyx_kp_u__30 __pyx_string_tab[63]
#define __pyx_kp_u__31 __pyx_string_tab[64]
#define __pyx_kp_u__34 __pyx_string_tab[65]
#define __pyx_kp_u__4 __pyx_string_tab[66]
#define __pyx_kp_u__5 __pyx_string_tab[67]
#define __pyx_kp_u__6 __pyx_string_tab[68]
#define __pyx_kp_u__7 __pyx_string_tab[69]
#define __pyx_kp_u__8 __pyx_string_tab[70]
#define __pyx_kp_u__9 __pyx_string_tab[71]
#define __pyx_kp_u_add_note __pyx_string_tab[72]
#define __pyx_kp_u_aligned_to __pyx_string_tab[73]
#define __pyx_kp_u_assignment_to_qual_with_illegal __pyx_string_tab[74]
#define __pyx_kp_u_auto_write __pyx_string_tab[75]
#define __pyx_kp_u_base_s __pyx_string_tab[76]
#define __pyx_kp_u_chroms_must_be_a_list_or_a_dict __pyx_string_tab[77]
#define __pyx_kp_u_count_array_has_too_few_columns __pyx_string_tab[78]
#define __pyx_kp_u_count_array_too_small_for_seque __pyx_string_tab[79]
#define __pyx_kp_u_disable __pyx_string_tab[80]
#define __pyx_kp_u_enable __pyx_string_tab[81]
#define __pyx_kp_u_gc __pyx_string_tab[82]
#define __pyx_kp_u_hard_clipped __pyx_string_tab[83]
#define __pyx_kp_u_header_line_with_track_type_bedG __pyx_string_tab[84]
#define __pyx_kp_u_isenabled __pyx_string_tab[85]
#define __pyx_kp_u_length_2 __pyx_string_tab[86]
#define __pyx_kp_u_nmm __pyx_string_tab[87]
#define __pyx_kp_u_not_aligned __pyx_string_tab[88]
#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[89]
#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[90]
#define __pyx_kp_u_object __pyx_string_tab[91]
#define __pyx_kp_u_object_2 __pyx_string_tab[92]
#define __pyx_kp_u_object_3 __pyx_string_tab[93]
#define __pyx_kp_u_on_ref_iv __pyx_string_tab[94]
#define __pyx_kp_u_part __pyx_string_tab[95]
#define __pyx_kp_u_pyBigWig_is_required_to_write_a __pyx_string_tab[96]
#define __pyx_kp_u_qual_can_only_be_assigned_a_nump __pyx_string_tab[97]
#define __pyx_kp_u_query_iv __pyx_string_tab[98]
#define __pyx_kp_u_quote_must_be_length_1 __pyx_string_tab[99]
#define __pyx_kp_u_s __pyx_string_tab[100]
#define __pyx_kp_u_s_2 __pyx_string_tab[101]
#define __pyx_kp_u_seq_and_qualstr_do_not_have_the __pyx_string_tab[102]
#define __pyx_kp_u_sequence_matched __pyx_string_tab[103]
#define __pyx_kp_u_sequence_mismatched __pyx_string_tab[104]
#define __pyx_kp_u_soft_clipped __pyx_string_tab[105]
#define __pyx_kp_u_solexa_old __pyx_string_tab[106]
#define __pyx_kp_u_split_must_be_length_1 __pyx_string_tab[107]
#define __pyx_kp_u_src_HTSeq__HTSeq_pyx __pyx_string_tab[108]
#define __pyx_kp_u_start_is_larger_than_end __pyx_string_tab[109]
#define __pyx_kp_u_start_too_small __pyx_string_tab[110]
#define __pyx_kp_u_stop_too_large __pyx_string_tab[111]
#define __pyx_kp_u_strand_2 __pyx_string_tab[112]
#define __pyx_kp_u_strand_3 __pyx_string_tab[113]
#define __pyx_kp_u_stringsource __pyx_string_tab[114]
#define __pyx_kp_u_track_type_bedGraph __pyx_string_tab[115]
#define __pyx_kp_u_track_type_bedGraph_2 __pyx_string_tab[116]
#define __pyx_kp_u_track_type_bedGraph_s __pyx_string_tab[117]
#define __pyx_kp_u_unmatched_quote __pyx_string_tab[118]
#define __pyx_kp_u_w __pyx_string_tab[119]
#define __pyx_n_u_A __pyx_string_tab[120]
#define __pyx_n_u_AlignedRead __pyx_string_tab[121]
#define __pyx_n_u_AlignedSegment __pyx_string_tab[122]
#define __pyx_n_u_Alignment __pyx_string_tab[123]
#define __pyx_n_u_AlignmentWithSequenceReversal __pyx_string_tab[124]
#define __pyx_n_u_AlignmentWithSequenceReversal_2 __pyx_string_tab[125]
#define __pyx_n_u_AlignmentWithSequenceReversal_3 __pyx_string_tab[126]
#define __pyx_n_u_Alignment___reduce_cython __pyx_string_tab[127]
#define __pyx_n_u_Alignment___setstate_cython __pyx_string_tab[128]
#define __pyx_n_u_BigWig_Reader __pyx_string_tab[129]
#define __pyx_n_u_BowtieAlignment __pyx_string_tab[130]
#define __pyx_n_u_BowtieAlignment___reduce_cython __pyx_string_tab[131]
#define __pyx_n_u_BowtieAlignment___setstate_cytho __pyx_string_tab[132]
#define __pyx_n_u_C __pyx_string_tab[133]
#define __pyx_n_u_ChromVector __pyx_string_tab[134]
#define __pyx_n_u_ChromVector___reduce __pyx_string_tab[135]
#define __pyx_n_u_ChromVector__create_view __pyx_string_tab[136]
#define __pyx_n_u_ChromVector_apply __pyx_string_tab[137]
#define __pyx_n_u_ChromVector_create __pyx_string_tab[138]
#define __pyx_n_u_ChromVector_extend_to_include __pyx_string_tab[139]
#define __pyx_n_u_ChromVector_steps __pyx_string_tab[140]
#define __pyx_n_u_ChromVector_steps_2 __pyx_string_tab[141]
#define __pyx_n_u_ChromVector_unpickle __pyx_string_tab[142]
#define __pyx_n_u_ChromVector_values __pyx_string_tab[143]
#define __pyx_n_u_CigarOperation __pyx_string_tab[144]
#define __pyx_n_u_CigarOperation___reduce_cython __pyx_string_tab[145]
#define __pyx_n_u_CigarOperation___setstate_cython __pyx_string_tab[146]
#define __pyx_n_u_CigarOperation_check __pyx_string_tab[147]
#define __pyx_n_u_D __pyx_string_tab[148]
#define __pyx_n_u_G __pyx_string_tab[149]
#define __pyx_n_u_GenomicArray __pyx_string_tab[150]
#define __pyx_n_u_GenomicArray___reduce __pyx_string_tab[151]
#define __pyx_n_u_GenomicArray_add_chrom __pyx_string_tab[152]
#define __pyx_n_u_GenomicArray_from_bedgraph_file __pyx_string_tab[153]
#define __pyx_n_u_GenomicArray_from_bigwig_file __pyx_string_tab[154]
#define __pyx_n_u_GenomicArray_steps __pyx_string_tab[155]
#define __pyx_n_u_GenomicArray_steps_2 __pyx_string_tab[156]
#define __pyx_n_u_GenomicArray_unpickle __pyx_string_tab[157]
#define __pyx_n_u_GenomicArray_write_bedgraph_file __pyx_string_tab[158]
#define __pyx_n_u_GenomicArray_write_bigwig_file __pyx_string_tab[159]
#define __pyx_n_u_GenomicInterval __pyx_string_tab[160]
#define __pyx_n_u_GenomicInterval___copy __pyx_string_tab[161]
#define __pyx_n_u_GenomicInterval___reduce __pyx_string_tab[162]
#define __pyx_n_u_GenomicInterval_contains __pyx_string_tab[163]
#define __pyx_n_u_GenomicInterval_copy __pyx_string_tab[164]
#define __pyx_n_u_GenomicInterval_extend_to_includ __pyx_string_tab[165]
#define __pyx_n_u_GenomicInterval_from_directional __pyx_string_tab[166]
#define __pyx_n_u_GenomicInterval_is_contained_in __pyx_string_tab[167]
#define __pyx_n_u_GenomicInterval_overlaps __pyx_string_tab[168]
#define __pyx_n_u_GenomicInterval_range __pyx_string_tab[169]
#define __pyx_n_u_GenomicInterval_range_2 __pyx_string_tab[170]
#define __pyx_n_u_GenomicInterval_range_d __pyx_string_tab[171]
#define __pyx_n_u_GenomicInterval_ranged __pyx_string_tab[172]
#define __pyx_n_u_GenomicPosition __pyx_string_tab[173]
#define __pyx_n_u_GenomicPosition___reduce __pyx_string_tab[174]
#define __pyx_n_u_GenomicPosition_copy __pyx_string_tab[175]
#define __pyx_n_u_H __pyx_string_tab[176]
#define __pyx_n_u_HTSeq __pyx_string_tab[177]
#define __pyx_n_u_HTSeq_StretchVector __pyx_string_tab[178]
#define __pyx_n_u_HTSeq__HTSeq __pyx_string_tab[179]
#define __pyx_n_u_HTSeq_internal __pyx_string_tab[180]
#define __pyx_n_u_I __pyx_string_tab[181]
#define __pyx_n_u_Inf __pyx_string_tab[182]
#define __pyx_n_u_M __pyx_string_tab[183]
#define __pyx_n_u_N __pyx_string_tab[184]
#define __pyx_n_u_O __pyx_string_tab[185]
#define __pyx_n_u_P __pyx_string_tab[186]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[187]
#define __pyx_n_u_Read __pyx_string_tab[188]
#define __pyx_n_u_S __pyx_string_tab[189]
#define __pyx_n_u_SAM_Alignment __pyx_string_tab[190]
#define __pyx_n_u_SAM_Alignment___reduce_cython __pyx_string_tab[191]
#define __pyx_n_u_SAM_Alignment___setstate_cython __pyx_string_tab[192]
#define __pyx_n_u_SAM_Alignment_from_SAM_line __pyx_string_tab[193]
#define __pyx_n_u_SAM_Alignment_from_pysam_Aligned __pyx_string_tab[194]
#define __pyx_n_u_SAM_Alignment_from_pysam_Aligned_2 __pyx_string_tab[195]
#define __pyx_n_u_SAM_Alignment_get_sam_line __pyx_string_tab[196]
#define __pyx_n_u_SAM_Alignment_has_optional_field __pyx_string_tab[197]
#define __pyx_n_u_SAM_Alignment_optional_field __pyx_string_tab[198]
#define __pyx_n_u_SAM_Alignment_raw_optional_field __pyx_string_tab[199]
#define __pyx_n_u_SAM_Alignment_to_pysam_AlignedRe __pyx_string_tab[200]
#define __pyx_n_u_SAM_Alignment_to_pysam_AlignedSe __pyx_string_tab[201]
#define __pyx_n_u_Sequence __pyx_string_tab[202]
#define __pyx_n_u_SequenceWithQualities __pyx_string_tab[203]
#define __pyx_n_u_SequenceWithQualities_add_qual_t __pyx_string_tab[204]
#define __pyx_n_u_SequenceWithQualities_get_fastq __pyx_string_tab[205]
#define __pyx_n_u_SequenceWithQualities_get_revers __pyx_string_tab[206]
#define __pyx_n_u_SequenceWithQualities_trim_left __pyx_string_tab[207]
#define __pyx_n_u_SequenceWithQualities_trim_right __pyx_string_tab[208]
#define __pyx_n_u_SequenceWithQualities_write_to_f __pyx_string_tab[209]
#define __pyx_n_u_Sequence___getstate __pyx_string_tab[210]
#define __pyx_n_u_Sequence___reduce __pyx_string_tab[211]
#define __pyx_n_u_Sequence___setstate __pyx_string_tab[212]
#define __pyx_n_u_Sequence_add_bases_to_count_arra __pyx_string_tab[213]
#define __pyx_n_u_Sequence_get_reverse_complement __pyx_string_tab[214]
#define __pyx_n_u_Sequence_trim_left_end __pyx_string_tab[215]
#define __pyx_n_u_Sequence_trim_right_end __pyx_string_tab[216]
#define __pyx_n_u_Sequence_write_to_fasta_file __pyx_string_tab[217]
#define __pyx_n_u_StepVector __pyx_string_tab[218]
#define __pyx_n_u_StretchVector __pyx_string_tab[219]
#define __pyx_n_u_StringIO __pyx_string_tab[220]
#define __pyx_n_u_T __pyx_string_tab[221]
#define __pyx_n_u_X __pyx_string_tab[222]
#define __pyx_n_u_Z __pyx_string_tab[223]
#define __pyx_n_u__13 __pyx_string_tab[224]
#define __pyx_n_u_a __pyx_string_tab[225]
#define __pyx_n_u_add __pyx_string_tab[226]
#define __pyx_n_u_addEntries __pyx_string_tab[227]
#define __pyx_n_u_addHeader __pyx_string_tab[228]
#define __pyx_n_u_add_bases_to_count_array __pyx_string_tab[229]
#define __pyx_n_u_add_chrom __pyx_string_tab[230]
#define __pyx_n_u_add_qual_to_count_array __pyx_string_tab[231]
#define __pyx_n_u_addval __pyx_string_tab[232]
#define __pyx_n_u_aend __pyx_string_tab[233]
#define __pyx_n_u_aligned __pyx_string_tab[234]
#define __pyx_n_u_alnmt __pyx_string_tab[235]
#define __pyx_n_u_append __pyx_string_tab[236]
#define __pyx_n_u_apply __pyx_string_tab[237]
#define __pyx_n_u_args __pyx_string_tab[238]
#define __pyx_n_u_array __pyx_string_tab[239]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[240]
#define __pyx_n_u_auto __pyx_string_tab[241]
#define __pyx_n_u_base_to_column __pyx_string_tab[242]
#define __pyx_n_u_bowtie_line __pyx_string_tab[243]
#define __pyx_n_u_bufsize __pyx_string_tab[244]
#define __pyx_n_u_build_cigar_list __pyx_string_tab[245]
#define __pyx_n_u_bw __pyx_string_tab[246]
#define __pyx_n_u_c __pyx_string_tab[247]
#define __pyx_n_u_cStringIO __pyx_string_tab[248]
#define __pyx_n_u_characters_per_line __pyx_string_tab[249]
#define __pyx_n_u_check __pyx_string_tab[250]
#define __pyx_n_u_chrom __pyx_string_tab[251]
#define __pyx_n_u_chrom_dict __pyx_string_tab[252]
#define __pyx_n_u_chrom_vectors __pyx_string_tab[253]
#define __pyx_n_u_chroms __pyx_string_tab[254]
#define __pyx_n_u_cigar __pyx_string_tab[255]
#define __pyx_n_u_cigar_operation_code_dict __pyx_string_tab[256]
#define __pyx_n_u_cigar_operation_codes __pyx_string_tab[257]
#define __pyx_n_u_cigar_operation_names __pyx_string_tab[258]
#define __pyx_n_u_cigar_pairs __pyx_string_tab[259]
#define __pyx_n_u_cigar_string __pyx_string_tab[260]
#define __pyx_n_u_cigarlist __pyx_string_tab[261]
#define __pyx_n_u_cigartuples __pyx_string_tab[262]
#define __pyx_n_u_class __pyx_string_tab[263]
#define __pyx_n_u_class_getitem __pyx_string_tab[264]
#define __pyx_n_u_clear __pyx_string_tab[265]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[266]
#define __pyx_n_u_close __pyx_string_tab[267]
#define __pyx_n_u_cls __pyx_string_tab[268]
#define __pyx_n_u_code __pyx_string_tab[269]
#define __pyx_n_u_collections __pyx_string_tab[270]
#define __pyx_n_u_compile __pyx_string_tab[271]
#define __pyx_n_u_constr __pyx_string_tab[272]
#define __pyx_n_u_contains __pyx_string_tab[273]
#define __pyx_n_u_convert_to_phred __pyx_string_tab[274]
#define __pyx_n_u_cop __pyx_string_tab[275]
#define __pyx_n_u_copy __pyx_string_tab[276]
#define __pyx_n_u_copy_2 __pyx_string_tab[277]
#define __pyx_n_u_count_array __pyx_string_tab[278]
#define __pyx_n_u_create __pyx_string_tab[279]
#define __pyx_n_u_create_view __pyx_string_tab[280]
#define __pyx_n_u_csv __pyx_string_tab[281]
#define __pyx_n_u_cv __pyx_string_tab[282]
#define __pyx_n_u_d __pyx_string_tab[283]
#define __pyx_n_u_decode __pyx_string_tab[284]
#define __pyx_n_u_deleted __pyx_string_tab[285]
#define __pyx_n_u_descr __pyx_string_tab[286]
#define __pyx_n_u_dict __pyx_string_tab[287]
#define __pyx_n_u_dict_2 __pyx_string_tab[288]
#define __pyx_n_u_dtype __pyx_string_tab[289]
#define __pyx_n_u_empty __pyx_string_tab[290]
#define __pyx_n_u_encode __pyx_string_tab[291]
#define __pyx_n_u_end __pyx_string_tab[292]
#define __pyx_n_u_end_d __pyx_string_tab[293]
#define __pyx_n_u_ends __pyx_string_tab[294]
#define __pyx_n_u_enter __pyx_string_tab[295]
#define __pyx_n_u_entries __pyx_string_tab[296]
#define __pyx_n_u_entry __pyx_string_tab[297]
#define __pyx_n_u_enumerate __pyx_string_tab[298]
#define __pyx_n_u_exit __pyx_string_tab[299]
#define __pyx_n_u_extend_to_include __pyx_string_tab[300]
#define __pyx_n_u_f __pyx_string_tab[301]
#define __pyx_n_u_fasta_file __pyx_string_tab[302]
#define __pyx_n_u_fastq_file __pyx_string_tab[303]
#define __pyx_n_u_field __pyx_string_tab[304]
#define __pyx_n_u_fields __pyx_string_tab[305]
#define __pyx_n_u_file_or_filename __pyx_string_tab[306]
#define __pyx_n_u_filename __pyx_string_tab[307]
#define __pyx_n_u_first __pyx_string_tab[308]
#define __pyx_n_u_flag __pyx_string_tab[309]
#define __pyx_n_u_flagint __pyx_string_tab[310]
#define __pyx_n_u_from_SAM_line __pyx_string_tab[311]
#define __pyx_n_u_from_bedgraph_file __pyx_string_tab[312]
#define __pyx_n_u_from_bigwig_file __pyx_string_tab[313]
#define __pyx_n_u_from_pysam_AlignedRead __pyx_string_tab[314]
#define __pyx_n_u_from_pysam_AlignedSegment __pyx_string_tab[315]
#define __pyx_n_u_fun __pyx_string_tab[316]
#define __pyx_n_u_func __pyx_string_tab[317]
#define __pyx_n_u_ga __pyx_string_tab[318]
#define __pyx_n_u_get_fastq_str __pyx_string_tab[319]
#define __pyx_n_u_get_reverse_complement __pyx_string_tab[320]
#define __pyx_n_u_get_sam_line __pyx_string_tab[321]
#define __pyx_n_u_getrname __pyx_string_tab[322]
#define __pyx_n_u_getstate __pyx_string_tab[323]
#define __pyx_n_u_gettid __pyx_string_tab[324]
#define __pyx_n_u_getvalue __pyx_string_tab[325]
#define __pyx_n_u_gzip __pyx_string_tab[326]
#define __pyx_n_u_has_optional_field __pyx_string_tab[327]
#define __pyx_n_u_header __pyx_string_tab[328]
#define __pyx_n_u_i __pyx_string_tab[329]
#define __pyx_n_u_iadd __pyx_string_tab[330]
#define __pyx_n_u_iadd___locals_addval __pyx_string_tab[331]
#define __pyx_n_u_index __pyx_string_tab[332]
#define __pyx_n_u_init __pyx_string_tab[333]
#define __pyx_n_u_inserted __pyx_string_tab[334]
#define __pyx_n_u_intervals __pyx_string_tab[335]
#define __pyx_n_u_is_contained_in __pyx_string_tab[336]
#define __pyx_n_u_is_coroutine __pyx_string_tab[337]
#define __pyx_n_u_is_duplicate __pyx_string_tab[338]
#define __pyx_n_u_is_paired __pyx_string_tab[339]
#define __pyx_n_u_is_proper_pair __pyx_string_tab[340]
#define __pyx_n_u_is_qcfail __pyx_string_tab[341]
#define __pyx_n_u_is_read1 __pyx_string_tab[342]
#define __pyx_n_u_is_read2 __pyx_string_tab[343]
#define __pyx_n_u_is_reverse __pyx_string_tab[344]
#define __pyx_n_u_is_secondary __pyx_string_tab[345]
#define __pyx_n_u_is_supplementary __pyx_string_tab[346]
#define __pyx_n_u_is_unmapped __pyx_string_tab[347]
#define __pyx_n_u_is_vector_of_sets __pyx_string_tab[348]
#define __pyx_n_u_isize __pyx_string_tab[349]
#define __pyx_n_u_items __pyx_string_tab[350]
#define __pyx_n_u_itertools __pyx_string_tab[351]
#define __pyx_n_u_iv __pyx_string_tab[352]
#define __pyx_n_u_join __pyx_string_tab[353]
#define __pyx_n_u_key __pyx_string_tab[354]
#define __pyx_n_u_l __pyx_string_tab[355]
#define __pyx_n_u_length __pyx_string_tab[356]
#define __pyx_n_u_line __pyx_string_tab[357]
#define __pyx_n_u_log10 __pyx_string_tab[358]
#define __pyx_n_u_main __pyx_string_tab[359]
#define __pyx_n_u_make_translation_table_for_comp __pyx_string_tab[360]
#define __pyx_n_u_maketrans __pyx_string_tab[361]
#define __pyx_n_u_mapping_quality __pyx_string_tab[362]
#define __pyx_n_u_mapq __pyx_string_tab[363]
#define __pyx_n_u_matched __pyx_string_tab[364]
#define __pyx_n_u_mate_aligned __pyx_string_tab[365]
#define __pyx_n_u_mate_is_reverse __pyx_string_tab[366]
#define __pyx_n_u_mate_is_unmapped __pyx_string_tab[367]
#define __pyx_n_u_mate_start __pyx_string_tab[368]
#define __pyx_n_u_math __pyx_string_tab[369]
#define __pyx_n_u_max_mm_qual __pyx_string_tab[370]
#define __pyx_n_u_maxsize __pyx_string_tab[371]
#define __pyx_n_u_memmap __pyx_string_tab[372]
#define __pyx_n_u_memmap_dir __pyx_string_tab[373]
#define __pyx_n_u_mismatch_prop __pyx_string_tab[374]
#define __pyx_n_u_missing __pyx_string_tab[375]
#define __pyx_n_u_mode __pyx_string_tab[376]
#define __pyx_n_u_module __pyx_string_tab[377]
#define __pyx_n_u_mpos __pyx_string_tab[378]
#define __pyx_n_u_mrnm __pyx_string_tab[379]
#define __pyx_n_u_name __pyx_string_tab[380]
#define __pyx_n_u_name_2 __pyx_string_tab[381]
#define __pyx_n_u_ncv __pyx_string_tab[382]
#define __pyx_n_u_ndarray __pyx_string_tab[383]
#define __pyx_n_u_new __pyx_string_tab[384]
#define __pyx_n_u_newentry __pyx_string_tab[385]
#define __pyx_n_u_next_reference_id __pyx_string_tab[386]
#define __pyx_n_u_next_reference_start __pyx_string_tab[387]
#define __pyx_n_u_none __pyx_string_tab[388]
#define __pyx_n_u_noquals __pyx_string_tab[389]
#define __pyx_n_u_not_paired_end __pyx_string_tab[390]
#define __pyx_n_u_numpy __pyx_string_tab[391]
#define __pyx_n_u_offset __pyx_string_tab[392]
#define __pyx_n_u_op __pyx_string_tab[393]
#define __pyx_n_u_open __pyx_string_tab[394]
#define __pyx_n_u_optional_field __pyx_string_tab[395]
#define __pyx_n_u_optional_fields __pyx_string_tab[396]
#define __pyx_n_u_os __pyx_string_tab[397]
#define __pyx_n_u_overlaps __pyx_string_tab[398]
#define __pyx_n_u_p __pyx_string_tab[399]
#define __pyx_n_u_padded __pyx_string_tab[400]
#define __pyx_n_u_paired_end __pyx_string_tab[401]
#define __pyx_n_u_parse_cigar __pyx_string_tab[402]
#define __pyx_n_u_path __pyx_string_tab[403]
#define __pyx_n_u_pattern __pyx_string_tab[404]
#define __pyx_n_u_phred __pyx_string_tab[405]
#define __pyx_n_u_pop __pyx_string_tab[406]
#define __pyx_n_u_pos __pyx_string_tab[407]
#define __pyx_n_u_posint __pyx_string_tab[408]
#define __pyx_n_u_pyBigWig __pyx_string_tab[409]
#define __pyx_n_u_pysam __pyx_string_tab[410]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[411]
#define __pyx_n_u_pyx_result __pyx_string_tab[412]
#define __pyx_n_u_pyx_state __pyx_string_tab[413]
#define __pyx_n_u_pyx_type __pyx_string_tab[414]
#define __pyx_n_u_pyx_unpickle_Alignment __pyx_string_tab[415]
#define __pyx_n_u_pyx_unpickle_AlignmentWithSequ __pyx_string_tab[416]
#define __pyx_n_u_pyx_unpickle_BowtieAlignment __pyx_string_tab[417]
#define __pyx_n_u_pyx_unpickle_CigarOperation __pyx_string_tab[418]
#define __pyx_n_u_pyx_unpickle_SAM_Alignment __pyx_string_tab[419]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[420]
#define __pyx_n_u_qfrom __pyx_string_tab[421]
#define __pyx_n_u_qlen __pyx_string_tab[422]
#define __pyx_n_u_qname __pyx_string_tab[423]
#define __pyx_n_u_qto __pyx_string_tab[424]
#define __pyx_n_u_qual __pyx_string_tab[425]
#define __pyx_n_u_qualname __pyx_string_tab[426]
#define __pyx_n_u_qualscale __pyx_string_tab[427]
#define __pyx_n_u_qualstr __pyx_string_tab[428]
#define __pyx_n_u_query_name __pyx_string_tab[429]
#define __pyx_n_u_query_qualities __pyx_string_tab[430]
#define __pyx_n_u_query_sequence __pyx_string_tab[431]
#define __pyx_n_u_query_start __pyx_string_tab[432]
#define __pyx_n_u_quote __pyx_string_tab[433]
#define __pyx_n_u_quotesafe_split __pyx_string_tab[434]
#define __pyx_n_u_r __pyx_string_tab[435]
#define __pyx_n_u_range __pyx_string_tab[436]
#define __pyx_n_u_range_d __pyx_string_tab[437]
#define __pyx_n_u_raw __pyx_string_tab[438]
#define __pyx_n_u_raw_optional_fields __pyx_string_tab[439]
#define __pyx_n_u_re __pyx_string_tab[440]
#define __pyx_n_u_re_cigar_codes __pyx_string_tab[441]
#define __pyx_n_u_read __pyx_string_tab[442]
#define __pyx_n_u_read_as_aligned __pyx_string_tab[443]
#define __pyx_n_u_reduce __pyx_string_tab[444]
#define __pyx_n_u_reduce_cython __pyx_string_tab[445]
#define __pyx_n_u_reduce_ex __pyx_string_tab[446]
#define __pyx_n_u_ref_iv __pyx_string_tab[447]
#define __pyx_n_u_ref_left __pyx_string_tab[448]
#define __pyx_n_u_reference_end __pyx_string_tab[449]
#define __pyx_n_u_reference_id __pyx_string_tab[450]
#define __pyx_n_u_reference_start __pyx_string_tab[451]
#define __pyx_n_u_rename __pyx_string_tab[452]
#define __pyx_n_u_res __pyx_string_tab[453]
#define __pyx_n_u_revcomp_of __pyx_string_tab[454]
#define __pyx_n_u_reverse_complement __pyx_string_tab[455]
#define __pyx_n_u_rfrom __pyx_string_tab[456]
#define __pyx_n_u_rlen __pyx_string_tab[457]
#define __pyx_n_u_rname __pyx_string_tab[458]
#define __pyx_n_u_rstrip __pyx_string_tab[459]
#define __pyx_n_u_rto __pyx_string_tab[460]
#define __pyx_n_u_s_3 __pyx_string_tab[461]
#define __pyx_n_u_samfile __pyx_string_tab[462]
#define __pyx_n_u_second __pyx_string_tab[463]
#define __pyx_n_u_self __pyx_string_tab[464]
#define __pyx_n_u_sep __pyx_string_tab[465]
#define __pyx_n_u_separator __pyx_string_tab[466]
#define __pyx_n_u_seq __pyx_string_tab[467]
#define __pyx_n_u_set_name __pyx_string_tab[468]
#define __pyx_n_u_setdefault __pyx_string_tab[469]
#define __pyx_n_u_setstate __pyx_string_tab[470]
#define __pyx_n_u_setstate_cython __pyx_string_tab[471]
#define __pyx_n_u_sf __pyx_string_tab[472]
#define __pyx_n_u_shape __pyx_string_tab[473]
#define __pyx_n_u_sio __pyx_string_tab[474]
#define __pyx_n_u_size __pyx_string_tab[475]
#define __pyx_n_u_skipped __pyx_string_tab[476]
#define __pyx_n_u_solexa __pyx_string_tab[477]
#define __pyx_n_u_split __pyx_string_tab[478]
#define __pyx_n_u_start __pyx_string_tab[479]
#define __pyx_n_u_start_d __pyx_string_tab[480]
#define __pyx_n_u_start_index __pyx_string_tab[481]
#define __pyx_n_u_startdiff __pyx_string_tab[482]
#define __pyx_n_u_startswith __pyx_string_tab[483]
#define __pyx_n_u_state __pyx_string_tab[484]
#define __pyx_n_u_stderr __pyx_string_tab[485]
#define __pyx_n_u_step __pyx_string_tab[486]
#define __pyx_n_u_steps __pyx_string_tab[487]
#define __pyx_n_u_stop __pyx_string_tab[488]
#define __pyx_n_u_storage __pyx_string_tab[489]
#define __pyx_n_u_storage_2 __pyx_string_tab[490]
#define __pyx_n_u_strand __pyx_string_tab[491]
#define __pyx_n_u_stranded __pyx_string_tab[492]
#define __pyx_n_u_stretch __pyx_string_tab[493]
#define __pyx_n_u_swq __pyx_string_tab[494]
#define __pyx_n_u_sys __pyx_string_tab[495]
#define __pyx_n_u_tag __pyx_string_tab[496]
#define __pyx_n_u_tags __pyx_string_tab[497]
#define __pyx_n_u_tc __pyx_string_tab[498]
#define __pyx_n_u_template_length __pyx_string_tab[499]
#define __pyx_n_u_test __pyx_string_tab[500]
#define __pyx_n_u_tid __pyx_string_tab[501]
#define __pyx_n_u_to_pysam_AlignedRead __pyx_string_tab[502]
#define __pyx_n_u_to_pysam_AlignedSegment __pyx_string_tab[503]
#define __pyx_n_u_track_options __pyx_string_tab[504]
#define __pyx_n_u_translate __pyx_string_tab[505]
#define __pyx_n_u_trim_left_end __pyx_string_tab[506]
#define __pyx_n_u_trim_left_end_with_quals __pyx_string_tab[507]
#define __pyx_n_u_trim_right_end __pyx_string_tab[508]
#define __pyx_n_u_trim_right_end_with_quals __pyx_string_tab[509]
#define __pyx_n_u_type __pyx_string_tab[510]
#define __pyx_n_u_type_2 __pyx_string_tab[511]
#define __pyx_n_u_typecode __pyx_string_tab[512]
#define __pyx_n_u_uint8 __pyx_string_tab[513]
#define __pyx_n_u_unknown __pyx_string_tab[514]
#define __pyx_n_u_unnamed __pyx_string_tab[515]
#define __pyx_n_u_update __pyx_string_tab[516]
#define __pyx_n_u_upper __pyx_string_tab[517]
#define __pyx_n_u_use_setstate __pyx_string_tab[518]
#define __pyx_n_u_v __pyx_string_tab[519]
#define __pyx_n_u_value __pyx_string_tab[520]
#define __pyx_n_u_values __pyx_string_tab[521]
#define __pyx_n_u_vec __pyx_string_tab[522]
#define __pyx_n_u_w_2 __pyx_string_tab[523]
#define __pyx_n_u_warnings __pyx_string_tab[524]
#define __pyx_n_u_write __pyx_string_tab[525]
#define __pyx_n_u_write_bedgraph_file __pyx_string_tab[526]
#define __pyx_n_u_write_bigwig_file __pyx_string_tab[527]
#define __pyx_n_u_write_bigwig_file_locals_write_w __pyx_string_tab[528]
#define __pyx_n_u_write_to_fasta_file __pyx_string_tab[529]
#define __pyx_n_u_write_to_fastq_file __pyx_string_tab[530]
#define __pyx_n_u_write_with_buffer __pyx_string_tab[531]
#define __pyx_n_u_x __pyx_string_tab[532]
#define __pyx_n_u_y __pyx_string_tab[533]
#define __pyx_n_u_zeros __pyx_string_tab[534]
#define __pyx_kp_b__12 __pyx_string_tab[535]
#define __pyx_kp_b__23 __pyx_string_tab[536]
#define __pyx_kp_b__32 __pyx_string_tab[537]
#define __pyx_kp_b__33 __pyx_string_tab[538]
#define __pyx_kp_b_iso88591_00B_1_a_Qa_Qa_s_7_Q_j_s_7_Q_j_Q __pyx_string_tab[539]
#define __pyx_kp_b_iso88591_1F __pyx_string_tab[540]
#define __pyx_kp_b_iso88591_1F_2 __pyx_string_tab[541]
#define __pyx_kp_b_iso88591_2_4AV1 __pyx_string_tab[542]
#define __pyx_kp_b_iso88591_2_iy_a_s_1 __pyx_string_tab[543]
#define __pyx_kp_b_iso88591_3d_Jaq __pyx_string_tab[544]
#define __pyx_kp_b_iso88591_4A_5QfA __pyx_string_tab[545]
#define __pyx_kp_b_iso88591_5 __pyx_string_tab[546]
#define __pyx_kp_b_iso88591_6m_RS_q_Cs_S_1M_2S_j_5Rq_U_3a_C __pyx_string_tab[547]
#define __pyx_kp_b_iso88591_8_9G1_q_q_G1HAQ_3ay_1_k_q_WAYgW __pyx_string_tab[548]
#define __pyx_kp_b_iso88591_A9Gq_7_Q_A_q_Q_4_1_gQa_gQ_Cq_1_r __pyx_string_tab[549]
#define __pyx_kp_b_iso88591_ARS0_c_6_83a_y_1_9E_q_r_F_9E_q_r __pyx_string_tab[550]
#define __pyx_kp_b_iso88591_AV1 __pyx_string_tab[551]
#define __pyx_kp_b_iso88591_A_0 __pyx_string_tab[552]
#define __pyx_kp_b_iso88591_A_1 __pyx_string_tab[553]
#define __pyx_kp_b_iso88591_A_1_81_4q_b_A_81_4q_A __pyx_string_tab[554]
#define __pyx_kp_b_iso88591_A_2XS_AQ_Cq_q_Q_3a_c_S_q __pyx_string_tab[555]
#define __pyx_kp_b_iso88591_A_2XS_Cq_A_S_q_Cwb_C_Jd_Q_4z_A_t __pyx_string_tab[556]
#define __pyx_kp_b_iso88591_A_3c_1A_4wc_1_AQ_4xw_d_HGCSST_HG __pyx_string_tab[557]
#define __pyx_kp_b_iso88591_A_3c_1_4wc_1_1_4xw_d_HGCSST_HG2Q __pyx_string_tab[558]
#define __pyx_kp_b_iso88591_A_3c_1_4wc_1_1_4y_t2XWDTTU_HG2Q __pyx_string_tab[559]
#define __pyx_kp_b_iso88591_A_3c_1_r __pyx_string_tab[560]
#define __pyx_kp_b_iso88591_A_4q_a_4_7_Q_q_4wgQ_t1_AS_r_A_A __pyx_string_tab[561]
#define __pyx_kp_b_iso88591_A_7_6_d_fA_4wd_fAXRt1_T_2Q_XWCr __pyx_string_tab[562]
#define __pyx_kp_b_iso88591_A_AU_Qa_q __pyx_string_tab[563]
#define __pyx_kp_b_iso88591_A_B_c_a_Ql_3b_AQ_Ql_3b_AQ_t1_E_a __pyx_string_tab[564]
#define __pyx_kp_b_iso88591_A_C_4z_A_q_A_Q_m1Kq_q_g_q_AQ_E_a __pyx_string_tab[565]
#define __pyx_kp_b_iso88591_A_D_V1_ar_ir_a_c __pyx_string_tab[566]
#define __pyx_kp_b_iso88591_A_E_Q_q_Cq_q_q __pyx_string_tab[567]
#define __pyx_kp_b_iso88591_A_G5_HE_IU_1 __pyx_string_tab[568]
#define __pyx_kp_b_iso88591_A_Jb_A_G1_4vS_Ct6_D_4vS_uE_D_d_s __pyx_string_tab[569]
#define __pyx_kp_b_iso88591_A_Kt1 __pyx_string_tab[570]
#define __pyx_kp_b_iso88591_A_M_V4xt __pyx_string_tab[571]
#define __pyx_kp_b_iso88591_A_Q_4t1_G9AT_A_5Q_Q_O3fD_s_Q_wa __pyx_string_tab[572]
#define __pyx_kp_b_iso88591_A_Q_4t1_G9AT_F_gQ_D_c_t4vS_q_O7 __pyx_string_tab[573]
#define __pyx_kp_b_iso88591_A_Q_D_Kt7_Q_AQ_4z_WHM_AQ_U_XQ_Q __pyx_string_tab[574]
#define __pyx_kp_b_iso88591_A_Q_Q_Qb_q_Cq_1_Bj_A_D_uJiq_r_A __pyx_string_tab[575]
#define __pyx_kp_b_iso88591_A_Qd_QgQ_7_A_Q_Q_t1_wa_4z_A_q_A __pyx_string_tab[576]
#define __pyx_kp_b_iso88591_A_Qd_QgQ_7_A_Q_Q_t1_wa_4z_A_q_A_2 __pyx_string_tab[577]
#define __pyx_kp_b_iso88591_A_WBfAQ_3axr_AQ_gU_vV1_hfARq_3fA __pyx_string_tab[578]
#define __pyx_kp_b_iso88591_A_XT_Q_Q __pyx_string_tab[579]
#define __pyx_kp_b_iso88591_A_XT_t1 __pyx_string_tab[580]
#define __pyx_kp_b_iso88591_A_a_D_Kt7_Q_AQ_4z_WHM_AQ_7_Q_A_q __pyx_string_tab[581]
#define __pyx_kp_b_iso88591_A_a_F_a_r_Ks_3ar_c_1Bk_A_Q_1Bk_A __pyx_string_tab[582]
#define __pyx_kp_b_iso88591_A_ar_U_s_1Cs_3auCq_3ar_s_5_1_ha __pyx_string_tab[583]
#define __pyx_kp_b_iso88591_A_at84vT __pyx_string_tab[584]
#define __pyx_kp_b_iso88591_A_at84xt6_Q __pyx_string_tab[585]
#define __pyx_kp_b_iso88591_A_iq_fA_j_1_l_1 __pyx_string_tab[586]
#define __pyx_kp_b_iso88591_A_t1D_at3gRt9D_5_a __pyx_string_tab[587]
#define __pyx_kp_b_iso88591_A_t1_A_Q __pyx_string_tab[588]
#define __pyx_kp_b_iso88591_A_t_a_vRq __pyx_string_tab[589]
#define __pyx_kp_b_iso88591_A_t_c_q_HD_T_6J_a __pyx_string_tab[590]
#define __pyx_kp_b_iso88591_A_wfA_E_4uHD_CuCt3hcQZZ_cczz_D_Y __pyx_string_tab[591]
#define __pyx_kp_b_iso88591_A_wfA_E_Q_E_U_e1_Q_Q_4q_Yb_1_81A __pyx_string_tab[592]
#define __pyx_kp_b_iso88591_B_4wgQ_fA_4wd_fAXRt1_s_fAT_WCr __pyx_string_tab[593]
#define __pyx_kp_b_iso88591_I_1_q_4q_b_A_IT_A_q_4q_A_IT_A_4 __pyx_string_tab[594]
#define __pyx_kp_b_iso88591_Qd_A_q_1 __pyx_string_tab[595]
#define __pyx_kp_b_iso88591_QfA __pyx_string_tab[596]
#define __pyx_kp_b_iso88591_SST_V1A_wc_awixr_awhb_r_HBc __pyx_string_tab[597]
#define __pyx_kp_b_iso88591_T_2_e4_QQUU_dde_G1F_a_vWE_Q_q_t __pyx_string_tab[598]
#define __pyx_kp_b_iso88591_T_2_e4q_G1F_a_vWE_Q_q_t7_c_5I_P __pyx_string_tab[599]
#define __pyx_kp_b_iso88591_T_Q_G1F_a_vWE_Q_q_t7_c_T_q_awk __pyx_string_tab[600]
#define __pyx_kp_b_iso88591_T_XT_d_hVZZoos_t_K_K_O_O_T_T_X __pyx_string_tab[601]
#define __pyx_kp_b_iso88591_T_d_T_gT_G1F_a_vWE_Q_q_t87_s_fG __pyx_string_tab[602]
#define __pyx_kp_b_iso88591_VVW_Qd_QgQ_7_A_Q_Q_t1_wa_E_as_1 __pyx_string_tab[603]
#define __pyx_kp_b_iso88591_WWX_Qd_QgQ_7_A_Q_Q_t1_wa_E_as_1 __pyx_string_tab[604]
#define __pyx_kp_b_iso88591_WX_1_1_ha_5_4s_s_c_c_wa_Q_fF_r __pyx_string_tab[605]
#define __pyx_kp_b_iso88591_c_q_7_S_S_81_4q_ay_j_avQa_7_4t1 __pyx_string_tab[606]
#define __pyx_kp_b_iso88591_q_0_kQR_0_7_q_nno_1 __pyx_string_tab[607]
#define __pyx_kp_b_iso88591_q_0_kQR_1_7_1_2DNRS_1 __pyx_string_tab[608]
#define __pyx_kp_b_iso88591_q_0_kQR_7_0_1B_PQ_1 __pyx_string_tab[609]
#define __pyx_kp_b_iso88591_q_0_kQR_7_q0_a_1 __pyx_string_tab[610]
#define __pyx_kp_b_iso88591_q_0_kQR_9HAQ_7_1L_a_1 __pyx_string_tab[611]
#define __pyx_kp_b_iso88591_q_a __pyx_string_tab[612]
#define __pyx_n_b_ACGTacgt __pyx_string_tab[613]
#define __pyx_n_b_TGCAtgca __pyx_string_tab[614]
#define __pyx_float_0_ __pyx_number_tab[0]
#define __pyx_int_0 __pyx_number_tab[1]
#define __pyx_int_neg_1 __pyx_number_tab[2]
#define __pyx_int_1 __pyx_number_tab[3]
#define __pyx_int_2 __pyx_number_tab[4]
#define __pyx_int_3 __pyx_number_tab[5]
#define __pyx_int_4 __pyx_number_tab[6]
#define __pyx_int_5 __pyx_number_tab[7]
#define __pyx_int_10 __pyx_number_tab[8]
#define __pyx_int_11 __pyx_number_tab[9]
#define __pyx_int_16 __pyx_number_tab[10]
#define __pyx_int_70 __pyx_number_tab[11]
#define __pyx_int_1450081 __pyx_number_tab[12]
#define __pyx_int_9874465 __pyx_number_tab[13]
#define __pyx_int_240641895 __pyx_number_tab[14]
#define __pyx_int_246267685 __pyx_number_tab[15]
#define __pyx_int_260241271 __pyx_number_tab[16]
/* #### 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_5HTSeq_6_HTSeq_GenomicInterval);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_GenomicInterval);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_GenomicPosition);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq_Sequence);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_Sequence);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq_Alignment);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_Alignment);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_ChromVector);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_GenomicArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_CigarOperation);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment);
  Py_CLEAR(clear_module_state->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__);
  Py_CLEAR(clear_module_state->__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__);
  Py_CLEAR(clear_module_state->__pyx_k_);
  Py_CLEAR(clear_module_state->__pyx_k__16);
  for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
  for (int i=0; i<17; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<74; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<615; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<17; ++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_5HTSeq_6_HTSeq_GenomicInterval);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_GenomicInterval);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_GenomicPosition);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq_Sequence);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_Sequence);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq_Alignment);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_Alignment);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_ChromVector);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_GenomicArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_CigarOperation);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment);
  Py_VISIT(traverse_module_state->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__);
  Py_VISIT(traverse_module_state->__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__);
  Py_VISIT(traverse_module_state->__pyx_k_);
  Py_VISIT(traverse_module_state->__pyx_k__16);
  for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
  for (int i=0; i<17; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<74; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<615; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<17; ++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 ### */

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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) {

    /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

    /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:
*/
  }

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
  }

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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)

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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) {

    /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

    /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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
*/
  }

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:*/ {

      /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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)

      /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:;

    /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

      /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

    /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:;
  }

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:*/ {

      /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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)

      /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:;

    /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

      /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

    /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:;
  }

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:*/ {

      /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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)

      /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:;

    /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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);

      /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

    /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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:;
  }

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;

  /* "../tmp/pip-build-env-n34eltaq/overlay/lib/python3.12/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;
}

/* "HTSeq/_HTSeq.pyx":54
 *     """
 * 
 *     def __init__(GenomicInterval self, str chrom, long start, long end,             # <<<<<<<<<<<<<<
 *                  str strand=strand_nostrand):
 *         """See the class docstring for the meaning of the slots. Note that
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval___init__, "See the class docstring for the meaning of the slots. Note that\n        there is also a factory function, 'from_directional', to be used if\n        you wish to specify start_d and length.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_5HTSeq_6_HTSeq_15GenomicInterval___init__;
#endif
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_chrom = 0;
  long __pyx_v_start;
  long __pyx_v_end;
  PyObject *__pyx_v_strand = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_chrom,&__pyx_mstate_global->__pyx_n_u_start,&__pyx_mstate_global->__pyx_n_u_end,&__pyx_mstate_global->__pyx_n_u_strand,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, 54, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 54, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 54, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 54, __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, 54, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 54, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k_);
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 54, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 54, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 54, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 54, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 54, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k_);
    }
    __pyx_v_chrom = ((PyObject*)values[0]);
    __pyx_v_start = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v_start == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
    __pyx_v_end = __Pyx_PyLong_As_long(values[2]); if (unlikely((__pyx_v_end == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
    __pyx_v_strand = ((PyObject*)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 54, __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("HTSeq._HTSeq.GenomicInterval.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 54, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 55, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_strand);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_chrom, long __pyx_v_start, long __pyx_v_end, PyObject *__pyx_v_strand) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":60
 *         you wish to specify start_d and length.
 *         """
 *         self.chrom = intern(chrom)             # <<<<<<<<<<<<<<
 *         self.start = start
 *         self.end = end
*/
  __pyx_t_1 = __Pyx_Intern(__pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->chrom);
  __Pyx_DECREF(__pyx_v_self->chrom);
  __pyx_v_self->chrom = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":61
 *         """
 *         self.chrom = intern(chrom)
 *         self.start = start             # <<<<<<<<<<<<<<
 *         self.end = end
 *         self.strand = strand
*/
  __pyx_v_self->start = __pyx_v_start;

  /* "HTSeq/_HTSeq.pyx":62
 *         self.chrom = intern(chrom)
 *         self.start = start
 *         self.end = end             # <<<<<<<<<<<<<<
 *         self.strand = strand
 *         if self.start > self.end:
*/
  __pyx_v_self->end = __pyx_v_end;

  /* "HTSeq/_HTSeq.pyx":63
 *         self.start = start
 *         self.end = end
 *         self.strand = strand             # <<<<<<<<<<<<<<
 *         if self.start > self.end:
 *             raise ValueError("start is larger than end")
*/
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand, __pyx_v_strand) < (0)) __PYX_ERR(0, 63, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":64
 *         self.end = end
 *         self.strand = strand
 *         if self.start > self.end:             # <<<<<<<<<<<<<<
 *             raise ValueError("start is larger than end")
 * 
*/
  __pyx_t_2 = (__pyx_v_self->start > __pyx_v_self->end);
  if (unlikely(__pyx_t_2)) {

    /* "HTSeq/_HTSeq.pyx":65
 *         self.strand = strand
 *         if self.start > self.end:
 *             raise ValueError("start is larger than end")             # <<<<<<<<<<<<<<
 * 
 *     property strand:
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_start_is_larger_than_end};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __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, 65, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":64
 *         self.end = end
 *         self.strand = strand
 *         if self.start > self.end:             # <<<<<<<<<<<<<<
 *             raise ValueError("start is larger than end")
 * 
*/
  }

  /* "HTSeq/_HTSeq.pyx":54
 *     """
 * 
 *     def __init__(GenomicInterval self, str chrom, long start, long end,             # <<<<<<<<<<<<<<
 *                  str strand=strand_nostrand):
 *         """See the class docstring for the meaning of the slots. Note that
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":68
 * 
 *     property strand:
 *         def __set__(self, strand):             # <<<<<<<<<<<<<<
 *             strand = intern(strand)
 *             if not(strand is strand_plus or strand is strand_minus or
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_strand); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_strand) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand___set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((PyObject *)__pyx_v_strand));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand___set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_strand) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_strand);

  /* "HTSeq/_HTSeq.pyx":69
 *     property strand:
 *         def __set__(self, strand):
 *             strand = intern(strand)             # <<<<<<<<<<<<<<
 *             if not(strand is strand_plus or strand is strand_minus or
 *                     strand is strand_nostrand):
*/
  __pyx_t_1 = __Pyx_Intern(__pyx_v_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_strand, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":70
 *         def __set__(self, strand):
 *             strand = intern(strand)
 *             if not(strand is strand_plus or strand is strand_minus or             # <<<<<<<<<<<<<<
 *                     strand is strand_nostrand):
 *                 raise ValueError("Strand must be'+', '-', or '.'.")
*/
  __pyx_t_3 = (__pyx_v_strand == __pyx_v_5HTSeq_6_HTSeq_strand_plus);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_strand == __pyx_v_5HTSeq_6_HTSeq_strand_minus);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "HTSeq/_HTSeq.pyx":71
 *             strand = intern(strand)
 *             if not(strand is strand_plus or strand is strand_minus or
 *                     strand is strand_nostrand):             # <<<<<<<<<<<<<<
 *                 raise ValueError("Strand must be'+', '-', or '.'.")
 *             self._strand = strand
*/
  __pyx_t_3 = (__pyx_v_strand == __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;

  /* "HTSeq/_HTSeq.pyx":70
 *         def __set__(self, strand):
 *             strand = intern(strand)
 *             if not(strand is strand_plus or strand is strand_minus or             # <<<<<<<<<<<<<<
 *                     strand is strand_nostrand):
 *                 raise ValueError("Strand must be'+', '-', or '.'.")
*/
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "HTSeq/_HTSeq.pyx":72
 *             if not(strand is strand_plus or strand is strand_minus or
 *                     strand is strand_nostrand):
 *                 raise ValueError("Strand must be'+', '-', or '.'.")             # <<<<<<<<<<<<<<
 *             self._strand = strand
 * 
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Strand_must_be_or};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __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, 72, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":70
 *         def __set__(self, strand):
 *             strand = intern(strand)
 *             if not(strand is strand_plus or strand is strand_minus or             # <<<<<<<<<<<<<<
 *                     strand is strand_nostrand):
 *                 raise ValueError("Strand must be'+', '-', or '.'.")
*/
  }

  /* "HTSeq/_HTSeq.pyx":73
 *                     strand is strand_nostrand):
 *                 raise ValueError("Strand must be'+', '-', or '.'.")
 *             self._strand = strand             # <<<<<<<<<<<<<<
 * 
 *         def __get__(self):
*/
  __pyx_t_1 = __pyx_v_strand;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_strand);
  __Pyx_DECREF(__pyx_v_self->_strand);
  __pyx_v_self->_strand = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":68
 * 
 *     property strand:
 *         def __set__(self, strand):             # <<<<<<<<<<<<<<
 *             strand = intern(strand)
 *             if not(strand is strand_plus or strand is strand_minus or
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.strand.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_strand);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":75
 *             self._strand = strand
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._strand
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_3__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_3__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand_2__get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6strand_2__get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":76
 * 
 *         def __get__(self):
 *             return self._strand             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(GenomicInterval self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_strand);
  __pyx_r = __pyx_v_self->_strand;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":75
 *             self._strand = strand
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._strand
 * 
*/

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

/* "HTSeq/_HTSeq.pyx":78
 *             return self._strand
 * 
 *     def __reduce__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *         return GenomicInterval, (self.chrom, self.start, self.end,
 *                                  self.strand)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__(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_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__(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__ (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__", 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__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_2__reduce__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_2__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "HTSeq/_HTSeq.pyx":79
 * 
 *     def __reduce__(GenomicInterval self):
 *         return GenomicInterval, (self.chrom, self.start, self.end,             # <<<<<<<<<<<<<<
 *                                  self.strand)
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "HTSeq/_HTSeq.pyx":80
 *     def __reduce__(GenomicInterval self):
 *         return GenomicInterval, (self.chrom, self.start, self.end,
 *                                  self.strand)             # <<<<<<<<<<<<<<
 * 
 *     def __copy__(self):
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "HTSeq/_HTSeq.pyx":79
 * 
 *     def __reduce__(GenomicInterval self):
 *         return GenomicInterval, (self.chrom, self.start, self.end,             # <<<<<<<<<<<<<<
 *                                  self.strand)
 * 
*/
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_v_self->chrom);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->chrom) != (0)) __PYX_ERR(0, 79, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 79, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2) != (0)) __PYX_ERR(0, 79, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3) != (0)) __PYX_ERR(0, 79, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval)) != (0)) __PYX_ERR(0, 79, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 79, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":78
 *             return self._strand
 * 
 *     def __reduce__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *         return GenomicInterval, (self.chrom, self.start, self.end,
 *                                  self.strand)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":82
 *                                  self.strand)
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
 *         constr, args = self.__reduce__()
 *         return constr(*args)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__(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_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__ = {"__copy__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__(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("__copy__ (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("__copy__", 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("__copy__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_4__copy__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_4__copy__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  PyObject *__pyx_v_constr = NULL;
  PyObject *__pyx_v_args = 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)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__copy__", 0);

  /* "HTSeq/_HTSeq.pyx":83
 * 
 *     def __copy__(self):
 *         constr, args = self.__reduce__()             # <<<<<<<<<<<<<<
 *         return constr(*args)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_reduce, __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, 83, __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, 83, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < (0)) __PYX_ERR(0, 83, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 83, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_constr = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_args = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":84
 *     def __copy__(self):
 *         constr, args = self.__reduce__()
 *         return constr(*args)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(GenomicInterval self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_constr, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":82
 *                                  self.strand)
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
 *         constr, args = self.__reduce__()
 *         return constr(*args)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_constr);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":86
 *         return constr(*args)
 * 
 *     def __repr__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *         return "<%s object '%s', [%d,%s), strand '%s'>" % \
 *             (self.__class__.__name__, self.chrom, self.start,
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9[11];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":87
 * 
 *     def __repr__(GenomicInterval self):
 *         return "<%s object '%s', [%d,%s), strand '%s'>" % \             # <<<<<<<<<<<<<<
 *             (self.__class__.__name__, self.chrom, self.start,
 *              str(self.end) if self.end != sys.maxsize else "Inf", self.strand)
*/
  __Pyx_XDECREF(__pyx_r);

  /* "HTSeq/_HTSeq.pyx":88
 *     def __repr__(GenomicInterval self):
 *         return "<%s object '%s', [%d,%s), strand '%s'>" % \
 *             (self.__class__.__name__, self.chrom, self.start,             # <<<<<<<<<<<<<<
 *              str(self.end) if self.end != sys.maxsize else "Inf", self.strand)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_self->chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyUnicode_From_long(__pyx_v_self->start, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "HTSeq/_HTSeq.pyx":89
 *         return "<%s object '%s', [%d,%s), strand '%s'>" % \
 *             (self.__class__.__name__, self.chrom, self.start,
 *              str(self.end) if self.end != sys.maxsize else "Inf", self.strand)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(GenomicInterval self):
*/
  __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {
    __pyx_t_6 = __Pyx_PyLong_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __pyx_t_7;
    __pyx_t_7 = 0;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Inf);
    __pyx_t_4 = __pyx_mstate_global->__pyx_n_u_Inf;
  }
  __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_4), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_9[1] = __pyx_t_1;
  __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_object;
  __pyx_t_9[3] = __pyx_t_2;
  __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_9[5] = __pyx_t_3;
  __pyx_t_9[6] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_9[7] = __pyx_t_7;
  __pyx_t_9[8] = __pyx_mstate_global->__pyx_kp_u_strand_2;
  __pyx_t_9[9] = __pyx_t_6;
  __pyx_t_9[10] = __pyx_mstate_global->__pyx_kp_u__5;

  /* "HTSeq/_HTSeq.pyx":87
 * 
 *     def __repr__(GenomicInterval self):
 *         return "<%s object '%s', [%d,%s), strand '%s'>" % \             # <<<<<<<<<<<<<<
 *             (self.__class__.__name__, self.chrom, self.start,
 *              str(self.end) if self.end != sys.maxsize else "Inf", self.strand)
*/
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_9, 11, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":86
 *         return constr(*args)
 * 
 *     def __repr__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *         return "<%s object '%s', [%d,%s), strand '%s'>" % \
 *             (self.__class__.__name__, self.chrom, self.start,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":91
 *              str(self.end) if self.end != sys.maxsize else "Inf", self.strand)
 * 
 *     def __str__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *         return "%s:[%d,%s)/%s" % \
 *             (self.chrom, self.start, str(self.end)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_9__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_9__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_8__str__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_8__str__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8[7];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "HTSeq/_HTSeq.pyx":92
 * 
 *     def __str__(GenomicInterval self):
 *         return "%s:[%d,%s)/%s" % \             # <<<<<<<<<<<<<<
 *             (self.chrom, self.start, str(self.end)
 *              if self.end != sys.maxsize else "Inf", self.strand)
*/
  __Pyx_XDECREF(__pyx_r);

  /* "HTSeq/_HTSeq.pyx":93
 *     def __str__(GenomicInterval self):
 *         return "%s:[%d,%s)/%s" % \
 *             (self.chrom, self.start, str(self.end)             # <<<<<<<<<<<<<<
 *              if self.end != sys.maxsize else "Inf", self.strand)
 * 
*/
  __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_self->chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_From_long(__pyx_v_self->start, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "HTSeq/_HTSeq.pyx":94
 *         return "%s:[%d,%s)/%s" % \
 *             (self.chrom, self.start, str(self.end)
 *              if self.end != sys.maxsize else "Inf", self.strand)             # <<<<<<<<<<<<<<
 * 
 *     property length:
*/
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_7) {

    /* "HTSeq/_HTSeq.pyx":93
 *     def __str__(GenomicInterval self):
 *         return "%s:[%d,%s)/%s" % \
 *             (self.chrom, self.start, str(self.end)             # <<<<<<<<<<<<<<
 *              if self.end != sys.maxsize else "Inf", self.strand)
 * 
*/
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __pyx_t_6;
    __pyx_t_6 = 0;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Inf);
    __pyx_t_3 = __pyx_mstate_global->__pyx_n_u_Inf;
  }
  __pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "HTSeq/_HTSeq.pyx":94
 *         return "%s:[%d,%s)/%s" % \
 *             (self.chrom, self.start, str(self.end)
 *              if self.end != sys.maxsize else "Inf", self.strand)             # <<<<<<<<<<<<<<
 * 
 *     property length:
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8[0] = __pyx_t_1;
  __pyx_t_8[1] = __pyx_mstate_global->__pyx_kp_u__6;
  __pyx_t_8[2] = __pyx_t_2;
  __pyx_t_8[3] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_8[4] = __pyx_t_6;
  __pyx_t_8[5] = __pyx_mstate_global->__pyx_kp_u__7;
  __pyx_t_8[6] = __pyx_t_5;

  /* "HTSeq/_HTSeq.pyx":92
 * 
 *     def __str__(GenomicInterval self):
 *         return "%s:[%d,%s)/%s" % \             # <<<<<<<<<<<<<<
 *             (self.chrom, self.start, str(self.end)
 *              if self.end != sys.maxsize else "Inf", self.strand)
*/
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_8, 7, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 2 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":91
 *              str(self.end) if self.end != sys.maxsize else "Inf", self.strand)
 * 
 *     def __str__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *         return "%s:[%d,%s)/%s" % \
 *             (self.chrom, self.start, str(self.end)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":102
 *         is '-', in which case 'start' is changed."""
 * 
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             return self.end - self.start
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":103
 * 
 *         def __get__(GenomicInterval self):
 *             return self.end - self.start             # <<<<<<<<<<<<<<
 * 
 *         def __set__(GenomicInterval self, long newLength):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_long((__pyx_v_self->end - __pyx_v_self->start)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":102
 *         is '-', in which case 'start' is changed."""
 * 
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             return self.end - self.start
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":105
 *             return self.end - self.start
 * 
 *         def __set__(GenomicInterval self, long newLength):             # <<<<<<<<<<<<<<
 *             if self._strand is not strand_minus:
 *                 self.end = self.start + newLength
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newLength); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newLength) {
  long __pyx_v_newLength;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_newLength); {
    __pyx_v_newLength = __Pyx_PyLong_As_long(__pyx_arg_newLength); if (unlikely((__pyx_v_newLength == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.length.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((long)__pyx_v_newLength));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_6length_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_newLength) {
  int __pyx_r;
  int __pyx_t_1;

  /* "HTSeq/_HTSeq.pyx":106
 * 
 *         def __set__(GenomicInterval self, long newLength):
 *             if self._strand is not strand_minus:             # <<<<<<<<<<<<<<
 *                 self.end = self.start + newLength
 *             else:
*/
  __pyx_t_1 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_minus);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":107
 *         def __set__(GenomicInterval self, long newLength):
 *             if self._strand is not strand_minus:
 *                 self.end = self.start + newLength             # <<<<<<<<<<<<<<
 *             else:
 *                 self.start = self.end - newLength
*/
    __pyx_v_self->end = (__pyx_v_self->start + __pyx_v_newLength);

    /* "HTSeq/_HTSeq.pyx":106
 * 
 *         def __set__(GenomicInterval self, long newLength):
 *             if self._strand is not strand_minus:             # <<<<<<<<<<<<<<
 *                 self.end = self.start + newLength
 *             else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":109
 *                 self.end = self.start + newLength
 *             else:
 *                 self.start = self.end - newLength             # <<<<<<<<<<<<<<
 * 
 *     property start_d:
*/
  /*else*/ {
    __pyx_v_self->start = (__pyx_v_self->end - __pyx_v_newLength);
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":105
 *             return self.end - self.start
 * 
 *         def __set__(GenomicInterval self, long newLength):             # <<<<<<<<<<<<<<
 *             if self._strand is not strand_minus:
 *                 self.end = self.start + newLength
*/

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

/* "HTSeq/_HTSeq.pyx":117
 *         length stays unchanged."""
 * 
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             if self._strand is not strand_minus:
 *                 return self.start
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":118
 * 
 *         def __get__(GenomicInterval self):
 *             if self._strand is not strand_minus:             # <<<<<<<<<<<<<<
 *                 return self.start
 *             else:
*/
  __pyx_t_1 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_minus);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":119
 *         def __get__(GenomicInterval self):
 *             if self._strand is not strand_minus:
 *                 return self.start             # <<<<<<<<<<<<<<
 *             else:
 *                 return self.end - 1
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyLong_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":118
 * 
 *         def __get__(GenomicInterval self):
 *             if self._strand is not strand_minus:             # <<<<<<<<<<<<<<
 *                 return self.start
 *             else:
*/
  }

  /* "HTSeq/_HTSeq.pyx":121
 *                 return self.start
 *             else:
 *                 return self.end - 1             # <<<<<<<<<<<<<<
 * 
 *         def __set__(GenomicInterval self, long newStartd):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyLong_From_long((__pyx_v_self->end - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":117
 *         length stays unchanged."""
 * 
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             if self._strand is not strand_minus:
 *                 return self.start
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start_d.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":123
 *                 return self.end - 1
 * 
 *         def __set__(GenomicInterval self, long newStartd):             # <<<<<<<<<<<<<<
 *             if self._strand is not strand_minus:
 *                 self.end = newStartd + self.length
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newStartd); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newStartd) {
  long __pyx_v_newStartd;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_newStartd); {
    __pyx_v_newStartd = __Pyx_PyLong_As_long(__pyx_arg_newStartd); if (unlikely((__pyx_v_newStartd == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start_d.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((long)__pyx_v_newStartd));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_newStartd) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "HTSeq/_HTSeq.pyx":124
 * 
 *         def __set__(GenomicInterval self, long newStartd):
 *             if self._strand is not strand_minus:             # <<<<<<<<<<<<<<
 *                 self.end = newStartd + self.length
 *                 self.start = newStartd
*/
  __pyx_t_1 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_minus);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":125
 *         def __set__(GenomicInterval self, long newStartd):
 *             if self._strand is not strand_minus:
 *                 self.end = newStartd + self.length             # <<<<<<<<<<<<<<
 *                 self.start = newStartd
 *             else:
*/
    __pyx_t_2 = __Pyx_PyLong_From_long(__pyx_v_newStartd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyLong_As_long(__pyx_t_4); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_self->end = __pyx_t_5;

    /* "HTSeq/_HTSeq.pyx":126
 *             if self._strand is not strand_minus:
 *                 self.end = newStartd + self.length
 *                 self.start = newStartd             # <<<<<<<<<<<<<<
 *             else:
 *                 self.start = newStartd + 1 - self.length
*/
    __pyx_v_self->start = __pyx_v_newStartd;

    /* "HTSeq/_HTSeq.pyx":124
 * 
 *         def __set__(GenomicInterval self, long newStartd):
 *             if self._strand is not strand_minus:             # <<<<<<<<<<<<<<
 *                 self.end = newStartd + self.length
 *                 self.start = newStartd
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":128
 *                 self.start = newStartd
 *             else:
 *                 self.start = newStartd + 1 - self.length             # <<<<<<<<<<<<<<
 *                 self.end = newStartd + 1
 * 
*/
  /*else*/ {
    __pyx_t_4 = __Pyx_PyLong_From_long((__pyx_v_newStartd + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyLong_As_long(__pyx_t_2); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->start = __pyx_t_5;

    /* "HTSeq/_HTSeq.pyx":129
 *             else:
 *                 self.start = newStartd + 1 - self.length
 *                 self.end = newStartd + 1             # <<<<<<<<<<<<<<
 * 
 *     property end_d:
*/
    __pyx_v_self->end = (__pyx_v_newStartd + 1);
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":123
 *                 return self.end - 1
 * 
 *         def __set__(GenomicInterval self, long newStartd):             # <<<<<<<<<<<<<<
 *             if self._strand is not strand_minus:
 *                 self.end = newStartd + self.length
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start_d.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":133
 *     property end_d:
 * 
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             if self._strand is not strand_minus:
 *                 return self.end
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5end_d_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5end_d_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5end_d___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5end_d___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":134
 * 
 *         def __get__(GenomicInterval self):
 *             if self._strand is not strand_minus:             # <<<<<<<<<<<<<<
 *                 return self.end
 *             else:
*/
  __pyx_t_1 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_minus);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":135
 *         def __get__(GenomicInterval self):
 *             if self._strand is not strand_minus:
 *                 return self.end             # <<<<<<<<<<<<<<
 *             else:
 *                 return self.start - 1
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyLong_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":134
 * 
 *         def __get__(GenomicInterval self):
 *             if self._strand is not strand_minus:             # <<<<<<<<<<<<<<
 *                 return self.end
 *             else:
*/
  }

  /* "HTSeq/_HTSeq.pyx":137
 *                 return self.end
 *             else:
 *                 return self.start - 1             # <<<<<<<<<<<<<<
 * 
 *     property start_as_pos:
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyLong_From_long((__pyx_v_self->start - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":133
 *     property end_d:
 * 
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             if self._strand is not strand_minus:
 *                 return self.end
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.end_d.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":140
 * 
 *     property start_as_pos:
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             return GenomicPosition(self.chrom, self.start, self. strand)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":141
 *     property start_as_pos:
 *         def __get__(GenomicInterval self):
 *             return GenomicPosition(self.chrom, self.start, self. strand)             # <<<<<<<<<<<<<<
 * 
 *     property end_as_pos:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_self->chrom, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":140
 * 
 *     property start_as_pos:
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             return GenomicPosition(self.chrom, self.start, self. strand)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start_as_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":144
 * 
 *     property end_as_pos:
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             return GenomicPosition(self.chrom, self.end, self. strand)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":145
 *     property end_as_pos:
 *         def __get__(GenomicInterval self):
 *             return GenomicPosition(self.chrom, self.end, self. strand)             # <<<<<<<<<<<<<<
 * 
 *     property start_d_as_pos:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_self->chrom, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":144
 * 
 *     property end_as_pos:
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             return GenomicPosition(self.chrom, self.end, self. strand)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.end_as_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":148
 * 
 *     property start_d_as_pos:
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             return GenomicPosition(self.chrom, self.start_d, self. strand)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":149
 *     property start_d_as_pos:
 *         def __get__(GenomicInterval self):
 *             return GenomicPosition(self.chrom, self.start_d, self. strand)             # <<<<<<<<<<<<<<
 * 
 *     property end_d_as_pos:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_start_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_self->chrom, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":148
 * 
 *     property start_d_as_pos:
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             return GenomicPosition(self.chrom, self.start_d, self. strand)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start_d_as_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":152
 * 
 *     property end_d_as_pos:
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             return GenomicPosition(self.chrom, self.end_d, self. strand)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":153
 *     property end_d_as_pos:
 *         def __get__(GenomicInterval self):
 *             return GenomicPosition(self.chrom, self.end_d, self. strand)             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_end_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_self->chrom, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":152
 * 
 *     property end_d_as_pos:
 *         def __get__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *             return GenomicPosition(self.chrom, self.end_d, self. strand)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.end_d_as_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":155
 *             return GenomicPosition(self.chrom, self.end_d, self. strand)
 * 
 *     def __richcmp__(GenomicInterval self, GenomicInterval other, int op):             # <<<<<<<<<<<<<<
 *         if op == 2:  # ==
 *             if other == None:
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_11__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_11__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "other", 0))) __PYX_ERR(0, 155, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10__richcmp__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_other), ((int)__pyx_v_op));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_10__richcmp__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "HTSeq/_HTSeq.pyx":156
 * 
 *     def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
 *         if op == 2:  # ==             # <<<<<<<<<<<<<<
 *             if other == None:
 *                 return False
*/
  switch (__pyx_v_op) {
    case 2:

    /* "HTSeq/_HTSeq.pyx":157
 *     def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
 *         if op == 2:  # ==
 *             if other == None:             # <<<<<<<<<<<<<<
 *                 return False
 *             return self._strand is other._strand and \
*/
    __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_other), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "HTSeq/_HTSeq.pyx":158
 *         if op == 2:  # ==
 *             if other == None:
 *                 return False             # <<<<<<<<<<<<<<
 *             return self._strand is other._strand and \
 *                 self.start == other.start and self.end == other.end
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":157
 *     def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
 *         if op == 2:  # ==
 *             if other == None:             # <<<<<<<<<<<<<<
 *                 return False
 *             return self._strand is other._strand and \
*/
    }

    /* "HTSeq/_HTSeq.pyx":159
 *             if other == None:
 *                 return False
 *             return self._strand is other._strand and \             # <<<<<<<<<<<<<<
 *                 self.start == other.start and self.end == other.end
 *         elif op == 3:  # !=
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = (__pyx_v_self->_strand == __pyx_v_other->_strand);
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L4_bool_binop_done;
    }

    /* "HTSeq/_HTSeq.pyx":160
 *                 return False
 *             return self._strand is other._strand and \
 *                 self.start == other.start and self.end == other.end             # <<<<<<<<<<<<<<
 *         elif op == 3:  # !=
 *             return not (self == other)
*/
    __pyx_t_2 = (__pyx_v_self->start == __pyx_v_other->start);
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->end == __pyx_v_other->end);
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_L4_bool_binop_done:;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":156
 * 
 *     def __richcmp__(GenomicInterval self, GenomicInterval other, int op):
 *         if op == 2:  # ==             # <<<<<<<<<<<<<<
 *             if other == None:
 *                 return False
*/
    break;
    case 3:

    /* "HTSeq/_HTSeq.pyx":162
 *                 self.start == other.start and self.end == other.end
 *         elif op == 3:  # !=
 *             return not (self == other)             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplementedError
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 162, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":161
 *             return self._strand is other._strand and \
 *                 self.start == other.start and self.end == other.end
 *         elif op == 3:  # !=             # <<<<<<<<<<<<<<
 *             return not (self == other)
 *         else:
*/
    break;
    default:

    /* "HTSeq/_HTSeq.pyx":164
 *             return not (self == other)
 *         else:
 *             raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(GenomicInterval self):
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
    __PYX_ERR(0, 164, __pyx_L1_error)
    break;
  }

  /* "HTSeq/_HTSeq.pyx":155
 *             return GenomicPosition(self.chrom, self.end_d, self. strand)
 * 
 *     def __richcmp__(GenomicInterval self, GenomicInterval other, int op):             # <<<<<<<<<<<<<<
 *         if op == 2:  # ==
 *             if other == None:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":166
 *             raise NotImplementedError
 * 
 *     def __hash__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *         return hash((self.chrom, self.start, self.end, self.strand))
 * 
*/

/* Python wrapper */
static Py_hash_t __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_13__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_13__hash__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12__hash__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static Py_hash_t __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_12__hash__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_hash_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "HTSeq/_HTSeq.pyx":167
 * 
 *     def __hash__(GenomicInterval self):
 *         return hash((self.chrom, self.start, self.end, self.strand))             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_contained_in(GenomicInterval self, GenomicInterval iv):
*/
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->chrom);
  __Pyx_GIVEREF(__pyx_v_self->chrom);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->chrom) != (0)) __PYX_ERR(0, 167, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 167, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2) != (0)) __PYX_ERR(0, 167, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3) != (0)) __PYX_ERR(0, 167, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_5 = PyObject_Hash(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_hash_t)-1))) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":166
 *             raise NotImplementedError
 * 
 *     def __hash__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *         return hash((self.chrom, self.start, self.end, self.strand))
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":169
 *         return hash((self.chrom, self.start, self.end, self.strand))
 * 
 *     cpdef is_contained_in(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Returns a boolean value indicating whether the 'self' interval
 *         is fully within the 'iv' interval.
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_is_contained_in(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_contained_in", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_is_contained_in); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_iv)};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":180
 *           - self.end <= iv.end
 *         """
 *         if iv == None:             # <<<<<<<<<<<<<<
 *             return False
 *         if self.chrom != iv.chrom:
*/
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":181
 *         """
 *         if iv == None:
 *             return False             # <<<<<<<<<<<<<<
 *         if self.chrom != iv.chrom:
 *             return False
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":180
 *           - self.end <= iv.end
 *         """
 *         if iv == None:             # <<<<<<<<<<<<<<
 *             return False
 *         if self.chrom != iv.chrom:
*/
  }

  /* "HTSeq/_HTSeq.pyx":182
 *         if iv == None:
 *             return False
 *         if self.chrom != iv.chrom:             # <<<<<<<<<<<<<<
 *             return False
 *         if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_self->chrom, __pyx_v_iv->chrom, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 182, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":183
 *             return False
 *         if self.chrom != iv.chrom:
 *             return False             # <<<<<<<<<<<<<<
 *         if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \
 *                 self.strand is not iv._strand:
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":182
 *         if iv == None:
 *             return False
 *         if self.chrom != iv.chrom:             # <<<<<<<<<<<<<<
 *             return False
 *         if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
  }

  /* "HTSeq/_HTSeq.pyx":184
 *         if self.chrom != iv.chrom:
 *             return False
 *         if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                 self.strand is not iv._strand:
 *             return False
*/
  __pyx_t_7 = (__pyx_v_self->_strand != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }

  /* "HTSeq/_HTSeq.pyx":185
 *             return False
 *         if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \
 *                 self.strand is not iv._strand:             # <<<<<<<<<<<<<<
 *             return False
 *         if self.start < iv.start or self.end > iv.end:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__pyx_t_1 != __pyx_v_iv->_strand);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;

  /* "HTSeq/_HTSeq.pyx":184
 *         if self.chrom != iv.chrom:
 *             return False
 *         if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                 self.strand is not iv._strand:
 *             return False
*/
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":186
 *         if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \
 *                 self.strand is not iv._strand:
 *             return False             # <<<<<<<<<<<<<<
 *         if self.start < iv.start or self.end > iv.end:
 *             return False
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":184
 *         if self.chrom != iv.chrom:
 *             return False
 *         if self._strand is not strand_nostrand and iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                 self.strand is not iv._strand:
 *             return False
*/
  }

  /* "HTSeq/_HTSeq.pyx":187
 *                 self.strand is not iv._strand:
 *             return False
 *         if self.start < iv.start or self.end > iv.end:             # <<<<<<<<<<<<<<
 *             return False
 *         return True
*/
  __pyx_t_7 = (__pyx_v_self->start < __pyx_v_iv->start);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_self->end > __pyx_v_iv->end);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":188
 *             return False
 *         if self.start < iv.start or self.end > iv.end:
 *             return False             # <<<<<<<<<<<<<<
 *         return True
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":187
 *                 self.strand is not iv._strand:
 *             return False
 *         if self.start < iv.start or self.end > iv.end:             # <<<<<<<<<<<<<<
 *             return False
 *         return True
*/
  }

  /* "HTSeq/_HTSeq.pyx":189
 *         if self.start < iv.start or self.end > iv.end:
 *             return False
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     cpdef contains(GenomicInterval self, GenomicInterval iv):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":169
 *         return hash((self.chrom, self.start, self.end, self.strand))
 * 
 *     cpdef is_contained_in(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Returns a boolean value indicating whether the 'self' interval
 *         is fully within the 'iv' interval.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.is_contained_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in, "Returns a boolean value indicating whether the 'self' interval\n        is fully within the 'iv' interval.\n\n        This is deemed the case if\007\n          - both are on the same chromosome, and\n          - both are on the same strand, or at least one of them is\n             not stranded (i.e., has strand == '.'), and\n          - self.start >= iv.start, and\n          - self.end <= iv.end\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in = {"is_contained_in", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 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("is_contained_in (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iv,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, 169, __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, 169, __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, "is_contained_in", 0) < (0)) __PYX_ERR(0, 169, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_contained_in", 1, 1, 1, i); __PYX_ERR(0, 169, __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, 169, __pyx_L3_error)
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_contained_in", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 169, __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("HTSeq._HTSeq.GenomicInterval.is_contained_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 169, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), __pyx_v_iv);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_14is_contained_in(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_contained_in", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_is_contained_in(__pyx_v_self, __pyx_v_iv, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.is_contained_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":191
 *         return True
 * 
 *     cpdef contains(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Returns a boolean value indicating whether the 'self' interval
 *         fully contains the 'iv' interval.
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_contains(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("contains", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_contains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_iv)};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":197
 *         See 'is_contained_in' for the exact criteria.
 *         """
 *         if iv == None:             # <<<<<<<<<<<<<<
 *             return False
 *         return iv.is_contained_in(self)
*/
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":198
 *         """
 *         if iv == None:
 *             return False             # <<<<<<<<<<<<<<
 *         return iv.is_contained_in(self)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":197
 *         See 'is_contained_in' for the exact criteria.
 *         """
 *         if iv == None:             # <<<<<<<<<<<<<<
 *             return False
 *         return iv.is_contained_in(self)
*/
  }

  /* "HTSeq/_HTSeq.pyx":199
 *         if iv == None:
 *             return False
 *         return iv.is_contained_in(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef overlaps(GenomicInterval self, GenomicInterval iv):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_iv->__pyx_vtab)->is_contained_in(__pyx_v_iv, __pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":191
 *         return True
 * 
 *     cpdef contains(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Returns a boolean value indicating whether the 'self' interval
 *         fully contains the 'iv' interval.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains(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_5HTSeq_6_HTSeq_15GenomicInterval_16contains, "Returns a boolean value indicating whether the 'self' interval\n        fully contains the 'iv' interval.\n\n        See 'is_contained_in' for the exact criteria.\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_17contains = {"contains", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_16contains};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_17contains(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 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("contains (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_iv,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, 191, __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, 191, __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, "contains", 0) < (0)) __PYX_ERR(0, 191, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("contains", 1, 1, 1, i); __PYX_ERR(0, 191, __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, 191, __pyx_L3_error)
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("contains", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 191, __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("HTSeq._HTSeq.GenomicInterval.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 191, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_16contains(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), __pyx_v_iv);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_16contains(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
  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("contains", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_contains(__pyx_v_self, __pyx_v_iv, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":201
 *         return iv.is_contained_in(self)
 * 
 *     cpdef overlaps(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Returns a boolean value indicating whether the 'self' interval
 *         overlaps the 'iv' interval.
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_overlaps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("overlaps", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_overlaps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_iv)};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":211
 *           - the actual intervals overlap
 *         """
 *         if iv == None:             # <<<<<<<<<<<<<<
 *             return False
 *         if self.chrom != iv.chrom:
*/
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":212
 *         """
 *         if iv == None:
 *             return False             # <<<<<<<<<<<<<<
 *         if self.chrom != iv.chrom:
 *             return False
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":211
 *           - the actual intervals overlap
 *         """
 *         if iv == None:             # <<<<<<<<<<<<<<
 *             return False
 *         if self.chrom != iv.chrom:
*/
  }

  /* "HTSeq/_HTSeq.pyx":213
 *         if iv == None:
 *             return False
 *         if self.chrom != iv.chrom:             # <<<<<<<<<<<<<<
 *             return False
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_self->chrom, __pyx_v_iv->chrom, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 213, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":214
 *             return False
 *         if self.chrom != iv.chrom:
 *             return False             # <<<<<<<<<<<<<<
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
 *                 self.strand is not iv.strand:
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":213
 *         if iv == None:
 *             return False
 *         if self.chrom != iv.chrom:             # <<<<<<<<<<<<<<
 *             return False
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
  }

  /* "HTSeq/_HTSeq.pyx":215
 *         if self.chrom != iv.chrom:
 *             return False
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                 self.strand is not iv.strand:
 *             return False
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }

  /* "HTSeq/_HTSeq.pyx":216
 *             return False
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
 *                 self.strand is not iv.strand:             # <<<<<<<<<<<<<<
 *             return False
 *         if self.start <= iv.start:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = (__pyx_t_1 != __pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;

  /* "HTSeq/_HTSeq.pyx":215
 *         if self.chrom != iv.chrom:
 *             return False
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                 self.strand is not iv.strand:
 *             return False
*/
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":217
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
 *                 self.strand is not iv.strand:
 *             return False             # <<<<<<<<<<<<<<
 *         if self.start <= iv.start:
 *             return self.end > iv.start
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":215
 *         if self.chrom != iv.chrom:
 *             return False
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                 self.strand is not iv.strand:
 *             return False
*/
  }

  /* "HTSeq/_HTSeq.pyx":218
 *                 self.strand is not iv.strand:
 *             return False
 *         if self.start <= iv.start:             # <<<<<<<<<<<<<<
 *             return self.end > iv.start
 *         else:
*/
  __pyx_t_6 = (__pyx_v_self->start <= __pyx_v_iv->start);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":219
 *             return False
 *         if self.start <= iv.start:
 *             return self.end > iv.start             # <<<<<<<<<<<<<<
 *         else:
 *             return iv.end > self.start
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->end > __pyx_v_iv->start)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":218
 *                 self.strand is not iv.strand:
 *             return False
 *         if self.start <= iv.start:             # <<<<<<<<<<<<<<
 *             return self.end > iv.start
 *         else:
*/
  }

  /* "HTSeq/_HTSeq.pyx":221
 *             return self.end > iv.start
 *         else:
 *             return iv.end > self.start             # <<<<<<<<<<<<<<
 * 
 *     def range(GenomicInterval self, long int step=1):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_iv->end > __pyx_v_self->start)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":201
 *         return iv.is_contained_in(self)
 * 
 *     cpdef overlaps(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Returns a boolean value indicating whether the 'self' interval
 *         overlaps the 'iv' interval.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.overlaps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps(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_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps, "Returns a boolean value indicating whether the 'self' interval\n        overlaps the 'iv' interval.\n\n        This is deemed the case if\n          - both are on the same chromosome, and\n          - both are on the same strand, or at least one of them is\n             not stranded (i.e., has strand == '.'), and\n          - the actual intervals overlap\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps = {"overlaps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 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("overlaps (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_iv,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, 201, __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, 201, __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, "overlaps", 0) < (0)) __PYX_ERR(0, 201, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("overlaps", 1, 1, 1, i); __PYX_ERR(0, 201, __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, 201, __pyx_L3_error)
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("overlaps", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 201, __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("HTSeq._HTSeq.GenomicInterval.overlaps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 201, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), __pyx_v_iv);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_18overlaps(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
  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("overlaps", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_overlaps(__pyx_v_self, __pyx_v_iv, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.overlaps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":223
 *             return iv.end > self.start
 * 
 *     def range(GenomicInterval self, long int step=1):             # <<<<<<<<<<<<<<
 *         """Generate an iterator over the GenomicPositions covered by the interval,
 *         running from start to end.
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_21range(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_5HTSeq_6_HTSeq_15GenomicInterval_20range, "Generate an iterator over the GenomicPositions covered by the interval,\n        running from start to end.\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_21range = {"range", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_21range, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_20range};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_21range(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
) {
  long __pyx_v_step;
  #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("range (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_step,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, 223, __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, 223, __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, "range", 0) < (0)) __PYX_ERR(0, 223, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 223, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_step = __Pyx_PyLong_As_long(values[0]); if (unlikely((__pyx_v_step == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L3_error)
    } else {
      __pyx_v_step = ((long)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("range", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 223, __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("HTSeq._HTSeq.GenomicInterval.range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_20range(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), __pyx_v_step);

  /* 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_5HTSeq_6_HTSeq_15GenomicInterval_20range(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("range", 0);

  /* "HTSeq/_HTSeq.pyx":227
 *         running from start to end.
 *         """
 *         return _HTSeq_internal.GenomicInterval_range(self, step)             # <<<<<<<<<<<<<<
 * 
 *     def range_d(GenomicInterval self, long int step=1):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_HTSeq_internal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_GenomicInterval_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":223
 *             return iv.end > self.start
 * 
 *     def range(GenomicInterval self, long int step=1):             # <<<<<<<<<<<<<<
 *         """Generate an iterator over the GenomicPositions covered by the interval,
 *         running from start to end.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":229
 *         return _HTSeq_internal.GenomicInterval_range(self, step)
 * 
 *     def range_d(GenomicInterval self, long int step=1):             # <<<<<<<<<<<<<<
 *         """Generate an iterator over the GenomicPositions covered by the interval.
 *         running from start_d to end_d.
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_23range_d(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_5HTSeq_6_HTSeq_15GenomicInterval_22range_d, "Generate an iterator over the GenomicPositions covered by the interval.\n        running from start_d to end_d.\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_23range_d = {"range_d", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_23range_d, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_22range_d};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_23range_d(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
) {
  long __pyx_v_step;
  #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("range_d (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_step,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, 229, __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, 229, __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, "range_d", 0) < (0)) __PYX_ERR(0, 229, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 229, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_step = __Pyx_PyLong_As_long(values[0]); if (unlikely((__pyx_v_step == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L3_error)
    } else {
      __pyx_v_step = ((long)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("range_d", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 229, __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("HTSeq._HTSeq.GenomicInterval.range_d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_22range_d(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), __pyx_v_step);

  /* 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_5HTSeq_6_HTSeq_15GenomicInterval_22range_d(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, long __pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("range_d", 0);

  /* "HTSeq/_HTSeq.pyx":233
 *         running from start_d to end_d.
 *         """
 *         return _HTSeq_internal.GenomicInterval_ranged(self, step)             # <<<<<<<<<<<<<<
 * 
 *     cpdef extend_to_include(GenomicInterval self, GenomicInterval iv):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_HTSeq_internal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_GenomicInterval_ranged); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":229
 *         return _HTSeq_internal.GenomicInterval_range(self, step)
 * 
 *     def range_d(GenomicInterval self, long int step=1):             # <<<<<<<<<<<<<<
 *         """Generate an iterator over the GenomicPositions covered by the interval.
 *         running from start_d to end_d.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.range_d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":235
 *         return _HTSeq_internal.GenomicInterval_ranged(self, step)
 * 
 *     cpdef extend_to_include(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Extend the interval such that it includes iv."""
 *         if iv is None:
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_extend_to_include(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  long __pyx_t_9;
  long __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extend_to_include", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_extend_to_include); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_iv)};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":237
 *     cpdef extend_to_include(GenomicInterval self, GenomicInterval iv):
 *         """Extend the interval such that it includes iv."""
 *         if iv is None:             # <<<<<<<<<<<<<<
 *             raise TypeError("Cannot extend an interval to include None.")
 *         if self.chrom != iv.chrom:
*/
  __pyx_t_6 = (((PyObject *)__pyx_v_iv) == Py_None);
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":238
 *         """Extend the interval such that it includes iv."""
 *         if iv is None:
 *             raise TypeError("Cannot extend an interval to include None.")             # <<<<<<<<<<<<<<
 *         if self.chrom != iv.chrom:
 *             raise ValueError("Cannot extend an interval to include an interval on another chromosome.")
*/
    __pyx_t_2 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Cannot_extend_an_interval_to_inc};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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_1)) __PYX_ERR(0, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 238, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":237
 *     cpdef extend_to_include(GenomicInterval self, GenomicInterval iv):
 *         """Extend the interval such that it includes iv."""
 *         if iv is None:             # <<<<<<<<<<<<<<
 *             raise TypeError("Cannot extend an interval to include None.")
 *         if self.chrom != iv.chrom:
*/
  }

  /* "HTSeq/_HTSeq.pyx":239
 *         if iv is None:
 *             raise TypeError("Cannot extend an interval to include None.")
 *         if self.chrom != iv.chrom:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot extend an interval to include an interval on another chromosome.")
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_self->chrom, __pyx_v_iv->chrom, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 239, __pyx_L1_error)
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":240
 *             raise TypeError("Cannot extend an interval to include None.")
 *         if self.chrom != iv.chrom:
 *             raise ValueError("Cannot extend an interval to include an interval on another chromosome.")             # <<<<<<<<<<<<<<
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
 *                 self.strand is not iv.strand:
*/
    __pyx_t_2 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Cannot_extend_an_interval_to_inc_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __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, 240, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":239
 *         if iv is None:
 *             raise TypeError("Cannot extend an interval to include None.")
 *         if self.chrom != iv.chrom:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot extend an interval to include an interval on another chromosome.")
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
*/
  }

  /* "HTSeq/_HTSeq.pyx":241
 *         if self.chrom != iv.chrom:
 *             raise ValueError("Cannot extend an interval to include an interval on another chromosome.")
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                 self.strand is not iv.strand:
 *             raise ValueError("Cannot extend an interval to include an interval on another strand.")
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__pyx_t_1 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }

  /* "HTSeq/_HTSeq.pyx":242
 *             raise ValueError("Cannot extend an interval to include an interval on another chromosome.")
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
 *                 self.strand is not iv.strand:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot extend an interval to include an interval on another strand.")
 *         self.start = min(self.start, iv.start)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = (__pyx_t_1 != __pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;

  /* "HTSeq/_HTSeq.pyx":241
 *         if self.chrom != iv.chrom:
 *             raise ValueError("Cannot extend an interval to include an interval on another chromosome.")
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                 self.strand is not iv.strand:
 *             raise ValueError("Cannot extend an interval to include an interval on another strand.")
*/
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":243
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \
 *                 self.strand is not iv.strand:
 *             raise ValueError("Cannot extend an interval to include an interval on another strand.")             # <<<<<<<<<<<<<<
 *         self.start = min(self.start, iv.start)
 *         self.end = max(self.end, iv.end)
*/
    __pyx_t_1 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Cannot_extend_an_interval_to_inc_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __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, 243, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":241
 *         if self.chrom != iv.chrom:
 *             raise ValueError("Cannot extend an interval to include an interval on another chromosome.")
 *         if self.strand is not strand_nostrand and iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                 self.strand is not iv.strand:
 *             raise ValueError("Cannot extend an interval to include an interval on another strand.")
*/
  }

  /* "HTSeq/_HTSeq.pyx":244
 *                 self.strand is not iv.strand:
 *             raise ValueError("Cannot extend an interval to include an interval on another strand.")
 *         self.start = min(self.start, iv.start)             # <<<<<<<<<<<<<<
 *         self.end = max(self.end, iv.end)
 * 
*/
  __pyx_t_8 = __pyx_v_iv->start;
  __pyx_t_9 = __pyx_v_self->start;
  __pyx_t_6 = (__pyx_t_8 < __pyx_t_9);
  if (__pyx_t_6) {
    __pyx_t_10 = __pyx_t_8;
  } else {
    __pyx_t_10 = __pyx_t_9;
  }
  __pyx_v_self->start = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":245
 *             raise ValueError("Cannot extend an interval to include an interval on another strand.")
 *         self.start = min(self.start, iv.start)
 *         self.end = max(self.end, iv.end)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
*/
  __pyx_t_10 = __pyx_v_iv->end;
  __pyx_t_8 = __pyx_v_self->end;
  __pyx_t_6 = (__pyx_t_10 > __pyx_t_8);
  if (__pyx_t_6) {
    __pyx_t_9 = __pyx_t_10;
  } else {
    __pyx_t_9 = __pyx_t_8;
  }
  __pyx_v_self->end = __pyx_t_9;

  /* "HTSeq/_HTSeq.pyx":235
 *         return _HTSeq_internal.GenomicInterval_ranged(self, step)
 * 
 *     cpdef extend_to_include(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Extend the interval such that it includes iv."""
 *         if iv is None:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.extend_to_include", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include(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_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include, "Extend the interval such that it includes iv.");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include = {"extend_to_include", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 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("extend_to_include (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_iv,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, 235, __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, 235, __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, "extend_to_include", 0) < (0)) __PYX_ERR(0, 235, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("extend_to_include", 1, 1, 1, i); __PYX_ERR(0, 235, __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, 235, __pyx_L3_error)
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extend_to_include", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 235, __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("HTSeq._HTSeq.GenomicInterval.extend_to_include", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 235, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), __pyx_v_iv);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_24extend_to_include(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
  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("extend_to_include", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_extend_to_include(__pyx_v_self, __pyx_v_iv, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.extend_to_include", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":247
 *         self.end = max(self.end, iv.end)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         return GenomicInterval(self.chrom, self.start, self.end, self.strand)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_27copy(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_5HTSeq_6_HTSeq_15GenomicInterval_27copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_27copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_27copy(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("copy (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("copy", 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("copy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_26copy(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":248
 * 
 *     def copy(self):
 *         return GenomicInterval(self.chrom, self.start, self.end, self.strand)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_self->chrom, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":247
 *         self.end = max(self.end, iv.end)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         return GenomicInterval(self.chrom, self.start, self.end, self.strand)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":5
 * cdef class GenomicInterval:
 * 
 *    cdef public str chrom             # <<<<<<<<<<<<<<
 *    cdef public long start
 *    cdef public long end
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->chrom);
  __pyx_r = __pyx_v_self->chrom;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->chrom);
  __Pyx_DECREF(__pyx_v_self->chrom);
  __pyx_v_self->chrom = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.chrom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->chrom);
  __Pyx_DECREF(__pyx_v_self->chrom);
  __pyx_v_self->chrom = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pxd":6
 * 
 *    cdef public str chrom
 *    cdef public long start             # <<<<<<<<<<<<<<
 *    cdef public long end
 *    cdef str _strand
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_5start_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  long __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 6, __pyx_L1_error)
  __pyx_v_self->start = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":7
 *    cdef public str chrom
 *    cdef public long start
 *    cdef public long end             # <<<<<<<<<<<<<<
 *    cdef str _strand
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v_self->end); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicInterval_3end_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  long __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 7, __pyx_L1_error)
  __pyx_v_self->end = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval.end.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":251
 * 
 * 
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):             # <<<<<<<<<<<<<<
 *     strand = intern(strand)
 *     if strand != strand_minus:
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_1GenomicInterval_from_directional(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_5HTSeq_6_HTSeq_1GenomicInterval_from_directional = {"GenomicInterval_from_directional", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_1GenomicInterval_from_directional, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_1GenomicInterval_from_directional(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_chrom = 0;
  long __pyx_v_start_d;
  long __pyx_v_length;
  PyObject *__pyx_v_strand = 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("GenomicInterval_from_directional (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_chrom,&__pyx_mstate_global->__pyx_n_u_start_d,&__pyx_mstate_global->__pyx_n_u_length,&__pyx_mstate_global->__pyx_n_u_strand,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, 251, __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, 251, __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, 251, __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, 251, __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, 251, __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, "GenomicInterval_from_directional", 0) < (0)) __PYX_ERR(0, 251, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u__8)));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("GenomicInterval_from_directional", 0, 3, 4, i); __PYX_ERR(0, 251, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 251, __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, 251, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 251, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 251, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u__8)));
    }
    __pyx_v_chrom = ((PyObject*)values[0]);
    __pyx_v_start_d = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v_start_d == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error)
    __pyx_v_length = __Pyx_PyLong_As_long(values[2]); if (unlikely((__pyx_v_length == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error)
    __pyx_v_strand = ((PyObject*)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("GenomicInterval_from_directional", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 251, __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("HTSeq._HTSeq.GenomicInterval_from_directional", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 251, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 251, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_GenomicInterval_from_directional(__pyx_self, __pyx_v_chrom, __pyx_v_start_d, __pyx_v_length, __pyx_v_strand);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_GenomicInterval_from_directional(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chrom, long __pyx_v_start_d, long __pyx_v_length, PyObject *__pyx_v_strand) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GenomicInterval_from_directional", 0);
  __Pyx_INCREF(__pyx_v_strand);

  /* "HTSeq/_HTSeq.pyx":252
 * 
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):
 *     strand = intern(strand)             # <<<<<<<<<<<<<<
 *     if strand != strand_minus:
 *         return GenomicInterval(chrom, start_d, start_d + length, strand)
*/
  __pyx_t_1 = __Pyx_Intern(__pyx_v_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_strand, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":253
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):
 *     strand = intern(strand)
 *     if strand != strand_minus:             # <<<<<<<<<<<<<<
 *         return GenomicInterval(chrom, start_d, start_d + length, strand)
 *     else:
*/
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_strand, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 253, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":254
 *     strand = intern(strand)
 *     if strand != strand_minus:
 *         return GenomicInterval(chrom, start_d, start_d + length, strand)             # <<<<<<<<<<<<<<
 *     else:
 *         return GenomicInterval(chrom, start_d - length + 1, start_d + 1, strand)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_start_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyLong_From_long((__pyx_v_start_d + __pyx_v_length)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_chrom, __pyx_t_4, __pyx_t_5, __pyx_v_strand};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_6, (5-__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;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_r = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":253
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):
 *     strand = intern(strand)
 *     if strand != strand_minus:             # <<<<<<<<<<<<<<
 *         return GenomicInterval(chrom, start_d, start_d + length, strand)
 *     else:
*/
  }

  /* "HTSeq/_HTSeq.pyx":256
 *         return GenomicInterval(chrom, start_d, start_d + length, strand)
 *     else:
 *         return GenomicInterval(chrom, start_d - length + 1, start_d + 1, strand)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = NULL;
    __pyx_t_4 = __Pyx_PyLong_From_long(((__pyx_v_start_d - __pyx_v_length) + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyLong_From_long((__pyx_v_start_d + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_chrom, __pyx_t_4, __pyx_t_3, __pyx_v_strand};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_6, (5-__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;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_r = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":251
 * 
 * 
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):             # <<<<<<<<<<<<<<
 *     strand = intern(strand)
 *     if strand != strand_minus:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicInterval_from_directional", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_strand);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":274
 *     """
 * 
 *     def __init__(self, str chrom, long int pos, str strand='.'):             # <<<<<<<<<<<<<<
 *         GenomicInterval.__init__(self, chrom, pos, pos + 1, strand)
 * 
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_chrom = 0;
  long __pyx_v_pos;
  PyObject *__pyx_v_strand = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_chrom,&__pyx_mstate_global->__pyx_n_u_pos,&__pyx_mstate_global->__pyx_n_u_strand,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, 274, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 274, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 274, __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, 274, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 274, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__8));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 274, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 274, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 274, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 274, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__8));
    }
    __pyx_v_chrom = ((PyObject*)values[0]);
    __pyx_v_pos = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v_pos == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L3_error)
    __pyx_v_strand = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 274, __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("HTSeq._HTSeq.GenomicPosition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 274, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 274, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self), __pyx_v_chrom, __pyx_v_pos, __pyx_v_strand);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self, PyObject *__pyx_v_chrom, long __pyx_v_pos, PyObject *__pyx_v_strand) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":275
 * 
 *     def __init__(self, str chrom, long int pos, str strand='.'):
 *         GenomicInterval.__init__(self, chrom, pos, pos + 1, strand)             # <<<<<<<<<<<<<<
 * 
 *     property pos:
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_long((__pyx_v_pos + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_chrom, __pyx_t_3, __pyx_t_4, __pyx_v_strand};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_5, (6-__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, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":274
 *     """
 * 
 *     def __init__(self, str chrom, long int pos, str strand='.'):             # <<<<<<<<<<<<<<
 *         GenomicInterval.__init__(self, chrom, pos, pos + 1, strand)
 * 
*/

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

/* "HTSeq/_HTSeq.pyx":280
 *         """Alias for 'start_d'."""
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.start_d
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":281
 * 
 *         def __get__(self):
 *             return self.start_d             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, long newValue):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_start_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":280
 *         """Alias for 'start_d'."""
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.start_d
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":283
 *             return self.start_d
 * 
 *         def __set__(self, long newValue):             # <<<<<<<<<<<<<<
 *             self.start_d = newValue
 * 
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newValue); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_newValue) {
  long __pyx_v_newValue;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_newValue); {
    __pyx_v_newValue = __Pyx_PyLong_As_long(__pyx_arg_newValue); if (unlikely((__pyx_v_newValue == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self), ((long)__pyx_v_newValue));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3pos_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self, long __pyx_v_newValue) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "HTSeq/_HTSeq.pyx":284
 * 
 *         def __set__(self, long newValue):
 *             self.start_d = newValue             # <<<<<<<<<<<<<<
 * 
 *     property end:
*/
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v_newValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_start_d, __pyx_t_1) < (0)) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":283
 *             return self.start_d
 * 
 *         def __set__(self, long newValue):             # <<<<<<<<<<<<<<
 *             self.start_d = newValue
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":288
 *     property end:
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.start + 1
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3end_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3end_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_3end___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":289
 * 
 *         def __get__(self):
 *             return self.start + 1             # <<<<<<<<<<<<<<
 * 
 *     property length:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_long((__pyx_v_self->__pyx_base.start + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":288
 *     property end:
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.start + 1
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":293
 *     property length:
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return 1
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_6length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_6length_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6length___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6length___get__(CYTHON_UNUSED struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":294
 * 
 *         def __get__(self):
 *             return 1             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
  __pyx_r = __pyx_mstate_global->__pyx_int_1;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":293
 *     property length:
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return 1
 * 
*/

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

/* "HTSeq/_HTSeq.pyx":296
 *             return 1
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s object '%s':%d, strand '%s'>" % \
 *             (self.__class__.__name__, self.chrom, self.pos, self.strand)
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6[9];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":297
 * 
 *     def __repr__(self):
 *         return "<%s object '%s':%d, strand '%s'>" % \             # <<<<<<<<<<<<<<
 *             (self.__class__.__name__, self.chrom, self.pos, self.strand)
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "HTSeq/_HTSeq.pyx":298
 *     def __repr__(self):
 *         return "<%s object '%s':%d, strand '%s'>" % \
 *             (self.__class__.__name__, self.chrom, self.pos, self.strand)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_6[1] = __pyx_t_1;
  __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_object;
  __pyx_t_6[3] = __pyx_t_2;
  __pyx_t_6[4] = __pyx_mstate_global->__pyx_kp_u__9;
  __pyx_t_6[5] = __pyx_t_4;
  __pyx_t_6[6] = __pyx_mstate_global->__pyx_kp_u_strand_3;
  __pyx_t_6[7] = __pyx_t_5;
  __pyx_t_6[8] = __pyx_mstate_global->__pyx_kp_u__5;

  /* "HTSeq/_HTSeq.pyx":297
 * 
 *     def __repr__(self):
 *         return "<%s object '%s':%d, strand '%s'>" % \             # <<<<<<<<<<<<<<
 *             (self.__class__.__name__, self.chrom, self.pos, self.strand)
 * 
*/
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 9, 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 2 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":296
 *             return 1
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s object '%s':%d, strand '%s'>" % \
 *             (self.__class__.__name__, self.chrom, self.pos, self.strand)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":300
 *             (self.__class__.__name__, self.chrom, self.pos, self.strand)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s:%d/%s" % (self.chrom, self.pos, self.strand)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_5__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_4__str__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_4__str__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "HTSeq/_HTSeq.pyx":301
 * 
 *     def __str__(self):
 *         return "%s:%d/%s" % (self.chrom, self.pos, self.strand)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(GenomicPosition self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_2), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5[0] = __pyx_t_1;
  __pyx_t_5[1] = __pyx_mstate_global->__pyx_kp_u__10;
  __pyx_t_5[2] = __pyx_t_3;
  __pyx_t_5[3] = __pyx_mstate_global->__pyx_kp_u__11;
  __pyx_t_5[4] = __pyx_t_4;
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":300
 *             (self.__class__.__name__, self.chrom, self.pos, self.strand)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s:%d/%s" % (self.chrom, self.pos, self.strand)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":303
 *         return "%s:%d/%s" % (self.chrom, self.pos, self.strand)
 * 
 *     def __reduce__(GenomicPosition self):             # <<<<<<<<<<<<<<
 *         return GenomicPosition, (self.chrom, self.pos, self.strand)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__(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_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__(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__ (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__", 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__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6__reduce__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_6__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "HTSeq/_HTSeq.pyx":304
 * 
 *     def __reduce__(GenomicPosition self):
 *         return GenomicPosition, (self.chrom, self.pos, self.strand)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.chrom);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.chrom);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.chrom) != (0)) __PYX_ERR(0, 304, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 304, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(0, 304, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition)) != (0)) __PYX_ERR(0, 304, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 304, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":303
 *         return "%s:%d/%s" % (self.chrom, self.pos, self.strand)
 * 
 *     def __reduce__(GenomicPosition self):             # <<<<<<<<<<<<<<
 *         return GenomicPosition, (self.chrom, self.pos, self.strand)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":306
 *         return GenomicPosition, (self.chrom, self.pos, self.strand)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         return GenomicPosition(self.chrom, self.pos, self.strand)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_9copy(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_5HTSeq_6_HTSeq_15GenomicPosition_9copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_9copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_9copy(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("copy (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("copy", 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("copy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15GenomicPosition_8copy(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":307
 * 
 *     def copy(self):
 *         return GenomicPosition(self.chrom, self.pos, self.strand)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_self->__pyx_base.chrom, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":306
 *         return GenomicPosition, (self.chrom, self.pos, self.strand)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         return GenomicPosition(self.chrom, self.pos, self.strand)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicPosition.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":327
 *     cdef public str memmap_dir
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):
 *         """Create ChromVector from GenomicInterval
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_1create(PyObject *__pyx_v_cls, 
#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_5HTSeq_6_HTSeq_11ChromVector_create, "Create ChromVector from GenomicInterval\n\n        Args:\n            iv (GenomicInterval): A GenomicInterval describing the chromosome\n              vector.\n            typecode ('d', 'i', 'l', 'b', or 'O'): What kind of data will be\n              stored inside this chromosome vector. 'd' for double, 'i' for int,\n              'l' for long int, 'b' for boolean, 'O' for arbitrary objects\n              (e.g. sets).\n            storage ('step', 'ndarray', or 'memmap'): What kind of storage to\n              use. 'ndarray' is appropriate for short chromosomes and stores\n              each position in the genome into memory. 'memmap' stores all\n              positions, but maps the memory onto disk for larger chromosomes.\n              'step' is a sparse representation similar to CSR matrices whereby\n              only the boundaries between genomic stretches with differing\n              data content are stored - see HTSeq.StepVector.\n            memmap_dir (str): If using 'memmap' storage, what folder to store\n              the memory maps. These can get quite big.\n\n        Returns:\n            An instance of ChromVector with the requested options.\n\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_1create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_11ChromVector_create};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_1create(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
  PyObject *__pyx_v_typecode = 0;
  PyObject *__pyx_v_storage = 0;
  PyObject *__pyx_v_memmap_dir = 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("create (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_iv,&__pyx_mstate_global->__pyx_n_u_typecode,&__pyx_mstate_global->__pyx_n_u_storage,&__pyx_mstate_global->__pyx_n_u_memmap_dir,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, 327, __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, 327, __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, 327, __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, 327, __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, 327, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(0, 327, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__12));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("create", 0, 3, 4, i); __PYX_ERR(0, 327, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 327, __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, 327, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 327, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 327, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__12));
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)values[0]);
    __pyx_v_typecode = ((PyObject*)values[1]);
    __pyx_v_storage = ((PyObject*)values[2]);
    __pyx_v_memmap_dir = ((PyObject*)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 327, __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("HTSeq._HTSeq.ChromVector.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 328, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_typecode), (&PyUnicode_Type), 1, "typecode", 1))) __PYX_ERR(0, 328, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage), (&PyUnicode_Type), 1, "storage", 1))) __PYX_ERR(0, 328, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memmap_dir), (&PyUnicode_Type), 1, "memmap_dir", 1))) __PYX_ERR(0, 328, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_create(((PyTypeObject*)__pyx_v_cls), __pyx_v_iv, __pyx_v_typecode, __pyx_v_storage, __pyx_v_memmap_dir);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_create(PyTypeObject *__pyx_v_cls, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv, PyObject *__pyx_v_typecode, PyObject *__pyx_v_storage, PyObject *__pyx_v_memmap_dir) {
  PyObject *__pyx_v_ncv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);

  /* "HTSeq/_HTSeq.pyx":352
 * 
 *         """
 *         ncv = cls()             # <<<<<<<<<<<<<<
 *         ncv.iv = iv
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_v_cls, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_ncv = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":353
 *         """
 *         ncv = cls()
 *         ncv.iv = iv             # <<<<<<<<<<<<<<
 * 
 *         if storage == "ndarray":
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_iv, ((PyObject *)__pyx_v_iv)) < (0)) __PYX_ERR(0, 353, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":355
 *         ncv.iv = iv
 * 
 *         if storage == "ndarray":             # <<<<<<<<<<<<<<
 *             if typecode != 'O':
 *                 ncv.array = numpy.zeros(shape=(iv.length,), dtype=typecode)
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_mstate_global->__pyx_n_u_ndarray, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 355, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":356
 * 
 *         if storage == "ndarray":
 *             if typecode != 'O':             # <<<<<<<<<<<<<<
 *                 ncv.array = numpy.zeros(shape=(iv.length,), dtype=typecode)
 *             else:
*/
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_typecode, __pyx_mstate_global->__pyx_n_u_O, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 356, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":357
 *         if storage == "ndarray":
 *             if typecode != 'O':
 *                 ncv.array = numpy.zeros(shape=(iv.length,), dtype=typecode)             # <<<<<<<<<<<<<<
 *             else:
 *                 ncv.array = numpy.empty(shape=(iv.length,), dtype=typecode)
*/
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 357, __pyx_L1_error);
      __pyx_t_5 = 0;
      __pyx_t_3 = 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_3 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, NULL};
        __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_t_7, __pyx_t_5, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 357, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_typecode, __pyx_t_5, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 357, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_array, __pyx_t_1) < (0)) __PYX_ERR(0, 357, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":356
 * 
 *         if storage == "ndarray":
 *             if typecode != 'O':             # <<<<<<<<<<<<<<
 *                 ncv.array = numpy.zeros(shape=(iv.length,), dtype=typecode)
 *             else:
*/
      goto __pyx_L4;
    }

    /* "HTSeq/_HTSeq.pyx":359
 *                 ncv.array = numpy.zeros(shape=(iv.length,), dtype=typecode)
 *             else:
 *                 ncv.array = numpy.empty(shape=(iv.length,), dtype=typecode)             # <<<<<<<<<<<<<<
 *                 ncv.array[:] = None
 * 
*/
    /*else*/ {
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 359, __pyx_L1_error);
      __pyx_t_5 = 0;
      __pyx_t_3 = 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_3 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_6, NULL};
        __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_t_2, __pyx_t_5, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 359, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_typecode, __pyx_t_5, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 359, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_array, __pyx_t_1) < (0)) __PYX_ERR(0, 359, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":360
 *             else:
 *                 ncv.array = numpy.empty(shape=(iv.length,), dtype=typecode)
 *                 ncv.array[:] = None             # <<<<<<<<<<<<<<
 * 
 *         elif storage == "memmap":
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_PyObject_SetSlice(__pyx_t_1, Py_None, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < (0)) __PYX_ERR(0, 360, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L4:;

    /* "HTSeq/_HTSeq.pyx":355
 *         ncv.iv = iv
 * 
 *         if storage == "ndarray":             # <<<<<<<<<<<<<<
 *             if typecode != 'O':
 *                 ncv.array = numpy.zeros(shape=(iv.length,), dtype=typecode)
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":362
 *                 ncv.array[:] = None
 * 
 *         elif storage == "memmap":             # <<<<<<<<<<<<<<
 *             ncv.array = numpy.memmap(
 *                 shape=(iv.length,),
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_mstate_global->__pyx_n_u_memmap, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 362, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":363
 * 
 *         elif storage == "memmap":
 *             ncv.array = numpy.memmap(             # <<<<<<<<<<<<<<
 *                 shape=(iv.length,),
 *                 dtype=typecode,
*/
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_memmap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":364
 *         elif storage == "memmap":
 *             ncv.array = numpy.memmap(
 *                 shape=(iv.length,),             # <<<<<<<<<<<<<<
 *                 dtype=typecode,
 *                 filename=os.path.join(
*/
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 364, __pyx_L1_error);
    __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":366
 *                 shape=(iv.length,),
 *                 dtype=typecode,
 *                 filename=os.path.join(             # <<<<<<<<<<<<<<
 *                     memmap_dir,
 *                     iv.chrom + iv.strand + str(iv.start) + '_' \
*/
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_8 = __pyx_t_10;
    __Pyx_INCREF(__pyx_t_8);

    /* "HTSeq/_HTSeq.pyx":368
 *                 filename=os.path.join(
 *                     memmap_dir,
 *                     iv.chrom + iv.strand + str(iv.start) + '_' \             # <<<<<<<<<<<<<<
 *                         + str(iv.length) + ".nmm"),
 *                 mode='w+')
*/
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = PyNumber_Add(__pyx_v_iv->chrom, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyLong_From_long(__pyx_v_iv->start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_12 = __Pyx_PyObject_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyNumber_Add(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_9, __pyx_mstate_global->__pyx_n_u__13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "HTSeq/_HTSeq.pyx":369
 *                     memmap_dir,
 *                     iv.chrom + iv.strand + str(iv.start) + '_' \
 *                         + str(iv.length) + ".nmm"),             # <<<<<<<<<<<<<<
 *                 mode='w+')
 * 
*/
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = __Pyx_PyObject_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyNumber_Add(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_nmm); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_memmap_dir, __pyx_t_11};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_7, NULL};
      __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_t_6, __pyx_t_10, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 363, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_typecode, __pyx_t_10, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 363, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filename, __pyx_t_5, __pyx_t_10, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 363, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_w, __pyx_t_10, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 363, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }

    /* "HTSeq/_HTSeq.pyx":363
 * 
 *         elif storage == "memmap":
 *             ncv.array = numpy.memmap(             # <<<<<<<<<<<<<<
 *                 shape=(iv.length,),
 *                 dtype=typecode,
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_array, __pyx_t_1) < (0)) __PYX_ERR(0, 363, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":362
 *                 ncv.array[:] = None
 * 
 *         elif storage == "memmap":             # <<<<<<<<<<<<<<
 *             ncv.array = numpy.memmap(
 *                 shape=(iv.length,),
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":372
 *                 mode='w+')
 * 
 *         elif storage == "step":             # <<<<<<<<<<<<<<
 *             ncv.array = StepVector.StepVector.create(
 *                 typecode=typecode,
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_mstate_global->__pyx_n_u_step, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 372, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":373
 * 
 *         elif storage == "step":
 *             ncv.array = StepVector.StepVector.create(             # <<<<<<<<<<<<<<
 *                 typecode=typecode,
 *             )
*/
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_StepVector); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_StepVector); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_2 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_2);

    /* "HTSeq/_HTSeq.pyx":374
 *         elif storage == "step":
 *             ncv.array = StepVector.StepVector.create(
 *                 typecode=typecode,             # <<<<<<<<<<<<<<
 *             )
 *         elif storage == "stretch":
*/
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
      __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 373, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_typecode, __pyx_v_typecode, __pyx_t_10, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 373, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_create, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }

    /* "HTSeq/_HTSeq.pyx":373
 * 
 *         elif storage == "step":
 *             ncv.array = StepVector.StepVector.create(             # <<<<<<<<<<<<<<
 *                 typecode=typecode,
 *             )
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_array, __pyx_t_1) < (0)) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":372
 *                 mode='w+')
 * 
 *         elif storage == "step":             # <<<<<<<<<<<<<<
 *             ncv.array = StepVector.StepVector.create(
 *                 typecode=typecode,
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":376
 *                 typecode=typecode,
 *             )
 *         elif storage == "stretch":             # <<<<<<<<<<<<<<
 *             ncv.array = StretchVector(
 *                     typecode=typecode,
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_storage, __pyx_mstate_global->__pyx_n_u_stretch, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 376, __pyx_L1_error)
  if (likely(__pyx_t_4)) {

    /* "HTSeq/_HTSeq.pyx":377
 *             )
 *         elif storage == "stretch":
 *             ncv.array = StretchVector(             # <<<<<<<<<<<<<<
 *                     typecode=typecode,
 *             )
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_StretchVector); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "HTSeq/_HTSeq.pyx":378
 *         elif storage == "stretch":
 *             ncv.array = StretchVector(
 *                     typecode=typecode,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_typecode, __pyx_v_typecode, __pyx_t_2, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 377, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }

    /* "HTSeq/_HTSeq.pyx":377
 *             )
 *         elif storage == "stretch":
 *             ncv.array = StretchVector(             # <<<<<<<<<<<<<<
 *                     typecode=typecode,
 *             )
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_array, __pyx_t_1) < (0)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":376
 *                 typecode=typecode,
 *             )
 *         elif storage == "stretch":             # <<<<<<<<<<<<<<
 *             ncv.array = StretchVector(
 *                     typecode=typecode,
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":382
 * 
 *         else:
 *             raise ValueError("Illegal storage mode.")             # <<<<<<<<<<<<<<
 * 
 *         ncv._storage = storage
*/
  /*else*/ {
    __pyx_t_10 = NULL;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_Illegal_storage_mode};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __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, 382, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":384
 *             raise ValueError("Illegal storage mode.")
 * 
 *         ncv._storage = storage             # <<<<<<<<<<<<<<
 *         ncv.typecode = typecode
 *         # NOTE: As long as autochromosomes in GenomicArray are infinite length
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_storage_2, __pyx_v_storage) < (0)) __PYX_ERR(0, 384, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":385
 * 
 *         ncv._storage = storage
 *         ncv.typecode = typecode             # <<<<<<<<<<<<<<
 *         # NOTE: As long as autochromosomes in GenomicArray are infinite length
 *         # this has pretty limited use, but that might change
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_typecode, __pyx_v_typecode) < (0)) __PYX_ERR(0, 385, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":388
 *         # NOTE: As long as autochromosomes in GenomicArray are infinite length
 *         # this has pretty limited use, but that might change
 *         ncv.offset = iv.start             # <<<<<<<<<<<<<<
 *         ncv.is_vector_of_sets = False
 *         ncv.memmap_dir = memmap_dir
*/
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v_iv->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_offset, __pyx_t_1) < (0)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":389
 *         # this has pretty limited use, but that might change
 *         ncv.offset = iv.start
 *         ncv.is_vector_of_sets = False             # <<<<<<<<<<<<<<
 *         ncv.memmap_dir = memmap_dir
 *         return ncv
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_is_vector_of_sets, Py_False) < (0)) __PYX_ERR(0, 389, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":390
 *         ncv.offset = iv.start
 *         ncv.is_vector_of_sets = False
 *         ncv.memmap_dir = memmap_dir             # <<<<<<<<<<<<<<
 *         return ncv
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_ncv, __pyx_mstate_global->__pyx_n_u_memmap_dir, __pyx_v_memmap_dir) < (0)) __PYX_ERR(0, 390, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":391
 *         ncv.is_vector_of_sets = False
 *         ncv.memmap_dir = memmap_dir
 *         return ncv             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ncv);
  __pyx_r = __pyx_v_ncv;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":327
 *     cdef public str memmap_dir
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):
 *         """Create ChromVector from GenomicInterval
*/

  /* function exit code */
  __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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ncv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":393
 *         return ncv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _create_view(cls, ChromVector vec, GenomicInterval iv):
 *         if iv.length == 0:
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_3_create_view(PyObject *__pyx_v_cls, 
#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_5HTSeq_6_HTSeq_11ChromVector_3_create_view = {"_create_view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_3_create_view, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_3_create_view(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_vec = 0;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_view (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_vec,&__pyx_mstate_global->__pyx_n_u_iv,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, 393, __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, 393, __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, 393, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_create_view", 0) < (0)) __PYX_ERR(0, 393, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_create_view", 1, 2, 2, i); __PYX_ERR(0, 393, __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, 393, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 393, __pyx_L3_error)
    }
    __pyx_v_vec = ((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)values[0]);
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_create_view", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 393, __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("HTSeq._HTSeq.ChromVector._create_view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, 1, "vec", 0))) __PYX_ERR(0, 394, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 394, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2_create_view(((PyTypeObject*)__pyx_v_cls), __pyx_v_vec, __pyx_v_iv);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2_create_view(PyTypeObject *__pyx_v_cls, struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_vec, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_create_view", 0);

  /* "HTSeq/_HTSeq.pyx":395
 *     @classmethod
 *     def _create_view(cls, ChromVector vec, GenomicInterval iv):
 *         if iv.length == 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Cannot subset to zero-length interval.")
 *         v = cls()
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "HTSeq/_HTSeq.pyx":396
 *     def _create_view(cls, ChromVector vec, GenomicInterval iv):
 *         if iv.length == 0:
 *             raise IndexError("Cannot subset to zero-length interval.")             # <<<<<<<<<<<<<<
 *         v = cls()
 *         v.iv = iv
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cannot_subset_to_zero_length_int};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __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, 396, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":395
 *     @classmethod
 *     def _create_view(cls, ChromVector vec, GenomicInterval iv):
 *         if iv.length == 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Cannot subset to zero-length interval.")
 *         v = cls()
*/
  }

  /* "HTSeq/_HTSeq.pyx":397
 *         if iv.length == 0:
 *             raise IndexError("Cannot subset to zero-length interval.")
 *         v = cls()             # <<<<<<<<<<<<<<
 *         v.iv = iv
 *         v.array = vec.array
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_v_cls, __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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_v = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":398
 *             raise IndexError("Cannot subset to zero-length interval.")
 *         v = cls()
 *         v.iv = iv             # <<<<<<<<<<<<<<
 *         v.array = vec.array
 *         v.offset = vec.offset
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_mstate_global->__pyx_n_u_iv, ((PyObject *)__pyx_v_iv)) < (0)) __PYX_ERR(0, 398, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":399
 *         v = cls()
 *         v.iv = iv
 *         v.array = vec.array             # <<<<<<<<<<<<<<
 *         v.offset = vec.offset
 *         v.is_vector_of_sets = vec.is_vector_of_sets
*/
  __pyx_t_1 = __pyx_v_vec->array;
  __Pyx_INCREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_mstate_global->__pyx_n_u_array, __pyx_t_1) < (0)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":400
 *         v.iv = iv
 *         v.array = vec.array
 *         v.offset = vec.offset             # <<<<<<<<<<<<<<
 *         v.is_vector_of_sets = vec.is_vector_of_sets
 *         v._storage = vec._storage
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_vec->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_mstate_global->__pyx_n_u_offset, __pyx_t_1) < (0)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":401
 *         v.array = vec.array
 *         v.offset = vec.offset
 *         v.is_vector_of_sets = vec.is_vector_of_sets             # <<<<<<<<<<<<<<
 *         v._storage = vec._storage
 *         return v
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_vec->is_vector_of_sets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_mstate_global->__pyx_n_u_is_vector_of_sets, __pyx_t_1) < (0)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":402
 *         v.offset = vec.offset
 *         v.is_vector_of_sets = vec.is_vector_of_sets
 *         v._storage = vec._storage             # <<<<<<<<<<<<<<
 *         return v
 * 
*/
  __pyx_t_1 = __pyx_v_vec->_storage;
  __Pyx_INCREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_v, __pyx_mstate_global->__pyx_n_u_storage_2, __pyx_t_1) < (0)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":403
 *         v.is_vector_of_sets = vec.is_vector_of_sets
 *         v._storage = vec._storage
 *         return v             # <<<<<<<<<<<<<<
 * 
 *     def extend_to_include(self, iv):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_v);
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":393
 *         return ncv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _create_view(cls, ChromVector vec, GenomicInterval iv):
 *         if iv.length == 0:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector._create_view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":405
 *         return v
 * 
 *     def extend_to_include(self, iv):             # <<<<<<<<<<<<<<
 *         if iv.strand != self.iv.strand:
 *             raise ValueError(
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5extend_to_include(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_5HTSeq_6_HTSeq_11ChromVector_5extend_to_include = {"extend_to_include", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5extend_to_include, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5extend_to_include(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_iv = 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("extend_to_include (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_iv,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, 405, __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, 405, __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, "extend_to_include", 0) < (0)) __PYX_ERR(0, 405, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("extend_to_include", 1, 1, 1, i); __PYX_ERR(0, 405, __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, 405, __pyx_L3_error)
    }
    __pyx_v_iv = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extend_to_include", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 405, __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("HTSeq._HTSeq.ChromVector.extend_to_include", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_4extend_to_include(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), __pyx_v_iv);

  /* 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_5HTSeq_6_HTSeq_11ChromVector_4extend_to_include(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_iv) {
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_v_startdiff = NULL;
  PyObject *__pyx_v_array = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  size_t __pyx_t_5;
  long __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extend_to_include", 0);

  /* "HTSeq/_HTSeq.pyx":406
 * 
 *     def extend_to_include(self, iv):
 *         if iv.strand != self.iv.strand:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'The new interval must match the current strandedness',
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "HTSeq/_HTSeq.pyx":407
 *     def extend_to_include(self, iv):
 *         if iv.strand != self.iv.strand:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'The new interval must match the current strandedness',
 *             )
*/
    __pyx_t_2 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_new_interval_must_match_the};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 407, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":406
 * 
 *     def extend_to_include(self, iv):
 *         if iv.strand != self.iv.strand:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'The new interval must match the current strandedness',
*/
  }

  /* "HTSeq/_HTSeq.pyx":412
 * 
 *         # Step 1: extend the interval
 *         length = self.iv.length             # <<<<<<<<<<<<<<
 *         startdiff = max(self.iv.start - iv.start, 0)
 *         self.iv.extend_to_include(iv)
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_length = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "HTSeq/_HTSeq.pyx":413
 *         # Step 1: extend the interval
 *         length = self.iv.length
 *         startdiff = max(self.iv.start - iv.start, 0)             # <<<<<<<<<<<<<<
 *         self.iv.extend_to_include(iv)
 *         self.offset = self.iv.start
*/
  __pyx_t_6 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_4) {
    __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __pyx_t_7;
    __pyx_t_7 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_startdiff = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":414
 *         length = self.iv.length
 *         startdiff = max(self.iv.start - iv.start, 0)
 *         self.iv.extend_to_include(iv)             # <<<<<<<<<<<<<<
 *         self.offset = self.iv.start
 * 
*/
  if (!(likely(((__pyx_v_iv) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_iv, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 414, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self->iv->__pyx_vtab)->extend_to_include(__pyx_v_self->iv, ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_iv), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":415
 *         startdiff = max(self.iv.start - iv.start, 0)
 *         self.iv.extend_to_include(iv)
 *         self.offset = self.iv.start             # <<<<<<<<<<<<<<
 * 
 *         # Step 2: extend the array if needed, and shift-copy the old values
*/
  __pyx_t_6 = __pyx_v_self->iv->start;
  __pyx_v_self->offset = __pyx_t_6;

  /* "HTSeq/_HTSeq.pyx":418
 * 
 *         # Step 2: extend the array if needed, and shift-copy the old values
 *         if self._storage == 'ndarray':             # <<<<<<<<<<<<<<
 *             if self.typecode != 'O':
 *                 array = numpy.zeros(shape=(self.iv.length,), dtype=self.typecode)
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_storage, __pyx_mstate_global->__pyx_n_u_ndarray, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 418, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":419
 *         # Step 2: extend the array if needed, and shift-copy the old values
 *         if self._storage == 'ndarray':
 *             if self.typecode != 'O':             # <<<<<<<<<<<<<<
 *                 array = numpy.zeros(shape=(self.iv.length,), dtype=self.typecode)
 *             else:
*/
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->typecode, __pyx_mstate_global->__pyx_n_u_O, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 419, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":420
 *         if self._storage == 'ndarray':
 *             if self.typecode != 'O':
 *                 array = numpy.zeros(shape=(self.iv.length,), dtype=self.typecode)             # <<<<<<<<<<<<<<
 *             else:
 *                 array = numpy.empty(shape=(self.iv.length,), dtype=self.typecode)
*/
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 420, __pyx_L1_error);
      __pyx_t_7 = 0;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, NULL};
        __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_t_8, __pyx_t_7, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 420, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_self->typecode, __pyx_t_7, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 420, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_array = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":419
 *         # Step 2: extend the array if needed, and shift-copy the old values
 *         if self._storage == 'ndarray':
 *             if self.typecode != 'O':             # <<<<<<<<<<<<<<
 *                 array = numpy.zeros(shape=(self.iv.length,), dtype=self.typecode)
 *             else:
*/
      goto __pyx_L5;
    }

    /* "HTSeq/_HTSeq.pyx":422
 *                 array = numpy.zeros(shape=(self.iv.length,), dtype=self.typecode)
 *             else:
 *                 array = numpy.empty(shape=(self.iv.length,), dtype=self.typecode)             # <<<<<<<<<<<<<<
 *                 array[:] = None
 *             array[startdiff: startdiff + length] = self.array[:]
*/
    /*else*/ {
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 422, __pyx_L1_error);
      __pyx_t_7 = 0;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_3, NULL};
        __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_t_2, __pyx_t_7, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 422, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_self->typecode, __pyx_t_7, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 422, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_array = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":423
 *             else:
 *                 array = numpy.empty(shape=(self.iv.length,), dtype=self.typecode)
 *                 array[:] = None             # <<<<<<<<<<<<<<
 *             array[startdiff: startdiff + length] = self.array[:]
 *         elif self._storage == 'memmap':
*/
      if (__Pyx_PyObject_SetSlice(__pyx_v_array, Py_None, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < (0)) __PYX_ERR(0, 423, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "HTSeq/_HTSeq.pyx":424
 *                 array = numpy.empty(shape=(self.iv.length,), dtype=self.typecode)
 *                 array[:] = None
 *             array[startdiff: startdiff + length] = self.array[:]             # <<<<<<<<<<<<<<
 *         elif self._storage == 'memmap':
 *             array = numpy.memmap(
*/
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_self->array, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyNumber_Add(__pyx_v_startdiff, __pyx_v_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_PyObject_SetSlice(__pyx_v_array, __pyx_t_1, 0, 0, &__pyx_v_startdiff, &__pyx_t_8, NULL, 0, 0, 1) < (0)) __PYX_ERR(0, 424, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":418
 * 
 *         # Step 2: extend the array if needed, and shift-copy the old values
 *         if self._storage == 'ndarray':             # <<<<<<<<<<<<<<
 *             if self.typecode != 'O':
 *                 array = numpy.zeros(shape=(self.iv.length,), dtype=self.typecode)
*/
    goto __pyx_L4;
  }

  /* "HTSeq/_HTSeq.pyx":425
 *                 array[:] = None
 *             array[startdiff: startdiff + length] = self.array[:]
 *         elif self._storage == 'memmap':             # <<<<<<<<<<<<<<
 *             array = numpy.memmap(
 *                 shape=(self.iv.length,), dtype=self.typecode,
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_storage, __pyx_mstate_global->__pyx_n_u_memmap, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 425, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":426
 *             array[startdiff: startdiff + length] = self.array[:]
 *         elif self._storage == 'memmap':
 *             array = numpy.memmap(             # <<<<<<<<<<<<<<
 *                 shape=(self.iv.length,), dtype=self.typecode,
 *                 filename=os.path.join(
*/
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_memmap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":427
 *         elif self._storage == 'memmap':
 *             array = numpy.memmap(
 *                 shape=(self.iv.length,), dtype=self.typecode,             # <<<<<<<<<<<<<<
 *                 filename=os.path.join(
 *                     self.memmap_dir,
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 427, __pyx_L1_error);
    __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":428
 *             array = numpy.memmap(
 *                 shape=(self.iv.length,), dtype=self.typecode,
 *                 filename=os.path.join(             # <<<<<<<<<<<<<<
 *                     self.memmap_dir,
 *                     self.iv.chrom + self.iv.strand + str(self.iv.start) + '_' \
*/
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_9 = __pyx_t_11;
    __Pyx_INCREF(__pyx_t_9);

    /* "HTSeq/_HTSeq.pyx":430
 *                 filename=os.path.join(
 *                     self.memmap_dir,
 *                     self.iv.chrom + self.iv.strand + str(self.iv.start) + '_' \             # <<<<<<<<<<<<<<
 *                         + str(self.iv.length) + ".nmm"),
 *                 mode='w+',
*/
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = PyNumber_Add(__pyx_v_self->iv->chrom, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyLong_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_13 = __Pyx_PyObject_Unicode(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Add(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Add(__pyx_t_10, __pyx_mstate_global->__pyx_n_u__13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "HTSeq/_HTSeq.pyx":431
 *                     self.memmap_dir,
 *                     self.iv.chrom + self.iv.strand + str(self.iv.start) + '_' \
 *                         + str(self.iv.length) + ".nmm"),             # <<<<<<<<<<<<<<
 *                 mode='w+',
 *             )
*/
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = __Pyx_PyObject_Unicode(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Add(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_nmm); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_self->memmap_dir, __pyx_t_12};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(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_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_8, NULL};
      __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 426, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_t_3, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 426, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_self->typecode, __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 426, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filename, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 426, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_w, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 426, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_array = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":434
 *                 mode='w+',
 *             )
 *             array[startdiff: startdiff + length] = self.array[:]             # <<<<<<<<<<<<<<
 *         else:
 *             # The StepVector is created in ChromVector.create without explicit
*/
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_self->array, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Add(__pyx_v_startdiff, __pyx_v_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetSlice(__pyx_v_array, __pyx_t_1, 0, 0, &__pyx_v_startdiff, &__pyx_t_2, NULL, 0, 0, 1) < (0)) __PYX_ERR(0, 434, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":425
 *                 array[:] = None
 *             array[startdiff: startdiff + length] = self.array[:]
 *         elif self._storage == 'memmap':             # <<<<<<<<<<<<<<
 *             array = numpy.memmap(
 *                 shape=(self.iv.length,), dtype=self.typecode,
*/
    goto __pyx_L4;
  }

  /* "HTSeq/_HTSeq.pyx":440
 *             # to extend it here, but rather just set the slice to the right
 *             # value
 *             array = self.array             # <<<<<<<<<<<<<<
 *         self.array = array
 * 
*/
  /*else*/ {
    __pyx_t_1 = __pyx_v_self->array;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v_array = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "HTSeq/_HTSeq.pyx":441
 *             # value
 *             array = self.array
 *         self.array = array             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, index):
*/
  __Pyx_INCREF(__pyx_v_array);
  __Pyx_GIVEREF(__pyx_v_array);
  __Pyx_GOTREF(__pyx_v_self->array);
  __Pyx_DECREF(__pyx_v_self->array);
  __pyx_v_self->array = __pyx_v_array;

  /* "HTSeq/_HTSeq.pyx":405
 *         return v
 * 
 *     def extend_to_include(self, iv):             # <<<<<<<<<<<<<<
 *         if iv.strand != self.iv.strand:
 *             raise ValueError(
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.extend_to_include", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XDECREF(__pyx_v_startdiff);
  __Pyx_XDECREF(__pyx_v_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":443
 *         self.array = array
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         """Index or slice the chromosome.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
PyDoc_STRVAR(__pyx_doc_5HTSeq_6_HTSeq_11ChromVector_6__getitem__, "Index or slice the chromosome.\n\n        The index can be a few things:\n        - an integer: get the value of the vector at that chromosome coordinate\n        - a 1-step slice e.g \"4:7\": get a view of the chromosome region\n          between those coordinates. The array data are not copied.\n        - a GenomicInterval: similar to slices, with the additional choice of\n          strandedness. If this argument is stranded but the chromosome itself\n          is not stranded, a nonstranded view of the chromosome region is\n          returned.\n\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_5HTSeq_6_HTSeq_11ChromVector_6__getitem__;
#endif
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6__getitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_index));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_index_slice = 0;
  long __pyx_v_index_int;
  long __pyx_v_start;
  long __pyx_v_stop;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "HTSeq/_HTSeq.pyx":461
 *         cdef GenomicInterval iv
 * 
 *         if isinstance(index, int):             # <<<<<<<<<<<<<<
 *             index_int = index
 *             if index_int < self.iv.start or index_int >= self.iv.end:
*/
  __pyx_t_1 = PyLong_Check(__pyx_v_index); 
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":462
 * 
 *         if isinstance(index, int):
 *             index_int = index             # <<<<<<<<<<<<<<
 *             if index_int < self.iv.start or index_int >= self.iv.end:
 *                 raise IndexError
*/
    __pyx_t_2 = __Pyx_PyLong_As_long(__pyx_v_index); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error)
    __pyx_v_index_int = __pyx_t_2;

    /* "HTSeq/_HTSeq.pyx":463
 *         if isinstance(index, int):
 *             index_int = index
 *             if index_int < self.iv.start or index_int >= self.iv.end:             # <<<<<<<<<<<<<<
 *                 raise IndexError
 *             return self.array[index_int - self.offset]
*/
    __pyx_t_3 = (__pyx_v_index_int < __pyx_v_self->iv->start);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_index_int >= __pyx_v_self->iv->end);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;
    if (unlikely(__pyx_t_1)) {

      /* "HTSeq/_HTSeq.pyx":464
 *             index_int = index
 *             if index_int < self.iv.start or index_int >= self.iv.end:
 *                 raise IndexError             # <<<<<<<<<<<<<<
 *             return self.array[index_int - self.offset]
 * 
*/
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_IndexError))), 0, 0, 0);
      __PYX_ERR(0, 464, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":463
 *         if isinstance(index, int):
 *             index_int = index
 *             if index_int < self.iv.start or index_int >= self.iv.end:             # <<<<<<<<<<<<<<
 *                 raise IndexError
 *             return self.array[index_int - self.offset]
*/
    }

    /* "HTSeq/_HTSeq.pyx":465
 *             if index_int < self.iv.start or index_int >= self.iv.end:
 *                 raise IndexError
 *             return self.array[index_int - self.offset]             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(index, slice):
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = (__pyx_v_index_int - __pyx_v_self->offset);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self->array, __pyx_t_2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":461
 *         cdef GenomicInterval iv
 * 
 *         if isinstance(index, int):             # <<<<<<<<<<<<<<
 *             index_int = index
 *             if index_int < self.iv.start or index_int >= self.iv.end:
*/
  }

  /* "HTSeq/_HTSeq.pyx":467
 *             return self.array[index_int - self.offset]
 * 
 *         elif isinstance(index, slice):             # <<<<<<<<<<<<<<
 *             index_slice = index
 *             if index_slice.start is None:
*/
  __pyx_t_1 = PySlice_Check(__pyx_v_index); 
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":468
 * 
 *         elif isinstance(index, slice):
 *             index_slice = index             # <<<<<<<<<<<<<<
 *             if index_slice.start is None:
 *                 start = self.iv.start
*/
    __pyx_t_4 = __pyx_v_index;
    __Pyx_INCREF(__pyx_t_4);
    if (!(likely(PySlice_Check(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("slice", __pyx_t_4))) __PYX_ERR(0, 468, __pyx_L1_error)
    __pyx_v_index_slice = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":469
 *         elif isinstance(index, slice):
 *             index_slice = index
 *             if index_slice.start is None:             # <<<<<<<<<<<<<<
 *                 start = self.iv.start
 *             else:
*/
    __pyx_t_4 = __Pyx_PySlice_Start(__pyx_v_index_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = (__pyx_t_4 == Py_None);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":470
 *             index_slice = index
 *             if index_slice.start is None:
 *                 start = self.iv.start             # <<<<<<<<<<<<<<
 *             else:
 *                 start = index_slice.start
*/
      __pyx_t_2 = __pyx_v_self->iv->start;
      __pyx_v_start = __pyx_t_2;

      /* "HTSeq/_HTSeq.pyx":469
 *         elif isinstance(index, slice):
 *             index_slice = index
 *             if index_slice.start is None:             # <<<<<<<<<<<<<<
 *                 start = self.iv.start
 *             else:
*/
      goto __pyx_L7;
    }

    /* "HTSeq/_HTSeq.pyx":472
 *                 start = self.iv.start
 *             else:
 *                 start = index_slice.start             # <<<<<<<<<<<<<<
 *                 if start < self.iv.start:
 *                     raise IndexError("start too small")
*/
    /*else*/ {
      __pyx_t_4 = __Pyx_PySlice_Start(__pyx_v_index_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyLong_As_long(__pyx_t_4); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_start = __pyx_t_2;

      /* "HTSeq/_HTSeq.pyx":473
 *             else:
 *                 start = index_slice.start
 *                 if start < self.iv.start:             # <<<<<<<<<<<<<<
 *                     raise IndexError("start too small")
 * 
*/
      __pyx_t_1 = (__pyx_v_start < __pyx_v_self->iv->start);
      if (unlikely(__pyx_t_1)) {

        /* "HTSeq/_HTSeq.pyx":474
 *                 start = index_slice.start
 *                 if start < self.iv.start:
 *                     raise IndexError("start too small")             # <<<<<<<<<<<<<<
 * 
 *             if index_slice.stop is None:
*/
        __pyx_t_5 = NULL;
        __pyx_t_6 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_start_too_small};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __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;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(0, 474, __pyx_L1_error)

        /* "HTSeq/_HTSeq.pyx":473
 *             else:
 *                 start = index_slice.start
 *                 if start < self.iv.start:             # <<<<<<<<<<<<<<
 *                     raise IndexError("start too small")
 * 
*/
      }
    }
    __pyx_L7:;

    /* "HTSeq/_HTSeq.pyx":476
 *                     raise IndexError("start too small")
 * 
 *             if index_slice.stop is None:             # <<<<<<<<<<<<<<
 *                 stop = self.iv.end
 *             else:
*/
    __pyx_t_4 = __Pyx_PySlice_Stop(__pyx_v_index_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = (__pyx_t_4 == Py_None);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":477
 * 
 *             if index_slice.stop is None:
 *                 stop = self.iv.end             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = index_slice.stop
*/
      __pyx_t_2 = __pyx_v_self->iv->end;
      __pyx_v_stop = __pyx_t_2;

      /* "HTSeq/_HTSeq.pyx":476
 *                     raise IndexError("start too small")
 * 
 *             if index_slice.stop is None:             # <<<<<<<<<<<<<<
 *                 stop = self.iv.end
 *             else:
*/
      goto __pyx_L9;
    }

    /* "HTSeq/_HTSeq.pyx":479
 *                 stop = self.iv.end
 *             else:
 *                 stop = index_slice.stop             # <<<<<<<<<<<<<<
 *                 if stop > self.iv.end:
 *                     raise IndexError("stop too large")
*/
    /*else*/ {
      __pyx_t_4 = __Pyx_PySlice_Stop(__pyx_v_index_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyLong_As_long(__pyx_t_4); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_stop = __pyx_t_2;

      /* "HTSeq/_HTSeq.pyx":480
 *             else:
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:             # <<<<<<<<<<<<<<
 *                     raise IndexError("stop too large")
 * 
*/
      __pyx_t_1 = (__pyx_v_stop > __pyx_v_self->iv->end);
      if (unlikely(__pyx_t_1)) {

        /* "HTSeq/_HTSeq.pyx":481
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:
 *                     raise IndexError("stop too large")             # <<<<<<<<<<<<<<
 * 
 *             iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)
*/
        __pyx_t_5 = NULL;
        __pyx_t_6 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_stop_too_large};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __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;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(0, 481, __pyx_L1_error)

        /* "HTSeq/_HTSeq.pyx":480
 *             else:
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:             # <<<<<<<<<<<<<<
 *                     raise IndexError("stop too large")
 * 
*/
      }
    }
    __pyx_L9:;

    /* "HTSeq/_HTSeq.pyx":483
 *                     raise IndexError("stop too large")
 * 
 *             iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)             # <<<<<<<<<<<<<<
 * 
 *             if not self.iv.contains(iv):
*/
    __pyx_t_5 = NULL;
    __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyLong_From_long(__pyx_v_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_self->iv->chrom, __pyx_t_7, __pyx_t_8, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_4);
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":485
 *             iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)
 * 
 *             if not self.iv.contains(iv):             # <<<<<<<<<<<<<<
 *                 raise IndexError
 *             return ChromVector._create_view(self, iv)
*/
    __pyx_t_4 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self->iv->__pyx_vtab)->contains(__pyx_v_self->iv, __pyx_v_iv, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 485, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (!__pyx_t_1);
    if (unlikely(__pyx_t_3)) {

      /* "HTSeq/_HTSeq.pyx":486
 * 
 *             if not self.iv.contains(iv):
 *                 raise IndexError             # <<<<<<<<<<<<<<
 *             return ChromVector._create_view(self, iv)
 * 
*/
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_IndexError))), 0, 0, 0);
      __PYX_ERR(0, 486, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":485
 *             iv = GenomicInterval(self.iv.chrom, start, stop, self.iv.strand)
 * 
 *             if not self.iv.contains(iv):             # <<<<<<<<<<<<<<
 *                 raise IndexError
 *             return ChromVector._create_view(self, iv)
*/
    }

    /* "HTSeq/_HTSeq.pyx":487
 *             if not self.iv.contains(iv):
 *                 raise IndexError
 *             return ChromVector._create_view(self, iv)             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(index, GenomicInterval):
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_9, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_iv)};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_create_view, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":467
 *             return self.array[index_int - self.offset]
 * 
 *         elif isinstance(index, slice):             # <<<<<<<<<<<<<<
 *             index_slice = index
 *             if index_slice.start is None:
*/
  }

  /* "HTSeq/_HTSeq.pyx":489
 *             return ChromVector._create_view(self, iv)
 * 
 *         elif isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *             if not self.iv.contains(index):
 *                 raise IndexError
*/
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_index, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); 
  if (likely(__pyx_t_3)) {

    /* "HTSeq/_HTSeq.pyx":490
 * 
 *         elif isinstance(index, GenomicInterval):
 *             if not self.iv.contains(index):             # <<<<<<<<<<<<<<
 *                 raise IndexError
 * 
*/
    if (!(likely(((__pyx_v_index) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_index, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 490, __pyx_L1_error)
    __pyx_t_4 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_self->iv->__pyx_vtab)->contains(__pyx_v_self->iv, ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_v_index), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = (!__pyx_t_3);
    if (unlikely(__pyx_t_1)) {

      /* "HTSeq/_HTSeq.pyx":491
 *         elif isinstance(index, GenomicInterval):
 *             if not self.iv.contains(index):
 *                 raise IndexError             # <<<<<<<<<<<<<<
 * 
 *             if self.iv.strand is strand_nostrand and \
*/
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_IndexError))), 0, 0, 0);
      __PYX_ERR(0, 491, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":490
 * 
 *         elif isinstance(index, GenomicInterval):
 *             if not self.iv.contains(index):             # <<<<<<<<<<<<<<
 *                 raise IndexError
 * 
*/
    }

    /* "HTSeq/_HTSeq.pyx":493
 *                 raise IndexError
 * 
 *             if self.iv.strand is strand_nostrand and \             # <<<<<<<<<<<<<<
 *                     index.strand is not strand_nostrand:
 *                 iv = index.copy()   # Is this correct now?
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = (__pyx_t_4 == __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L14_bool_binop_done;
    }

    /* "HTSeq/_HTSeq.pyx":494
 * 
 *             if self.iv.strand is strand_nostrand and \
 *                     index.strand is not strand_nostrand:             # <<<<<<<<<<<<<<
 *                 iv = index.copy()   # Is this correct now?
 *                 iv.strand = strand_nostrand
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = (__pyx_t_4 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L14_bool_binop_done:;

    /* "HTSeq/_HTSeq.pyx":493
 *                 raise IndexError
 * 
 *             if self.iv.strand is strand_nostrand and \             # <<<<<<<<<<<<<<
 *                     index.strand is not strand_nostrand:
 *                 iv = index.copy()   # Is this correct now?
*/
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":495
 *             if self.iv.strand is strand_nostrand and \
 *                     index.strand is not strand_nostrand:
 *                 iv = index.copy()   # Is this correct now?             # <<<<<<<<<<<<<<
 *                 iv.strand = strand_nostrand
 *             else:
*/
      __pyx_t_9 = __pyx_v_index;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 495, __pyx_L1_error)
      __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":496
 *                     index.strand is not strand_nostrand:
 *                 iv = index.copy()   # Is this correct now?
 *                 iv.strand = strand_nostrand             # <<<<<<<<<<<<<<
 *             else:
 *                 iv = index
*/
      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_strand, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand) < (0)) __PYX_ERR(0, 496, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":493
 *                 raise IndexError
 * 
 *             if self.iv.strand is strand_nostrand and \             # <<<<<<<<<<<<<<
 *                     index.strand is not strand_nostrand:
 *                 iv = index.copy()   # Is this correct now?
*/
      goto __pyx_L13;
    }

    /* "HTSeq/_HTSeq.pyx":498
 *                 iv.strand = strand_nostrand
 *             else:
 *                 iv = index             # <<<<<<<<<<<<<<
 * 
 *             return ChromVector._create_view(self, iv)
*/
    /*else*/ {
      __pyx_t_4 = __pyx_v_index;
      __Pyx_INCREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 498, __pyx_L1_error)
      __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L13:;

    /* "HTSeq/_HTSeq.pyx":500
 *                 iv = index
 * 
 *             return ChromVector._create_view(self, iv)             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_9, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_iv)};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_create_view, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":489
 *             return ChromVector._create_view(self, iv)
 * 
 *         elif isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *             if not self.iv.contains(index):
 *                 raise IndexError
*/
  }

  /* "HTSeq/_HTSeq.pyx":503
 * 
 *         else:
 *             raise TypeError("Illegal index type")             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, index, value):
*/
  /*else*/ {
    __pyx_t_9 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Illegal_index_type};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 503, __pyx_L1_error)
  }

  /* "HTSeq/_HTSeq.pyx":443
 *         self.array = array
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         """Index or slice the chromosome.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __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("HTSeq._HTSeq.ChromVector.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index_slice);
  __Pyx_XDECREF((PyObject *)__pyx_v_iv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":505
 *             raise TypeError("Illegal index type")
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef slice index_slice
 *         cdef long int start, stop
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__setitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__setitem__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_index_slice = 0;
  long __pyx_v_start;
  long __pyx_v_stop;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  long __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "HTSeq/_HTSeq.pyx":509
 *         cdef long int start, stop
 * 
 *         if isinstance(value, ChromVector):             # <<<<<<<<<<<<<<
 *             if self.array is value.array and value.iv.start == index.start and \
 *                     value.iv.end == index.stop and (index.step is None or index.step == 1):
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector); 
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":510
 * 
 *         if isinstance(value, ChromVector):
 *             if self.array is value.array and value.iv.start == index.start and \             # <<<<<<<<<<<<<<
 *                     value.iv.end == index.stop and (index.step is None or index.step == 1):
 *                 return
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = (__pyx_v_self->array == __pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_mstate_global->__pyx_n_u_iv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }

    /* "HTSeq/_HTSeq.pyx":511
 *         if isinstance(value, ChromVector):
 *             if self.array is value.array and value.iv.start == index.start and \
 *                     value.iv.end == index.stop and (index.step is None or index.step == 1):             # <<<<<<<<<<<<<<
 *                 return
 *             else:
*/
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_mstate_global->__pyx_n_u_iv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = (__pyx_t_4 == Py_None);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;

    /* "HTSeq/_HTSeq.pyx":510
 * 
 *         if isinstance(value, ChromVector):
 *             if self.array is value.array and value.iv.start == index.start and \             # <<<<<<<<<<<<<<
 *                     value.iv.end == index.stop and (index.step is None or index.step == 1):
 *                 return
*/
    if (likely(__pyx_t_1)) {

      /* "HTSeq/_HTSeq.pyx":512
 *             if self.array is value.array and value.iv.start == index.start and \
 *                     value.iv.end == index.stop and (index.step is None or index.step == 1):
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 raise NotImplementedError(
*/
      __pyx_r = 0;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":510
 * 
 *         if isinstance(value, ChromVector):
 *             if self.array is value.array and value.iv.start == index.start and \             # <<<<<<<<<<<<<<
 *                     value.iv.end == index.stop and (index.step is None or index.step == 1):
 *                 return
*/
    }

    /* "HTSeq/_HTSeq.pyx":514
 *                 return
 *             else:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "Required assignment signature not yet implemented.")
 * 
*/
    /*else*/ {
      __pyx_t_5 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Required_assignment_signature_no};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __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;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 514, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 514, __pyx_L1_error)
    }

    /* "HTSeq/_HTSeq.pyx":509
 *         cdef long int start, stop
 * 
 *         if isinstance(value, ChromVector):             # <<<<<<<<<<<<<<
 *             if self.array is value.array and value.iv.start == index.start and \
 *                     value.iv.end == index.stop and (index.step is None or index.step == 1):
*/
  }

  /* "HTSeq/_HTSeq.pyx":517
 *                     "Required assignment signature not yet implemented.")
 * 
 *         if isinstance(index, int):             # <<<<<<<<<<<<<<
 *             self.array[index - self.iv.start] = value
 * 
*/
  __pyx_t_1 = PyLong_Check(__pyx_v_index); 
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":518
 * 
 *         if isinstance(index, int):
 *             self.array[index - self.iv.start] = value             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(index, slice):
*/
    __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_index, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely((PyObject_SetItem(__pyx_v_self->array, __pyx_t_5, __pyx_v_value) < 0))) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":517
 *                     "Required assignment signature not yet implemented.")
 * 
 *         if isinstance(index, int):             # <<<<<<<<<<<<<<
 *             self.array[index - self.iv.start] = value
 * 
*/
    goto __pyx_L10;
  }

  /* "HTSeq/_HTSeq.pyx":520
 *             self.array[index - self.iv.start] = value
 * 
 *         elif isinstance(index, slice):             # <<<<<<<<<<<<<<
 *             index_slice = index
 *             if index_slice.start is not None:
*/
  __pyx_t_1 = PySlice_Check(__pyx_v_index); 
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":521
 * 
 *         elif isinstance(index, slice):
 *             index_slice = index             # <<<<<<<<<<<<<<
 *             if index_slice.start is not None:
 *                 start = index_slice.start
*/
    __pyx_t_5 = __pyx_v_index;
    __Pyx_INCREF(__pyx_t_5);
    if (!(likely(PySlice_Check(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("slice", __pyx_t_5))) __PYX_ERR(0, 521, __pyx_L1_error)
    __pyx_v_index_slice = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":522
 *         elif isinstance(index, slice):
 *             index_slice = index
 *             if index_slice.start is not None:             # <<<<<<<<<<<<<<
 *                 start = index_slice.start
 *                 if start < self.iv.start:
*/
    __pyx_t_5 = __Pyx_PySlice_Start(__pyx_v_index_slice); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = (__pyx_t_5 != Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":523
 *             index_slice = index
 *             if index_slice.start is not None:
 *                 start = index_slice.start             # <<<<<<<<<<<<<<
 *                 if start < self.iv.start:
 *                     raise IndexError("start too small")
*/
      __pyx_t_5 = __Pyx_PySlice_Start(__pyx_v_index_slice); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyLong_As_long(__pyx_t_5); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_start = __pyx_t_7;

      /* "HTSeq/_HTSeq.pyx":524
 *             if index_slice.start is not None:
 *                 start = index_slice.start
 *                 if start < self.iv.start:             # <<<<<<<<<<<<<<
 *                     raise IndexError("start too small")
 *             else:
*/
      __pyx_t_1 = (__pyx_v_start < __pyx_v_self->iv->start);
      if (unlikely(__pyx_t_1)) {

        /* "HTSeq/_HTSeq.pyx":525
 *                 start = index_slice.start
 *                 if start < self.iv.start:
 *                     raise IndexError("start too small")             # <<<<<<<<<<<<<<
 *             else:
 *                 start = self.iv.start
*/
        __pyx_t_4 = NULL;
        __pyx_t_6 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_start_too_small};
          __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(0, 525, __pyx_L1_error)

        /* "HTSeq/_HTSeq.pyx":524
 *             if index_slice.start is not None:
 *                 start = index_slice.start
 *                 if start < self.iv.start:             # <<<<<<<<<<<<<<
 *                     raise IndexError("start too small")
 *             else:
*/
      }

      /* "HTSeq/_HTSeq.pyx":522
 *         elif isinstance(index, slice):
 *             index_slice = index
 *             if index_slice.start is not None:             # <<<<<<<<<<<<<<
 *                 start = index_slice.start
 *                 if start < self.iv.start:
*/
      goto __pyx_L11;
    }

    /* "HTSeq/_HTSeq.pyx":527
 *                     raise IndexError("start too small")
 *             else:
 *                 start = self.iv.start             # <<<<<<<<<<<<<<
 *             if index_slice.stop is not None:
 *                 stop = index_slice.stop
*/
    /*else*/ {
      __pyx_t_7 = __pyx_v_self->iv->start;
      __pyx_v_start = __pyx_t_7;
    }
    __pyx_L11:;

    /* "HTSeq/_HTSeq.pyx":528
 *             else:
 *                 start = self.iv.start
 *             if index_slice.stop is not None:             # <<<<<<<<<<<<<<
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:
*/
    __pyx_t_5 = __Pyx_PySlice_Stop(__pyx_v_index_slice); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = (__pyx_t_5 != Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":529
 *                 start = self.iv.start
 *             if index_slice.stop is not None:
 *                 stop = index_slice.stop             # <<<<<<<<<<<<<<
 *                 if stop > self.iv.end:
 *                     raise IndexError("stop too large")
*/
      __pyx_t_5 = __Pyx_PySlice_Stop(__pyx_v_index_slice); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyLong_As_long(__pyx_t_5); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 529, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_stop = __pyx_t_7;

      /* "HTSeq/_HTSeq.pyx":530
 *             if index_slice.stop is not None:
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:             # <<<<<<<<<<<<<<
 *                     raise IndexError("stop too large")
 *             else:
*/
      __pyx_t_1 = (__pyx_v_stop > __pyx_v_self->iv->end);
      if (unlikely(__pyx_t_1)) {

        /* "HTSeq/_HTSeq.pyx":531
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:
 *                     raise IndexError("stop too large")             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = self.iv.end
*/
        __pyx_t_4 = NULL;
        __pyx_t_6 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_stop_too_large};
          __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(0, 531, __pyx_L1_error)

        /* "HTSeq/_HTSeq.pyx":530
 *             if index_slice.stop is not None:
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:             # <<<<<<<<<<<<<<
 *                     raise IndexError("stop too large")
 *             else:
*/
      }

      /* "HTSeq/_HTSeq.pyx":528
 *             else:
 *                 start = self.iv.start
 *             if index_slice.stop is not None:             # <<<<<<<<<<<<<<
 *                 stop = index_slice.stop
 *                 if stop > self.iv.end:
*/
      goto __pyx_L13;
    }

    /* "HTSeq/_HTSeq.pyx":533
 *                     raise IndexError("stop too large")
 *             else:
 *                 stop = self.iv.end             # <<<<<<<<<<<<<<
 *             if start > stop:
 *                 raise IndexError("Start of interval is after its end.")
*/
    /*else*/ {
      __pyx_t_7 = __pyx_v_self->iv->end;
      __pyx_v_stop = __pyx_t_7;
    }
    __pyx_L13:;

    /* "HTSeq/_HTSeq.pyx":534
 *             else:
 *                 stop = self.iv.end
 *             if start > stop:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Start of interval is after its end.")
 *             if start == stop:
*/
    __pyx_t_1 = (__pyx_v_start > __pyx_v_stop);
    if (unlikely(__pyx_t_1)) {

      /* "HTSeq/_HTSeq.pyx":535
 *                 stop = self.iv.end
 *             if start > stop:
 *                 raise IndexError("Start of interval is after its end.")             # <<<<<<<<<<<<<<
 *             if start == stop:
 *                 raise IndexError("Cannot assign to zero-length interval.")
*/
      __pyx_t_4 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Start_of_interval_is_after_its_e};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 535, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":534
 *             else:
 *                 stop = self.iv.end
 *             if start > stop:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Start of interval is after its end.")
 *             if start == stop:
*/
    }

    /* "HTSeq/_HTSeq.pyx":536
 *             if start > stop:
 *                 raise IndexError("Start of interval is after its end.")
 *             if start == stop:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Cannot assign to zero-length interval.")
 *             self.array[start - self.offset: stop -
*/
    __pyx_t_1 = (__pyx_v_start == __pyx_v_stop);
    if (unlikely(__pyx_t_1)) {

      /* "HTSeq/_HTSeq.pyx":537
 *                 raise IndexError("Start of interval is after its end.")
 *             if start == stop:
 *                 raise IndexError("Cannot assign to zero-length interval.")             # <<<<<<<<<<<<<<
 *             self.array[start - self.offset: stop -
 *                        self.iv.start: index.step] = value
*/
      __pyx_t_4 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_zero_length_int};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 537, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":536
 *             if start > stop:
 *                 raise IndexError("Start of interval is after its end.")
 *             if start == stop:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Cannot assign to zero-length interval.")
 *             self.array[start - self.offset: stop -
*/
    }

    /* "HTSeq/_HTSeq.pyx":538
 *             if start == stop:
 *                 raise IndexError("Cannot assign to zero-length interval.")
 *             self.array[start - self.offset: stop -             # <<<<<<<<<<<<<<
 *                        self.iv.start: index.step] = value
 * 
*/
    __pyx_t_5 = __Pyx_PyLong_From_long((__pyx_v_start - __pyx_v_self->offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "HTSeq/_HTSeq.pyx":539
 *                 raise IndexError("Cannot assign to zero-length interval.")
 *             self.array[start - self.offset: stop -
 *                        self.iv.start: index.step] = value             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(index, GenomicInterval):
*/
    __pyx_t_4 = __Pyx_PyLong_From_long((__pyx_v_stop - __pyx_v_self->iv->start)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "HTSeq/_HTSeq.pyx":538
 *             if start == stop:
 *                 raise IndexError("Cannot assign to zero-length interval.")
 *             self.array[start - self.offset: stop -             # <<<<<<<<<<<<<<
 *                        self.iv.start: index.step] = value
 * 
*/
    __pyx_t_8 = PySlice_New(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely((PyObject_SetItem(__pyx_v_self->array, __pyx_t_8, __pyx_v_value) < 0))) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "HTSeq/_HTSeq.pyx":520
 *             self.array[index - self.iv.start] = value
 * 
 *         elif isinstance(index, slice):             # <<<<<<<<<<<<<<
 *             index_slice = index
 *             if index_slice.start is not None:
*/
    goto __pyx_L10;
  }

  /* "HTSeq/_HTSeq.pyx":541
 *                        self.iv.start: index.step] = value
 * 
 *         elif isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *             if index.chrom != self.iv.chrom:
 *                 raise KeyError("Chromosome name mismatch.")
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_index, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); 
  if (likely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":542
 * 
 *         elif isinstance(index, GenomicInterval):
 *             if index.chrom != self.iv.chrom:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Chromosome name mismatch.")
 *             if self.iv.strand is not strand_nostrand and \
*/
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_v_self->iv->chrom, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(__pyx_t_1)) {

      /* "HTSeq/_HTSeq.pyx":543
 *         elif isinstance(index, GenomicInterval):
 *             if index.chrom != self.iv.chrom:
 *                 raise KeyError("Chromosome name mismatch.")             # <<<<<<<<<<<<<<
 *             if self.iv.strand is not strand_nostrand and \
 *                     self.iv.strand is not self.index.strand:
*/
      __pyx_t_2 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Chromosome_name_mismatch};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 543, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(0, 543, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":542
 * 
 *         elif isinstance(index, GenomicInterval):
 *             if index.chrom != self.iv.chrom:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Chromosome name mismatch.")
 *             if self.iv.strand is not strand_nostrand and \
*/
    }

    /* "HTSeq/_HTSeq.pyx":544
 *             if index.chrom != self.iv.chrom:
 *                 raise KeyError("Chromosome name mismatch.")
 *             if self.iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                     self.iv.strand is not self.index.strand:
 *                 raise KeyError("Strand mismatch.")
*/
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = (__pyx_t_8 != __pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L19_bool_binop_done;
    }

    /* "HTSeq/_HTSeq.pyx":545
 *                 raise KeyError("Chromosome name mismatch.")
 *             if self.iv.strand is not strand_nostrand and \
 *                     self.iv.strand is not self.index.strand:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Strand mismatch.")
 *             self.array[index.iv.start - self.iv.start,
*/
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = (__pyx_t_8 != __pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L19_bool_binop_done:;

    /* "HTSeq/_HTSeq.pyx":544
 *             if index.chrom != self.iv.chrom:
 *                 raise KeyError("Chromosome name mismatch.")
 *             if self.iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                     self.iv.strand is not self.index.strand:
 *                 raise KeyError("Strand mismatch.")
*/
    if (unlikely(__pyx_t_1)) {

      /* "HTSeq/_HTSeq.pyx":546
 *             if self.iv.strand is not strand_nostrand and \
 *                     self.iv.strand is not self.index.strand:
 *                 raise KeyError("Strand mismatch.")             # <<<<<<<<<<<<<<
 *             self.array[index.iv.start - self.iv.start,
 *                        index.iv.end - self.iv.start] = value
*/
      __pyx_t_8 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Strand_mismatch};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 546, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":544
 *             if index.chrom != self.iv.chrom:
 *                 raise KeyError("Chromosome name mismatch.")
 *             if self.iv.strand is not strand_nostrand and \             # <<<<<<<<<<<<<<
 *                     self.iv.strand is not self.index.strand:
 *                 raise KeyError("Strand mismatch.")
*/
    }

    /* "HTSeq/_HTSeq.pyx":547
 *                     self.iv.strand is not self.index.strand:
 *                 raise KeyError("Strand mismatch.")
 *             self.array[index.iv.start - self.iv.start,             # <<<<<<<<<<<<<<
 *                        index.iv.end - self.iv.start] = value
 *         else:
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_iv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":548
 *                 raise KeyError("Strand mismatch.")
 *             self.array[index.iv.start - self.iv.start,
 *                        index.iv.end - self.iv.start] = value             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("Illegal index type")
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_iv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_self->iv->start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":547
 *                     self.iv.strand is not self.index.strand:
 *                 raise KeyError("Strand mismatch.")
 *             self.array[index.iv.start - self.iv.start,             # <<<<<<<<<<<<<<
 *                        index.iv.end - self.iv.start] = value
 *         else:
*/
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 547, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 547, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    if (unlikely((PyObject_SetItem(__pyx_v_self->array, __pyx_t_4, __pyx_v_value) < 0))) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":541
 *                        self.iv.start: index.step] = value
 * 
 *         elif isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *             if index.chrom != self.iv.chrom:
 *                 raise KeyError("Chromosome name mismatch.")
*/
    goto __pyx_L10;
  }

  /* "HTSeq/_HTSeq.pyx":550
 *                        index.iv.end - self.iv.start] = value
 *         else:
 *             raise TypeError("Illegal index type")             # <<<<<<<<<<<<<<
 * 
 *     def __iadd__(self, value):
*/
  /*else*/ {
    __pyx_t_5 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Illegal_index_type};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 550, __pyx_L1_error)
  }
  __pyx_L10:;

  /* "HTSeq/_HTSeq.pyx":505
 *             raise TypeError("Illegal index type")
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef slice index_slice
 *         cdef long int start, stop
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index_slice);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":552
 *             raise TypeError("Illegal index type")
 * 
 *     def __iadd__(self, value):             # <<<<<<<<<<<<<<
 *         if not self.is_vector_of_sets:
 *             self.array[self.iv.start - self.offset: self.iv.end -
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_11__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_11__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10__iadd__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

/* "HTSeq/_HTSeq.pyx":557
 *                        self.offset].__iadd__(value)
 *         else:
 *             def addval(x):             # <<<<<<<<<<<<<<
 *                 y = x.copy()
 *                 y.add(value)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval(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_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval = {"addval", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval(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_x = 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("addval (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_x,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, 557, __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, 557, __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, "addval", 0) < (0)) __PYX_ERR(0, 557, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addval", 1, 1, 1, i); __PYX_ERR(0, 557, __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, 557, __pyx_L3_error)
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addval", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 557, __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("HTSeq._HTSeq.ChromVector.__iadd__.addval", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8__iadd___addval(__pyx_self, __pyx_v_x);

  /* 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_5HTSeq_6_HTSeq_11ChromVector_8__iadd___addval(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *__pyx_cur_scope;
  struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *__pyx_outer_scope;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("addval", 0);
  __pyx_outer_scope = (struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "HTSeq/_HTSeq.pyx":558
 *         else:
 *             def addval(x):
 *                 y = x.copy()             # <<<<<<<<<<<<<<
 *                 y.add(value)
 *                 return y
*/
  __pyx_t_2 = __pyx_v_x;
  __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_copy, __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, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_y = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":559
 *             def addval(x):
 *                 y = x.copy()
 *                 y.add(value)             # <<<<<<<<<<<<<<
 *                 return y
 * 
*/
  __pyx_t_2 = __pyx_v_y;
  __Pyx_INCREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 559, __pyx_L1_error) }
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":560
 *                 y = x.copy()
 *                 y.add(value)
 *                 return y             # <<<<<<<<<<<<<<
 * 
 *             self.apply(addval)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_y);
  __pyx_r = __pyx_v_y;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":557
 *                        self.offset].__iadd__(value)
 *         else:
 *             def addval(x):             # <<<<<<<<<<<<<<
 *                 y = x.copy()
 *                 y.add(value)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__iadd__.addval", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":552
 *             raise TypeError("Illegal index type")
 * 
 *     def __iadd__(self, value):             # <<<<<<<<<<<<<<
 *         if not self.is_vector_of_sets:
 *             self.array[self.iv.start - self.offset: self.iv.end -
*/

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10__iadd__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
  struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *__pyx_cur_scope;
  PyObject *__pyx_v_addval = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iadd__", 0);
  __pyx_cur_scope = (struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)__pyx_tp_new_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 552, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);

  /* "HTSeq/_HTSeq.pyx":553
 * 
 *     def __iadd__(self, value):
 *         if not self.is_vector_of_sets:             # <<<<<<<<<<<<<<
 *             self.array[self.iv.start - self.offset: self.iv.end -
 *                        self.offset].__iadd__(value)
*/
  __pyx_t_1 = (!__pyx_v_self->is_vector_of_sets);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":554
 *     def __iadd__(self, value):
 *         if not self.is_vector_of_sets:
 *             self.array[self.iv.start - self.offset: self.iv.end -             # <<<<<<<<<<<<<<
 *                        self.offset].__iadd__(value)
 *         else:
*/
    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_self->array, (__pyx_v_self->iv->start - __pyx_v_self->offset), (__pyx_v_self->iv->end - __pyx_v_self->offset), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __Pyx_INCREF(__pyx_t_3);

    /* "HTSeq/_HTSeq.pyx":555
 *         if not self.is_vector_of_sets:
 *             self.array[self.iv.start - self.offset: self.iv.end -
 *                        self.offset].__iadd__(value)             # <<<<<<<<<<<<<<
 *         else:
 *             def addval(x):
*/
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_value};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_iadd, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":553
 * 
 *     def __iadd__(self, value):
 *         if not self.is_vector_of_sets:             # <<<<<<<<<<<<<<
 *             self.array[self.iv.start - self.offset: self.iv.end -
 *                        self.offset].__iadd__(value)
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":557
 *                        self.offset].__iadd__(value)
 *         else:
 *             def addval(x):             # <<<<<<<<<<<<<<
 *                 y = x.copy()
 *                 y.add(value)
*/
  /*else*/ {
    __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_8__iadd___1addval, 0, __pyx_mstate_global->__pyx_n_u_iadd___locals_addval, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_addval = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":562
 *                 return y
 * 
 *             self.apply(addval)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_addval};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_apply, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":563
 * 
 *             self.apply(addval)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":552
 *             raise TypeError("Illegal index type")
 * 
 *     def __iadd__(self, value):             # <<<<<<<<<<<<<<
 *         if not self.is_vector_of_sets:
 *             self.array[self.iv.start - self.offset: self.iv.end -
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_addval);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":565
 *         return self
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.values()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_13__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_13__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_12__iter__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":566
 * 
 *     def __iter__(self):
 *         return self.values()             # <<<<<<<<<<<<<<
 * 
 *     def values(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_values, __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, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":565
 *         return self
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.values()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":568
 *         return self.values()
 * 
 *     def values(self):             # <<<<<<<<<<<<<<
 *         return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_15values(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_5HTSeq_6_HTSeq_11ChromVector_15values = {"values", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_15values, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_15values(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("values (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("values", 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("values", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_14values(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_14values(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("values", 0);

  /* "HTSeq/_HTSeq.pyx":569
 * 
 *     def values(self):
 *         return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])             # <<<<<<<<<<<<<<
 * 
 *     def steps(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_self->array, (__pyx_v_self->iv->start - __pyx_v_self->offset), (__pyx_v_self->iv->end - __pyx_v_self->offset), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":568
 *         return self.values()
 * 
 *     def values(self):             # <<<<<<<<<<<<<<
 *         return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":571
 *         return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])
 * 
 *     def steps(self):             # <<<<<<<<<<<<<<
 *         return _HTSeq_internal.ChromVector_steps(self)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17steps(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_5HTSeq_6_HTSeq_11ChromVector_17steps = {"steps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17steps, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17steps(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("steps (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("steps", 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("steps", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_16steps(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":572
 * 
 *     def steps(self):
 *         return _HTSeq_internal.ChromVector_steps(self)             # <<<<<<<<<<<<<<
 * 
 *     def apply(self, fun):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_HTSeq_internal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ChromVector_steps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":571
 *         return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])
 * 
 *     def steps(self):             # <<<<<<<<<<<<<<
 *         return _HTSeq_internal.ChromVector_steps(self)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":574
 *         return _HTSeq_internal.ChromVector_steps(self)
 * 
 *     def apply(self, fun):             # <<<<<<<<<<<<<<
 *         for iv, value in self.steps():
 *             self.array[iv.start - self.offset: iv.end -
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_19apply(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_5HTSeq_6_HTSeq_11ChromVector_19apply = {"apply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_19apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_19apply(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_fun = 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("apply (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_fun,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, 574, __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, 574, __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, "apply", 0) < (0)) __PYX_ERR(0, 574, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("apply", 1, 1, 1, i); __PYX_ERR(0, 574, __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, 574, __pyx_L3_error)
    }
    __pyx_v_fun = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("apply", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 574, __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("HTSeq._HTSeq.ChromVector.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_18apply(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), __pyx_v_fun);

  /* 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_5HTSeq_6_HTSeq_11ChromVector_18apply(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_fun) {
  PyObject *__pyx_v_iv = NULL;
  PyObject *__pyx_v_value = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("apply", 0);

  /* "HTSeq/_HTSeq.pyx":575
 * 
 *     def apply(self, fun):
 *         for iv, value in self.steps():             # <<<<<<<<<<<<<<
 *             self.array[iv.start - self.offset: iv.end -
 *                        self.offset] = fun(value)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_steps, __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, 575, __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, 575, __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, 575, __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, 575, __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, 575, __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, 575, __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, 575, __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, 575, __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, 575, __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, 575, __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, 575, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 575, __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, 575, __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, 575, __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, 575, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_iv, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":577
 *         for iv, value in self.steps():
 *             self.array[iv.start - self.offset: iv.end -
 *                        self.offset] = fun(value)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
    __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_v_fun);
    __pyx_t_6 = __pyx_v_fun; 
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_value};
      __pyx_t_1 = __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_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }

    /* "HTSeq/_HTSeq.pyx":576
 *     def apply(self, fun):
 *         for iv, value in self.steps():
 *             self.array[iv.start - self.offset: iv.end -             # <<<<<<<<<<<<<<
 *                        self.offset] = fun(value)
 * 
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyNumber_Subtract(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "HTSeq/_HTSeq.pyx":577
 *         for iv, value in self.steps():
 *             self.array[iv.start - self.offset: iv.end -
 *                        self.offset] = fun(value)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
    __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "HTSeq/_HTSeq.pyx":576
 *     def apply(self, fun):
 *         for iv, value in self.steps():
 *             self.array[iv.start - self.offset: iv.end -             # <<<<<<<<<<<<<<
 *                        self.offset] = fun(value)
 * 
*/
    __pyx_t_10 = PyNumber_Subtract(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__Pyx_PyObject_SetSlice(__pyx_v_self->array, __pyx_t_1, 0, 0, &__pyx_t_8, &__pyx_t_10, NULL, 0, 0, 1) < (0)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":575
 * 
 *     def apply(self, fun):
 *         for iv, value in self.steps():             # <<<<<<<<<<<<<<
 *             self.array[iv.start - self.offset: iv.end -
 *                        self.offset] = fun(value)
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":574
 *         return _HTSeq_internal.ChromVector_steps(self)
 * 
 *     def apply(self, fun):             # <<<<<<<<<<<<<<
 *         for iv, value in self.steps():
 *             self.array[iv.start - self.offset: iv.end -
*/

  /* 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_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_iv);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":579
 *                        self.offset] = fun(value)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage)
 * 
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_20__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[7];
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":580
 * 
 *     def __repr__(self):
 *         return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self->iv)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_self->_storage); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_4[1] = __pyx_t_1;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_object_2;
  __pyx_t_4[3] = __pyx_t_2;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__14;
  __pyx_t_4[5] = __pyx_t_3;
  __pyx_t_4[6] = __pyx_mstate_global->__pyx_kp_u__15;
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":579
 *                        self.offset] = fun(value)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage)
 * 
*/

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

/* "HTSeq/_HTSeq.pyx":582
 *         return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         assert self.__class__ is ChromVector
 *         return(_ChromVector_unpickle,
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_23__reduce__(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_5HTSeq_6_HTSeq_11ChromVector_23__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_23__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_23__reduce__(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__ (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__", 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__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_22__reduce__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":583
 * 
 *     def __reduce__(self):
 *         assert self.__class__ is ChromVector             # <<<<<<<<<<<<<<
 *         return(_ChromVector_unpickle,
 *                (self.array, self.iv, self.offset, self.is_vector_of_sets, self._storage))
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__pyx_t_1 == ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 583, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 583, __pyx_L1_error)
  #endif

  /* "HTSeq/_HTSeq.pyx":584
 *     def __reduce__(self):
 *         assert self.__class__ is ChromVector
 *         return(_ChromVector_unpickle,             # <<<<<<<<<<<<<<
 *                (self.array, self.iv, self.offset, self.is_vector_of_sets, self._storage))
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ChromVector_unpickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "HTSeq/_HTSeq.pyx":585
 *         assert self.__class__ is ChromVector
 *         return(_ChromVector_unpickle,
 *                (self.array, self.iv, self.offset, self.is_vector_of_sets, self._storage))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->is_vector_of_sets); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->array);
  __Pyx_GIVEREF(__pyx_v_self->array);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->array) != (0)) __PYX_ERR(0, 585, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->iv);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->iv);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->iv)) != (0)) __PYX_ERR(0, 585, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 585, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4) != (0)) __PYX_ERR(0, 585, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_storage);
  __Pyx_GIVEREF(__pyx_v_self->_storage);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_self->_storage) != (0)) __PYX_ERR(0, 585, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":584
 *     def __reduce__(self):
 *         assert self.__class__ is ChromVector
 *         return(_ChromVector_unpickle,             # <<<<<<<<<<<<<<
 *                (self.array, self.iv, self.offset, self.is_vector_of_sets, self._storage))
 * 
*/
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 584, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 584, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":582
 *         return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         assert self.__class__ is ChromVector
 *         return(_ChromVector_unpickle,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":319
 *     """
 * 
 *     cdef public object array             # <<<<<<<<<<<<<<
 *     cdef public GenomicInterval iv
 *     cdef public int offset
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->array);
  __pyx_r = __pyx_v_self->array;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->array);
  __Pyx_DECREF(__pyx_v_self->array);
  __pyx_v_self->array = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_5array_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->array);
  __Pyx_DECREF(__pyx_v_self->array);
  __pyx_v_self->array = Py_None;

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

/* "HTSeq/_HTSeq.pyx":320
 * 
 *     cdef public object array
 *     cdef public GenomicInterval iv             # <<<<<<<<<<<<<<
 *     cdef public int offset
 *     cdef public bint is_vector_of_sets
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->iv);
  __pyx_r = ((PyObject *)__pyx_v_self->iv);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 320, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->iv);
  __Pyx_DECREF((PyObject *)__pyx_v_self->iv);
  __pyx_v_self->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.iv.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_2iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->iv);
  __Pyx_DECREF((PyObject *)__pyx_v_self->iv);
  __pyx_v_self->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);

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

/* "HTSeq/_HTSeq.pyx":321
 *     cdef public object array
 *     cdef public GenomicInterval iv
 *     cdef public int offset             # <<<<<<<<<<<<<<
 *     cdef public bint is_vector_of_sets
 *     cdef public str _storage
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_6offset_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error)
  __pyx_v_self->offset = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":322
 *     cdef public GenomicInterval iv
 *     cdef public int offset
 *     cdef public bint is_vector_of_sets             # <<<<<<<<<<<<<<
 *     cdef public str _storage
 *     cdef public str typecode
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_vector_of_sets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.is_vector_of_sets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 322, __pyx_L1_error)
  __pyx_v_self->is_vector_of_sets = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.is_vector_of_sets.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":323
 *     cdef public int offset
 *     cdef public bint is_vector_of_sets
 *     cdef public str _storage             # <<<<<<<<<<<<<<
 *     cdef public str typecode
 *     cdef public str memmap_dir
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_storage);
  __pyx_r = __pyx_v_self->_storage;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_storage);
  __Pyx_DECREF(__pyx_v_self->_storage);
  __pyx_v_self->_storage = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector._storage.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8_storage_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_storage);
  __Pyx_DECREF(__pyx_v_self->_storage);
  __pyx_v_self->_storage = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pyx":324
 *     cdef public bint is_vector_of_sets
 *     cdef public str _storage
 *     cdef public str typecode             # <<<<<<<<<<<<<<
 *     cdef public str memmap_dir
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8typecode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8typecode_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8typecode___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8typecode___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->typecode);
  __pyx_r = __pyx_v_self->typecode;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8typecode_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8typecode_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8typecode_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8typecode_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 324, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->typecode);
  __Pyx_DECREF(__pyx_v_self->typecode);
  __pyx_v_self->typecode = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.typecode.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8typecode_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8typecode_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8typecode_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_8typecode_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->typecode);
  __Pyx_DECREF(__pyx_v_self->typecode);
  __pyx_v_self->typecode = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pyx":325
 *     cdef public str _storage
 *     cdef public str typecode
 *     cdef public str memmap_dir             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir___get__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->memmap_dir);
  __pyx_r = __pyx_v_self->memmap_dir;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->memmap_dir);
  __Pyx_DECREF(__pyx_v_self->memmap_dir);
  __pyx_v_self->memmap_dir = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.ChromVector.memmap_dir.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->memmap_dir);
  __Pyx_DECREF(__pyx_v_self->memmap_dir);
  __pyx_v_self->memmap_dir = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pyx":588
 * 
 * 
 * def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage):             # <<<<<<<<<<<<<<
 *     cv = ChromVector()
 *     cv.array = array
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_3_ChromVector_unpickle(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_5HTSeq_6_HTSeq_3_ChromVector_unpickle = {"_ChromVector_unpickle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_3_ChromVector_unpickle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_3_ChromVector_unpickle(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_array = 0;
  PyObject *__pyx_v_iv = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_is_vector_of_sets = 0;
  PyObject *__pyx_v__storage = 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("_ChromVector_unpickle (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_array,&__pyx_mstate_global->__pyx_n_u_iv,&__pyx_mstate_global->__pyx_n_u_offset,&__pyx_mstate_global->__pyx_n_u_is_vector_of_sets,&__pyx_mstate_global->__pyx_n_u_storage_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, 588, __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, 588, __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, 588, __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, 588, __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, 588, __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, 588, __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, "_ChromVector_unpickle", 0) < (0)) __PYX_ERR(0, 588, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, i); __PYX_ERR(0, 588, __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, 588, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 588, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 588, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 588, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 588, __pyx_L3_error)
    }
    __pyx_v_array = values[0];
    __pyx_v_iv = values[1];
    __pyx_v_offset = values[2];
    __pyx_v_is_vector_of_sets = values[3];
    __pyx_v__storage = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_ChromVector_unpickle", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 588, __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("HTSeq._HTSeq._ChromVector_unpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_2_ChromVector_unpickle(__pyx_self, __pyx_v_array, __pyx_v_iv, __pyx_v_offset, __pyx_v_is_vector_of_sets, __pyx_v__storage);

  /* 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_5HTSeq_6_HTSeq_2_ChromVector_unpickle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_iv, PyObject *__pyx_v_offset, PyObject *__pyx_v_is_vector_of_sets, PyObject *__pyx_v__storage) {
  struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *__pyx_v_cv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ChromVector_unpickle", 0);

  /* "HTSeq/_HTSeq.pyx":589
 * 
 * def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage):
 *     cv = ChromVector()             # <<<<<<<<<<<<<<
 *     cv.array = array
 *     cv.iv = iv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_cv = ((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":590
 * def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage):
 *     cv = ChromVector()
 *     cv.array = array             # <<<<<<<<<<<<<<
 *     cv.iv = iv
 *     cv.offset = offset
*/
  __Pyx_INCREF(__pyx_v_array);
  __Pyx_GIVEREF(__pyx_v_array);
  __Pyx_GOTREF(__pyx_v_cv->array);
  __Pyx_DECREF(__pyx_v_cv->array);
  __pyx_v_cv->array = __pyx_v_array;

  /* "HTSeq/_HTSeq.pyx":591
 *     cv = ChromVector()
 *     cv.array = array
 *     cv.iv = iv             # <<<<<<<<<<<<<<
 *     cv.offset = offset
 *     cv.is_vector_of_sets = is_vector_of_sets
*/
  __pyx_t_1 = __pyx_v_iv;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_cv->iv);
  __Pyx_DECREF((PyObject *)__pyx_v_cv->iv);
  __pyx_v_cv->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":592
 *     cv.array = array
 *     cv.iv = iv
 *     cv.offset = offset             # <<<<<<<<<<<<<<
 *     cv.is_vector_of_sets = is_vector_of_sets
 *     cv._storage = _storage
*/
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_offset); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 592, __pyx_L1_error)
  __pyx_v_cv->offset = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":593
 *     cv.iv = iv
 *     cv.offset = offset
 *     cv.is_vector_of_sets = is_vector_of_sets             # <<<<<<<<<<<<<<
 *     cv._storage = _storage
 *     return cv
*/
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_is_vector_of_sets); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L1_error)
  __pyx_v_cv->is_vector_of_sets = __pyx_t_5;

  /* "HTSeq/_HTSeq.pyx":594
 *     cv.offset = offset
 *     cv.is_vector_of_sets = is_vector_of_sets
 *     cv._storage = _storage             # <<<<<<<<<<<<<<
 *     return cv
 * 
*/
  __pyx_t_1 = __pyx_v__storage;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_cv->_storage);
  __Pyx_DECREF(__pyx_v_cv->_storage);
  __pyx_v_cv->_storage = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":595
 *     cv.is_vector_of_sets = is_vector_of_sets
 *     cv._storage = _storage
 *     return cv             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_cv);
  __pyx_r = ((PyObject *)__pyx_v_cv);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":588
 * 
 * 
 * def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage):             # <<<<<<<<<<<<<<
 *     cv = ChromVector()
 *     cv.array = array
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq._ChromVector_unpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_cv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":624
 *     cdef public str header
 * 
 *     def __init__(self, object chroms, bint stranded=True, str typecode='d',             # <<<<<<<<<<<<<<
 *                  str storage='step', str memmap_dir="", str header=""):
 *         '''GenomicArray(chroms, stranded=True, typecode="d", storage="step", memmap_dir="")
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_5HTSeq_6_HTSeq_12GenomicArray___init__, "GenomicArray(chroms, stranded=True, typecode=\"d\", storage=\"step\", memmap_dir=\"\")\n\n        Initialize GenomicArray\n\n        Args:\n            chroms (str, list, or dict): Chromosomes in the GenomicArray. If\n              'auto', make infinitely long chromosomes upon the first get or\n              set. If 'auto-write', never make new chromosomes upon a get but\n              make large enough chromosomes upon the first set.\n              If a list, make infinitely long chromosomes with those names.\n              If a dict, keys are chromosome names and\n              values are their lengths in base pairs. The first two options are\n              only available for the 'step' storage (see below).\n            stranded (bool): whether the array stores strandedness information.\n            typecode ('d', 'i', 'l', 'b', 'O'): what kind of data the array\n              will contain. 'd' for double, 'i' for int, 'l' for long int, 'b'\n              for boolean, 'O' for arbitrary objects (e.g. sets).\n            storage ('step', 'stretch', 'ndarray', or 'memmap'): What kind of\n              storage to use. 'ndarray' is appropriate for short chromosomes\n              and stores each position in the genome into memory. 'memmap'\n              stores all positions, but maps the memory onto disk for larger\n              chromosomes. 'step' is a sparse representation similar to CSR\n              matrices whereby only the boundaries between genomic stretches\n              with differing data content are stored - see HTSeq.StepVector.\n              'stretch' is a sparse representation with rare, dense 'islands'\n              of data in a sea of missing data along chromosomes.\n            memmap_dir (str): If using 'memmap' storage, what folder to store\n              the memory maps. These can get quite big.\n            header (str): A header with metadata (e.g. when parsing a BedGraph\n              file, having the header helps writing it out with all b""rowser\n              options retained).\n\n        Returns:\n            An instance of GenomicArray with the requested options.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_5HTSeq_6_HTSeq_12GenomicArray___init__;
#endif
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_chroms = 0;
  int __pyx_v_stranded;
  PyObject *__pyx_v_typecode = 0;
  PyObject *__pyx_v_storage = 0;
  PyObject *__pyx_v_memmap_dir = 0;
  PyObject *__pyx_v_header = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_chroms,&__pyx_mstate_global->__pyx_n_u_stranded,&__pyx_mstate_global->__pyx_n_u_typecode,&__pyx_mstate_global->__pyx_n_u_storage,&__pyx_mstate_global->__pyx_n_u_memmap_dir,&__pyx_mstate_global->__pyx_n_u_header,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, 624, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 624, __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, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 624, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_d));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_step));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__12));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, i); __PYX_ERR(0, 624, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 624, __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, 624, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_d));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_step));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__12));
    }
    __pyx_v_chroms = values[0];
    if (values[1]) {
      __pyx_v_stranded = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_stranded == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error)
    } else {
      __pyx_v_stranded = ((int)1);
    }
    __pyx_v_typecode = ((PyObject*)values[2]);
    __pyx_v_storage = ((PyObject*)values[3]);
    __pyx_v_memmap_dir = ((PyObject*)values[4]);
    __pyx_v_header = ((PyObject*)values[5]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 624, __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("HTSeq._HTSeq.GenomicArray.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_typecode), (&PyUnicode_Type), 1, "typecode", 1))) __PYX_ERR(0, 624, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage), (&PyUnicode_Type), 1, "storage", 1))) __PYX_ERR(0, 625, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memmap_dir), (&PyUnicode_Type), 1, "memmap_dir", 1))) __PYX_ERR(0, 625, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), (&PyUnicode_Type), 1, "header", 1))) __PYX_ERR(0, 625, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), __pyx_v_chroms, __pyx_v_stranded, __pyx_v_typecode, __pyx_v_storage, __pyx_v_memmap_dir, __pyx_v_header);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray___init__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_chroms, int __pyx_v_stranded, PyObject *__pyx_v_typecode, PyObject *__pyx_v_storage, PyObject *__pyx_v_memmap_dir, PyObject *__pyx_v_header) {
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_7genexpr__pyx_v_c = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_chroms);

  /* "HTSeq/_HTSeq.pyx":663
 * 
 * 
 *         self.auto_add_chroms = chroms if chroms in ('auto', 'auto-write') else ''             # <<<<<<<<<<<<<<
 *         self.chrom_vectors = {}
 *         self.stranded = stranded
*/
  __Pyx_INCREF(__pyx_v_chroms);
  __pyx_t_2 = __pyx_v_chroms;
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_auto, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 663, __pyx_L1_error)
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_auto_write, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 663, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_4;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_3;
  if (__pyx_t_4) {
    __pyx_t_2 = __pyx_v_chroms;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 663, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__12);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__12;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->auto_add_chroms);
  __Pyx_DECREF(__pyx_v_self->auto_add_chroms);
  __pyx_v_self->auto_add_chroms = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":664
 * 
 *         self.auto_add_chroms = chroms if chroms in ('auto', 'auto-write') else ''
 *         self.chrom_vectors = {}             # <<<<<<<<<<<<<<
 *         self.stranded = stranded
 *         self.typecode = typecode
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->chrom_vectors);
  __Pyx_DECREF(__pyx_v_self->chrom_vectors);
  __pyx_v_self->chrom_vectors = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":665
 *         self.auto_add_chroms = chroms if chroms in ('auto', 'auto-write') else ''
 *         self.chrom_vectors = {}
 *         self.stranded = stranded             # <<<<<<<<<<<<<<
 *         self.typecode = typecode
 *         self.header = header
*/
  __pyx_v_self->stranded = __pyx_v_stranded;

  /* "HTSeq/_HTSeq.pyx":666
 *         self.chrom_vectors = {}
 *         self.stranded = stranded
 *         self.typecode = typecode             # <<<<<<<<<<<<<<
 *         self.header = header
 * 
*/
  __Pyx_INCREF(__pyx_v_typecode);
  __Pyx_GIVEREF(__pyx_v_typecode);
  __Pyx_GOTREF(__pyx_v_self->typecode);
  __Pyx_DECREF(__pyx_v_self->typecode);
  __pyx_v_self->typecode = __pyx_v_typecode;

  /* "HTSeq/_HTSeq.pyx":667
 *         self.stranded = stranded
 *         self.typecode = typecode
 *         self.header = header             # <<<<<<<<<<<<<<
 * 
 *         if self.auto_add_chroms:
*/
  __Pyx_INCREF(__pyx_v_header);
  __Pyx_GIVEREF(__pyx_v_header);
  __Pyx_GOTREF(__pyx_v_self->header);
  __Pyx_DECREF(__pyx_v_self->header);
  __pyx_v_self->header = __pyx_v_header;

  /* "HTSeq/_HTSeq.pyx":669
 *         self.header = header
 * 
 *         if self.auto_add_chroms:             # <<<<<<<<<<<<<<
 *             chroms = []
 *             if storage not in ('step', 'stretch'):
*/
  if (__pyx_v_self->auto_add_chroms == Py_None) __pyx_t_4 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_self->auto_add_chroms);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 669, __pyx_L1_error)
    __pyx_t_4 = (__pyx_temp != 0);
  }

  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":670
 * 
 *         if self.auto_add_chroms:
 *             chroms = []             # <<<<<<<<<<<<<<
 *             if storage not in ('step', 'stretch'):
 *                 raise TypeError("Automatic adding of chromosomes can " + \
*/
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_chroms, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":671
 *         if self.auto_add_chroms:
 *             chroms = []
 *             if storage not in ('step', 'stretch'):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Automatic adding of chromosomes can " + \
 *                     " only be used with storage type 'step' or 'stretch'.")
*/
    __Pyx_INCREF(__pyx_v_storage);
    __pyx_t_5 = __pyx_v_storage;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_step, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 671, __pyx_L1_error)
    if (__pyx_t_3) {
    } else {
      __pyx_t_4 = __pyx_t_3;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stretch, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 671, __pyx_L1_error)
    __pyx_t_4 = __pyx_t_3;
    __pyx_L7_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __pyx_t_4;
    if (unlikely(__pyx_t_3)) {

      /* "HTSeq/_HTSeq.pyx":672
 *             chroms = []
 *             if storage not in ('step', 'stretch'):
 *                 raise TypeError("Automatic adding of chromosomes can " + \             # <<<<<<<<<<<<<<
 *                     " only be used with storage type 'step' or 'stretch'.")
 * 
*/
      __pyx_t_2 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Automatic_adding_of_chromosomes};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __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, 672, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":671
 *         if self.auto_add_chroms:
 *             chroms = []
 *             if storage not in ('step', 'stretch'):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Automatic adding of chromosomes can " + \
 *                     " only be used with storage type 'step' or 'stretch'.")
*/
    }

    /* "HTSeq/_HTSeq.pyx":669
 *         self.header = header
 * 
 *         if self.auto_add_chroms:             # <<<<<<<<<<<<<<
 *             chroms = []
 *             if storage not in ('step', 'stretch'):
*/
    goto __pyx_L5;
  }

  /* "HTSeq/_HTSeq.pyx":675
 *                     " only be used with storage type 'step' or 'stretch'.")
 * 
 *         elif isinstance(chroms, list):             # <<<<<<<<<<<<<<
 *             if storage not in ('step', 'stretch'):
 *                 raise TypeError("Indefinite-length chromosomes can " + \
*/
  __pyx_t_3 = PyList_Check(__pyx_v_chroms); 
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":676
 * 
 *         elif isinstance(chroms, list):
 *             if storage not in ('step', 'stretch'):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Indefinite-length chromosomes can " + \
 *                     " only be used with storage type 'step' or 'stretch'.")
*/
    __Pyx_INCREF(__pyx_v_storage);
    __pyx_t_5 = __pyx_v_storage;
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_step, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 676, __pyx_L1_error)
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stretch, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 676, __pyx_L1_error)
    __pyx_t_3 = __pyx_t_4;
    __pyx_L10_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __pyx_t_3;
    if (unlikely(__pyx_t_4)) {

      /* "HTSeq/_HTSeq.pyx":677
 *         elif isinstance(chroms, list):
 *             if storage not in ('step', 'stretch'):
 *                 raise TypeError("Indefinite-length chromosomes can " + \             # <<<<<<<<<<<<<<
 *                     " only be used with storage type 'step' or 'stretch'.")
 *             chroms = dict([(c, sys.maxsize) for c in chroms])
*/
      __pyx_t_2 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Indefinite_length_chromosomes_ca};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __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, 677, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":676
 * 
 *         elif isinstance(chroms, list):
 *             if storage not in ('step', 'stretch'):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Indefinite-length chromosomes can " + \
 *                     " only be used with storage type 'step' or 'stretch'.")
*/
    }

    /* "HTSeq/_HTSeq.pyx":679
 *                 raise TypeError("Indefinite-length chromosomes can " + \
 *                     " only be used with storage type 'step' or 'stretch'.")
 *             chroms = dict([(c, sys.maxsize) for c in chroms])             # <<<<<<<<<<<<<<
 * 
 *         elif not isinstance(chroms, dict):
*/
    __pyx_t_2 = NULL;
    { /* enter inner scope */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (likely(PyList_CheckExact(__pyx_v_chroms)) || PyTuple_CheckExact(__pyx_v_chroms)) {
        __pyx_t_8 = __pyx_v_chroms; __Pyx_INCREF(__pyx_t_8);
        __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_chroms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 679, __pyx_L14_error)
      }
      for (;;) {
        if (likely(!__pyx_t_10)) {
          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, 679, __pyx_L14_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            __pyx_t_11 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_9;
          } 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, 679, __pyx_L14_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9));
            #else
            __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_9);
            #endif
            ++__pyx_t_9;
          }
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 679, __pyx_L14_error)
        } else {
          __pyx_t_11 = __pyx_t_10(__pyx_t_8);
          if (unlikely(!__pyx_t_11)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 679, __pyx_L14_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_c, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 679, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 679, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 679, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_7genexpr__pyx_v_c);
        __Pyx_GIVEREF(__pyx_7genexpr__pyx_v_c);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_7genexpr__pyx_v_c) != (0)) __PYX_ERR(0, 679, __pyx_L14_error);
        __Pyx_GIVEREF(__pyx_t_12);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 679, __pyx_L14_error);
        __pyx_t_12 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 679, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_c); __pyx_7genexpr__pyx_v_c = 0;
      goto __pyx_L18_exit_scope;
      __pyx_L14_error:;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_c); __pyx_7genexpr__pyx_v_c = 0;
      goto __pyx_L1_error;
      __pyx_L18_exit_scope:;
    } /* exit inner scope */
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyDict_Type), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF_SET(__pyx_v_chroms, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":675
 *                     " only be used with storage type 'step' or 'stretch'.")
 * 
 *         elif isinstance(chroms, list):             # <<<<<<<<<<<<<<
 *             if storage not in ('step', 'stretch'):
 *                 raise TypeError("Indefinite-length chromosomes can " + \
*/
    goto __pyx_L5;
  }

  /* "HTSeq/_HTSeq.pyx":681
 *             chroms = dict([(c, sys.maxsize) for c in chroms])
 * 
 *         elif not isinstance(chroms, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError("'chroms' must be a list or a dict or 'auto'.")
 * 
*/
  __pyx_t_4 = PyDict_Check(__pyx_v_chroms); 
  __pyx_t_3 = (!__pyx_t_4);
  if (unlikely(__pyx_t_3)) {

    /* "HTSeq/_HTSeq.pyx":682
 * 
 *         elif not isinstance(chroms, dict):
 *             raise TypeError("'chroms' must be a list or a dict or 'auto'.")             # <<<<<<<<<<<<<<
 * 
 *         self.storage = storage
*/
    __pyx_t_7 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_chroms_must_be_a_list_or_a_dict};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __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, 682, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":681
 *             chroms = dict([(c, sys.maxsize) for c in chroms])
 * 
 *         elif not isinstance(chroms, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError("'chroms' must be a list or a dict or 'auto'.")
 * 
*/
  }
  __pyx_L5:;

  /* "HTSeq/_HTSeq.pyx":684
 *             raise TypeError("'chroms' must be a list or a dict or 'auto'.")
 * 
 *         self.storage = storage             # <<<<<<<<<<<<<<
 *         self.memmap_dir = memmap_dir
 * 
*/
  __Pyx_INCREF(__pyx_v_storage);
  __Pyx_GIVEREF(__pyx_v_storage);
  __Pyx_GOTREF(__pyx_v_self->storage);
  __Pyx_DECREF(__pyx_v_self->storage);
  __pyx_v_self->storage = __pyx_v_storage;

  /* "HTSeq/_HTSeq.pyx":685
 * 
 *         self.storage = storage
 *         self.memmap_dir = memmap_dir             # <<<<<<<<<<<<<<
 * 
 *         for chrom in chroms:
*/
  __Pyx_INCREF(__pyx_v_memmap_dir);
  __Pyx_GIVEREF(__pyx_v_memmap_dir);
  __Pyx_GOTREF(__pyx_v_self->memmap_dir);
  __Pyx_DECREF(__pyx_v_self->memmap_dir);
  __pyx_v_self->memmap_dir = __pyx_v_memmap_dir;

  /* "HTSeq/_HTSeq.pyx":687
 *         self.memmap_dir = memmap_dir
 * 
 *         for chrom in chroms:             # <<<<<<<<<<<<<<
 *             self.add_chrom(chrom, chroms[chrom])
 * 
*/
  if (likely(PyList_CheckExact(__pyx_v_chroms)) || PyTuple_CheckExact(__pyx_v_chroms)) {
    __pyx_t_1 = __pyx_v_chroms; __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_chroms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __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, 687, __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, 687, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        __pyx_t_7 = __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, 687, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9));
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9);
        #endif
        ++__pyx_t_9;
      }
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 687, __pyx_L1_error)
    } else {
      __pyx_t_7 = __pyx_t_10(__pyx_t_1);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 687, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":688
 * 
 *         for chrom in chroms:
 *             self.add_chrom(chrom, chroms[chrom])             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, index):
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_chroms, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_chrom, __pyx_t_8};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_chrom, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":687
 *         self.memmap_dir = memmap_dir
 * 
 *         for chrom in chroms:             # <<<<<<<<<<<<<<
 *             self.add_chrom(chrom, chroms[chrom])
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":624
 *     cdef public str header
 * 
 *     def __init__(self, object chroms, bint stranded=True, str typecode='d',             # <<<<<<<<<<<<<<
 *                  str storage='step', str memmap_dir="", str header=""):
 *         '''GenomicArray(chroms, stranded=True, typecode="d", storage="step", memmap_dir="")
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_chroms);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":690
 *             self.add_chrom(chrom, chroms[chrom])
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         if isinstance(index, GenomicInterval):
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_2__getitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), ((PyObject *)__pyx_v_index));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_2__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "HTSeq/_HTSeq.pyx":691
 * 
 *     def __getitem__(self, index):
 *         if isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 *                 raise KeyError(
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_index, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); 
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":692
 *     def __getitem__(self, index):
 *         if isinstance(index, GenomicInterval):
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):             # <<<<<<<<<<<<<<
 *                 raise KeyError(
 *                     "Non-stranded index used for stranded GenomicArray.")
*/
    if (__pyx_v_self->stranded) {
    } else {
      __pyx_t_1 = __pyx_v_self->stranded;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_v_5HTSeq_6_HTSeq_strand_plus, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 692, __pyx_L1_error)
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 692, __pyx_L1_error)
    __pyx_t_3 = __pyx_t_4;
    __pyx_L7_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_1 = __pyx_t_4;
    __pyx_L5_bool_binop_done:;
    if (unlikely(__pyx_t_1)) {

      /* "HTSeq/_HTSeq.pyx":693
 *         if isinstance(index, GenomicInterval):
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 *                 raise KeyError(             # <<<<<<<<<<<<<<
 *                     "Non-stranded index used for stranded GenomicArray.")
 * 
*/
      __pyx_t_5 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Non_stranded_index_used_for_stra};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __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;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __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, 693, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":692
 *     def __getitem__(self, index):
 *         if isinstance(index, GenomicInterval):
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):             # <<<<<<<<<<<<<<
 *                 raise KeyError(
 *                     "Non-stranded index used for stranded GenomicArray.")
*/
    }

    /* "HTSeq/_HTSeq.pyx":697
 * 
 *             # Auto-add chromosome: always infinite size
 *             if (self.auto_add_chroms == 'auto') and index.chrom not in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                 self.add_chrom(index.chrom)
 * 
*/
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->auto_add_chroms, __pyx_mstate_global->__pyx_n_u_auto, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 697, __pyx_L1_error)
    if (__pyx_t_4) {
    } else {
      __pyx_t_1 = __pyx_t_4;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 697, __pyx_L1_error)
    }
    __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_t_2, __pyx_v_self->chrom_vectors, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":698
 *             # Auto-add chromosome: always infinite size
 *             if (self.auto_add_chroms == 'auto') and index.chrom not in self.chrom_vectors:
 *                 self.add_chrom(index.chrom)             # <<<<<<<<<<<<<<
 * 
 *             if isinstance(index, GenomicPosition):
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 698, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_chrom, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "HTSeq/_HTSeq.pyx":697
 * 
 *             # Auto-add chromosome: always infinite size
 *             if (self.auto_add_chroms == 'auto') and index.chrom not in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                 self.add_chrom(index.chrom)
 * 
*/
    }

    /* "HTSeq/_HTSeq.pyx":700
 *                 self.add_chrom(index.chrom)
 * 
 *             if isinstance(index, GenomicPosition):             # <<<<<<<<<<<<<<
 *                 if self.stranded:
 *                     return self.chrom_vectors[index.chrom][index.strand][index.pos]
*/
    __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_index, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition); 
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":701
 * 
 *             if isinstance(index, GenomicPosition):
 *                 if self.stranded:             # <<<<<<<<<<<<<<
 *                     return self.chrom_vectors[index.chrom][index.strand][index.pos]
 *                 else:
*/
      if (__pyx_v_self->stranded) {

        /* "HTSeq/_HTSeq.pyx":702
 *             if isinstance(index, GenomicPosition):
 *                 if self.stranded:
 *                     return self.chrom_vectors[index.chrom][index.strand][index.pos]             # <<<<<<<<<<<<<<
 *                 else:
 *                     return self.chrom_vectors[index.chrom][strand_nostrand][index.pos]
*/
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 702, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 702, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 702, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "HTSeq/_HTSeq.pyx":701
 * 
 *             if isinstance(index, GenomicPosition):
 *                 if self.stranded:             # <<<<<<<<<<<<<<
 *                     return self.chrom_vectors[index.chrom][index.strand][index.pos]
 *                 else:
*/
      }

      /* "HTSeq/_HTSeq.pyx":704
 *                     return self.chrom_vectors[index.chrom][index.strand][index.pos]
 *                 else:
 *                     return self.chrom_vectors[index.chrom][strand_nostrand][index.pos]             # <<<<<<<<<<<<<<
 *             else:
 *                 if self.stranded:
*/
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 704, __pyx_L1_error)
        }
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 704, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 704, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;
      }

      /* "HTSeq/_HTSeq.pyx":700
 *                 self.add_chrom(index.chrom)
 * 
 *             if isinstance(index, GenomicPosition):             # <<<<<<<<<<<<<<
 *                 if self.stranded:
 *                     return self.chrom_vectors[index.chrom][index.strand][index.pos]
*/
    }

    /* "HTSeq/_HTSeq.pyx":706
 *                     return self.chrom_vectors[index.chrom][strand_nostrand][index.pos]
 *             else:
 *                 if self.stranded:             # <<<<<<<<<<<<<<
 *                     return self.chrom_vectors[index.chrom][index.strand][index.start: index.end]
 *                 else:
*/
    /*else*/ {
      if (__pyx_v_self->stranded) {

        /* "HTSeq/_HTSeq.pyx":707
 *             else:
 *                 if self.stranded:
 *                     return self.chrom_vectors[index.chrom][index.strand][index.start: index.end]             # <<<<<<<<<<<<<<
 *                 else:
 *                     return self.chrom_vectors[index.chrom][strand_nostrand][index.start: index.end]
*/
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 707, __pyx_L1_error)
        }
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_t_7, 0, 0, &__pyx_t_5, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;

        /* "HTSeq/_HTSeq.pyx":706
 *                     return self.chrom_vectors[index.chrom][strand_nostrand][index.pos]
 *             else:
 *                 if self.stranded:             # <<<<<<<<<<<<<<
 *                     return self.chrom_vectors[index.chrom][index.strand][index.start: index.end]
 *                 else:
*/
      }

      /* "HTSeq/_HTSeq.pyx":709
 *                     return self.chrom_vectors[index.chrom][index.strand][index.start: index.end]
 *                 else:
 *                     return self.chrom_vectors[index.chrom][strand_nostrand][index.start: index.end]             # <<<<<<<<<<<<<<
 *         else:
 *             return self.chrom_vectors[index]
*/
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 709, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 709, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 709, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 709, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, &__pyx_t_2, &__pyx_t_5, NULL, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 709, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L0;
      }
    }

    /* "HTSeq/_HTSeq.pyx":691
 * 
 *     def __getitem__(self, index):
 *         if isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 *                 raise KeyError(
*/
  }

  /* "HTSeq/_HTSeq.pyx":711
 *                     return self.chrom_vectors[index.chrom][strand_nostrand][index.start: index.end]
 *         else:
 *             return self.chrom_vectors[index]             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, index, value):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 711, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":690
 *             self.add_chrom(chrom, chroms[chrom])
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         if isinstance(index, GenomicInterval):
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":713
 *             return self.chrom_vectors[index]
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef GenomicInterval index2
 * 
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_4__setitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_4__setitem__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_index2 = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "HTSeq/_HTSeq.pyx":716
 *         cdef GenomicInterval index2
 * 
 *         if isinstance(value, ChromVector):             # <<<<<<<<<<<<<<
 *             if not isinstance(index, GenomicInterval):
 *                 raise NotImplementedError(
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector); 
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":717
 * 
 *         if isinstance(value, ChromVector):
 *             if not isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     "Required assignment signature not yet implemented.")
*/
    __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_index, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); 
    __pyx_t_2 = (!__pyx_t_1);
    if (unlikely(__pyx_t_2)) {

      /* "HTSeq/_HTSeq.pyx":718
 *         if isinstance(value, ChromVector):
 *             if not isinstance(index, GenomicInterval):
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "Required assignment signature not yet implemented.")
 *             index2 = index.copy()
*/
      __pyx_t_4 = NULL;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Required_assignment_signature_no};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 718, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":717
 * 
 *         if isinstance(value, ChromVector):
 *             if not isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     "Required assignment signature not yet implemented.")
*/
    }

    /* "HTSeq/_HTSeq.pyx":720
 *                 raise NotImplementedError(
 *                     "Required assignment signature not yet implemented.")
 *             index2 = index.copy()             # <<<<<<<<<<<<<<
 *             if not self.stranded:
 *                 index2.strand = strand_nostrand
*/
    __pyx_t_4 = __pyx_v_index;
    __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_copy, __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, 720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 720, __pyx_L1_error)
    __pyx_v_index2 = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":721
 *                     "Required assignment signature not yet implemented.")
 *             index2 = index.copy()
 *             if not self.stranded:             # <<<<<<<<<<<<<<
 *                 index2.strand = strand_nostrand
 *             if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:
*/
    __pyx_t_2 = (!__pyx_v_self->stranded);
    if (__pyx_t_2) {

      /* "HTSeq/_HTSeq.pyx":722
 *             index2 = index.copy()
 *             if not self.stranded:
 *                 index2.strand = strand_nostrand             # <<<<<<<<<<<<<<
 *             if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:
 *                 return
*/
      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_index2), __pyx_mstate_global->__pyx_n_u_strand, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand) < (0)) __PYX_ERR(0, 722, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":721
 *                     "Required assignment signature not yet implemented.")
 *             index2 = index.copy()
 *             if not self.stranded:             # <<<<<<<<<<<<<<
 *                 index2.strand = strand_nostrand
 *             if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:
*/
    }

    /* "HTSeq/_HTSeq.pyx":723
 *             if not self.stranded:
 *                 index2.strand = strand_nostrand
 *             if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:             # <<<<<<<<<<<<<<
 *                 return
 *             raise NotImplementedError(
*/
    if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 723, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_index2->chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_index2), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = (__pyx_t_4 == __pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_mstate_global->__pyx_n_u_iv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_index2), __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "HTSeq/_HTSeq.pyx":724
 *                 index2.strand = strand_nostrand
 *             if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:
 *                 return             # <<<<<<<<<<<<<<
 *             raise NotImplementedError(
 *                     "Required assignment signature not yet implemented.")
*/
      __pyx_r = 0;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":723
 *             if not self.stranded:
 *                 index2.strand = strand_nostrand
 *             if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:             # <<<<<<<<<<<<<<
 *                 return
 *             raise NotImplementedError(
*/
    }

    /* "HTSeq/_HTSeq.pyx":725
 *             if self.chrom_vectors[index2.chrom][index2.strand].array is value.array and index2 == value.iv:
 *                 return
 *             raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "Required assignment signature not yet implemented.")
 * 
*/
    __pyx_t_6 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Required_assignment_signature_no};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 725, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":716
 *         cdef GenomicInterval index2
 * 
 *         if isinstance(value, ChromVector):             # <<<<<<<<<<<<<<
 *             if not isinstance(index, GenomicInterval):
 *                 raise NotImplementedError(
*/
  }

  /* "HTSeq/_HTSeq.pyx":728
 *                     "Required assignment signature not yet implemented.")
 * 
 *         if isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 *                 raise KeyError(
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_index, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); 
  if (likely(__pyx_t_2)) {

    /* "HTSeq/_HTSeq.pyx":729
 * 
 *         if isinstance(index, GenomicInterval):
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):             # <<<<<<<<<<<<<<
 *                 raise KeyError(
 *                     "Non-stranded index used for stranded GenomicArray.")
*/
    if (__pyx_v_self->stranded) {
    } else {
      __pyx_t_2 = __pyx_v_self->stranded;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_v_5HTSeq_6_HTSeq_strand_plus, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 729, __pyx_L1_error)
    if (__pyx_t_7) {
    } else {
      __pyx_t_1 = __pyx_t_7;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 729, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_7;
    __pyx_L13_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __pyx_t_1;
    __pyx_t_2 = __pyx_t_7;
    __pyx_L11_bool_binop_done:;
    if (unlikely(__pyx_t_2)) {

      /* "HTSeq/_HTSeq.pyx":730
 *         if isinstance(index, GenomicInterval):
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 *                 raise KeyError(             # <<<<<<<<<<<<<<
 *                     "Non-stranded index used for stranded GenomicArray.")
 * 
*/
      __pyx_t_6 = NULL;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Non_stranded_index_used_for_stra};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 730, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":729
 * 
 *         if isinstance(index, GenomicInterval):
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):             # <<<<<<<<<<<<<<
 *                 raise KeyError(
 *                     "Non-stranded index used for stranded GenomicArray.")
*/
    }

    /* "HTSeq/_HTSeq.pyx":736
 *             # Before changing this, make sure __setitem__ and __getitem__ are
 *             # consistent
 *             if self.auto_add_chroms in ('auto', 'auto-write'):             # <<<<<<<<<<<<<<
 *                 # Add a new chromosome
 *                 if index.chrom not in self.chrom_vectors:
*/
    __Pyx_INCREF(__pyx_v_self->auto_add_chroms);
    __pyx_t_8 = __pyx_v_self->auto_add_chroms;
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_auto, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 736, __pyx_L1_error)
    if (!__pyx_t_7) {
    } else {
      __pyx_t_2 = __pyx_t_7;
      goto __pyx_L16_bool_binop_done;
    }
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_auto_write, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 736, __pyx_L1_error)
    __pyx_t_2 = __pyx_t_7;
    __pyx_L16_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_7 = __pyx_t_2;
    if (__pyx_t_7) {

      /* "HTSeq/_HTSeq.pyx":738
 *             if self.auto_add_chroms in ('auto', 'auto-write'):
 *                 # Add a new chromosome
 *                 if index.chrom not in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                     if self.auto_add_chroms == 'auto':
 *                         self.add_chrom(index.chrom)
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 738, __pyx_L1_error)
      }
      __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_t_4, __pyx_v_self->chrom_vectors, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 738, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_7) {

        /* "HTSeq/_HTSeq.pyx":739
 *                 # Add a new chromosome
 *                 if index.chrom not in self.chrom_vectors:
 *                     if self.auto_add_chroms == 'auto':             # <<<<<<<<<<<<<<
 *                         self.add_chrom(index.chrom)
 *                     else:
*/
        __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_self->auto_add_chroms, __pyx_mstate_global->__pyx_n_u_auto, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 739, __pyx_L1_error)
        if (__pyx_t_7) {

          /* "HTSeq/_HTSeq.pyx":740
 *                 if index.chrom not in self.chrom_vectors:
 *                     if self.auto_add_chroms == 'auto':
 *                         self.add_chrom(index.chrom)             # <<<<<<<<<<<<<<
 *                     else:
 *                         self.add_chrom(
*/
          __pyx_t_6 = ((PyObject *)__pyx_v_self);
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_chrom, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "HTSeq/_HTSeq.pyx":739
 *                 # Add a new chromosome
 *                 if index.chrom not in self.chrom_vectors:
 *                     if self.auto_add_chroms == 'auto':             # <<<<<<<<<<<<<<
 *                         self.add_chrom(index.chrom)
 *                     else:
*/
          goto __pyx_L19;
        }

        /* "HTSeq/_HTSeq.pyx":742
 *                         self.add_chrom(index.chrom)
 *                     else:
 *                         self.add_chrom(             # <<<<<<<<<<<<<<
 *                                 index.chrom,
 *                                 length=index.end - index.start,
*/
        /*else*/ {
          __pyx_t_3 = ((PyObject *)__pyx_v_self);
          __Pyx_INCREF(__pyx_t_3);

          /* "HTSeq/_HTSeq.pyx":743
 *                     else:
 *                         self.add_chrom(
 *                                 index.chrom,             # <<<<<<<<<<<<<<
 *                                 length=index.end - index.start,
 *                                 start_index=index.start,
*/
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 743, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);

          /* "HTSeq/_HTSeq.pyx":744
 *                         self.add_chrom(
 *                                 index.chrom,
 *                                 length=index.end - index.start,             # <<<<<<<<<<<<<<
 *                                 start_index=index.start,
 *                         )
*/
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 744, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 744, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = PyNumber_Subtract(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 744, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "HTSeq/_HTSeq.pyx":745
 *                                 index.chrom,
 *                                 length=index.end - index.start,
 *                                 start_index=index.start,             # <<<<<<<<<<<<<<
 *                         )
 *                 # Extend a known chromosome
*/
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 745, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_3, __pyx_t_6};
            __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 742, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_length, __pyx_t_11, __pyx_t_9, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 742, __pyx_L1_error)
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_start_index, __pyx_t_10, __pyx_t_9, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 742, __pyx_L1_error)
            __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_add_chrom, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __pyx_L19:;

        /* "HTSeq/_HTSeq.pyx":738
 *             if self.auto_add_chroms in ('auto', 'auto-write'):
 *                 # Add a new chromosome
 *                 if index.chrom not in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                     if self.auto_add_chroms == 'auto':
 *                         self.add_chrom(index.chrom)
*/
        goto __pyx_L18;
      }

      /* "HTSeq/_HTSeq.pyx":749
 *                 # Extend a known chromosome
 *                 else:
 *                     if self.stranded:             # <<<<<<<<<<<<<<
 *                         self.chrom_vectors[index.chrom][index.strand].extend_to_include(
 *                             index,
*/
      /*else*/ {
        if (__pyx_v_self->stranded) {

          /* "HTSeq/_HTSeq.pyx":750
 *                 else:
 *                     if self.stranded:
 *                         self.chrom_vectors[index.chrom][index.strand].extend_to_include(             # <<<<<<<<<<<<<<
 *                             index,
 *                         )
*/
          if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 750, __pyx_L1_error)
          }
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 750, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 750, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 750, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_9 = __pyx_t_6;
          __Pyx_INCREF(__pyx_t_9);

          /* "HTSeq/_HTSeq.pyx":751
 *                     if self.stranded:
 *                         self.chrom_vectors[index.chrom][index.strand].extend_to_include(
 *                             index,             # <<<<<<<<<<<<<<
 *                         )
 *                     else:
*/
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_index};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_extend_to_include, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 750, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "HTSeq/_HTSeq.pyx":749
 *                 # Extend a known chromosome
 *                 else:
 *                     if self.stranded:             # <<<<<<<<<<<<<<
 *                         self.chrom_vectors[index.chrom][index.strand].extend_to_include(
 *                             index,
*/
          goto __pyx_L20;
        }

        /* "HTSeq/_HTSeq.pyx":754
 *                         )
 *                     else:
 *                         self.chrom_vectors[index.chrom][strand_nostrand].extend_to_include(             # <<<<<<<<<<<<<<
 *                             index,
 *                         )
*/
        /*else*/ {
          if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 754, __pyx_L1_error)
          }
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 754, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 754, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_10, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 754, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_6 = __pyx_t_9;
          __Pyx_INCREF(__pyx_t_6);

          /* "HTSeq/_HTSeq.pyx":755
 *                     else:
 *                         self.chrom_vectors[index.chrom][strand_nostrand].extend_to_include(
 *                             index,             # <<<<<<<<<<<<<<
 *                         )
 * 
*/
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_index};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_extend_to_include, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __pyx_L20:;
      }
      __pyx_L18:;

      /* "HTSeq/_HTSeq.pyx":736
 *             # Before changing this, make sure __setitem__ and __getitem__ are
 *             # consistent
 *             if self.auto_add_chroms in ('auto', 'auto-write'):             # <<<<<<<<<<<<<<
 *                 # Add a new chromosome
 *                 if index.chrom not in self.chrom_vectors:
*/
    }

    /* "HTSeq/_HTSeq.pyx":758
 *                         )
 * 
 *             if self.stranded:             # <<<<<<<<<<<<<<
 *                 self.chrom_vectors[index.chrom][index.strand][
 *                     index.start: index.end] = value
*/
    if (__pyx_v_self->stranded) {

      /* "HTSeq/_HTSeq.pyx":759
 * 
 *             if self.stranded:
 *                 self.chrom_vectors[index.chrom][index.strand][             # <<<<<<<<<<<<<<
 *                     index.start: index.end] = value
 *             else:
*/
      if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 759, __pyx_L1_error)
      }
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":760
 *             if self.stranded:
 *                 self.chrom_vectors[index.chrom][index.strand][
 *                     index.start: index.end] = value             # <<<<<<<<<<<<<<
 *             else:
 *                 self.chrom_vectors[index.chrom][strand_nostrand][
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_PyObject_SetSlice(__pyx_t_6, __pyx_v_value, 0, 0, &__pyx_t_4, &__pyx_t_9, NULL, 0, 0, 1) < (0)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "HTSeq/_HTSeq.pyx":758
 *                         )
 * 
 *             if self.stranded:             # <<<<<<<<<<<<<<
 *                 self.chrom_vectors[index.chrom][index.strand][
 *                     index.start: index.end] = value
*/
      goto __pyx_L21;
    }

    /* "HTSeq/_HTSeq.pyx":763
 *             else:
 *                 self.chrom_vectors[index.chrom][strand_nostrand][
 *                     index.start: index.end] = value             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("Illegal index type.")
*/
    /*else*/ {

      /* "HTSeq/_HTSeq.pyx":762
 *                     index.start: index.end] = value
 *             else:
 *                 self.chrom_vectors[index.chrom][strand_nostrand][             # <<<<<<<<<<<<<<
 *                     index.start: index.end] = value
 *         else:
*/
      if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 762, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":763
 *             else:
 *                 self.chrom_vectors[index.chrom][strand_nostrand][
 *                     index.start: index.end] = value             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("Illegal index type.")
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_PyObject_SetSlice(__pyx_t_9, __pyx_v_value, 0, 0, &__pyx_t_4, &__pyx_t_6, NULL, 0, 0, 1) < (0)) __PYX_ERR(0, 762, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_L21:;

    /* "HTSeq/_HTSeq.pyx":728
 *                     "Required assignment signature not yet implemented.")
 * 
 *         if isinstance(index, GenomicInterval):             # <<<<<<<<<<<<<<
 *             if self.stranded and index.strand not in (strand_plus, strand_minus):
 *                 raise KeyError(
*/
    goto __pyx_L9;
  }

  /* "HTSeq/_HTSeq.pyx":765
 *                     index.start: index.end] = value
 *         else:
 *             raise TypeError("Illegal index type.")             # <<<<<<<<<<<<<<
 * 
 *     def add_chrom(self, chrom, length=sys.maxsize, start_index=0):
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Illegal_index_type_2};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 765, __pyx_L1_error)
  }
  __pyx_L9:;

  /* "HTSeq/_HTSeq.pyx":713
 *             return self.chrom_vectors[index]
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef GenomicInterval index2
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_index2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":767
 *             raise TypeError("Illegal index type.")
 * 
 *     def add_chrom(self, chrom, length=sys.maxsize, start_index=0):             # <<<<<<<<<<<<<<
 *         cdef GenomicInterval iv
 *         if length == sys.maxsize:
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom(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_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom = {"add_chrom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_start_index = 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("add_chrom (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_chrom,&__pyx_mstate_global->__pyx_n_u_length,&__pyx_mstate_global->__pyx_n_u_start_index,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, 767, __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, 767, __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, 767, __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, 767, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_chrom", 0) < (0)) __PYX_ERR(0, 767, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__16);
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_chrom", 0, 1, 3, i); __PYX_ERR(0, 767, __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, 767, __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, 767, __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, 767, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__16);
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_chrom = values[0];
    __pyx_v_length = values[1];
    __pyx_v_start_index = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_chrom", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 767, __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("HTSeq._HTSeq.GenomicArray.add_chrom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6add_chrom(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), __pyx_v_chrom, __pyx_v_length, __pyx_v_start_index);

  /* 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_5HTSeq_6_HTSeq_12GenomicArray_6add_chrom(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_length, PyObject *__pyx_v_start_index) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_chrom", 0);

  /* "HTSeq/_HTSeq.pyx":769
 *     def add_chrom(self, chrom, length=sys.maxsize, start_index=0):
 *         cdef GenomicInterval iv
 *         if length == sys.maxsize:             # <<<<<<<<<<<<<<
 *             iv = GenomicInterval(chrom, start_index, sys.maxsize, ".")
 *         else:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_length, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":770
 *         cdef GenomicInterval iv
 *         if length == sys.maxsize:
 *             iv = GenomicInterval(chrom, start_index, sys.maxsize, ".")             # <<<<<<<<<<<<<<
 *         else:
 *             iv = GenomicInterval(chrom, start_index, start_index + length, ".")
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_chrom, __pyx_v_start_index, __pyx_t_5, __pyx_mstate_global->__pyx_kp_u__8};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":769
 *     def add_chrom(self, chrom, length=sys.maxsize, start_index=0):
 *         cdef GenomicInterval iv
 *         if length == sys.maxsize:             # <<<<<<<<<<<<<<
 *             iv = GenomicInterval(chrom, start_index, sys.maxsize, ".")
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":772
 *             iv = GenomicInterval(chrom, start_index, sys.maxsize, ".")
 *         else:
 *             iv = GenomicInterval(chrom, start_index, start_index + length, ".")             # <<<<<<<<<<<<<<
 *         if self.stranded:
 *             self.chrom_vectors[chrom] = {}
*/
  /*else*/ {
    __pyx_t_5 = NULL;
    __pyx_t_2 = PyNumber_Add(__pyx_v_start_index, __pyx_v_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_chrom, __pyx_v_start_index, __pyx_t_2, __pyx_mstate_global->__pyx_kp_u__8};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":773
 *         else:
 *             iv = GenomicInterval(chrom, start_index, start_index + length, ".")
 *         if self.stranded:             # <<<<<<<<<<<<<<
 *             self.chrom_vectors[chrom] = {}
 *             iv.strand = "+"
*/
  if (__pyx_v_self->stranded) {

    /* "HTSeq/_HTSeq.pyx":774
 *             iv = GenomicInterval(chrom, start_index, start_index + length, ".")
 *         if self.stranded:
 *             self.chrom_vectors[chrom] = {}             # <<<<<<<<<<<<<<
 *             iv.strand = "+"
 *             self.chrom_vectors[chrom][strand_plus] = \
*/
    __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 774, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom, __pyx_t_1) < 0))) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":775
 *         if self.stranded:
 *             self.chrom_vectors[chrom] = {}
 *             iv.strand = "+"             # <<<<<<<<<<<<<<
 *             self.chrom_vectors[chrom][strand_plus] = \
 *                 ChromVector.create(iv, self.typecode,
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_strand, __pyx_mstate_global->__pyx_kp_u__17) < (0)) __PYX_ERR(0, 775, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":777
 *             iv.strand = "+"
 *             self.chrom_vectors[chrom][strand_plus] = \
 *                 ChromVector.create(iv, self.typecode,             # <<<<<<<<<<<<<<
 *                                    self.storage, self.memmap_dir)
 *             iv = iv.copy()
*/
    __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
    __Pyx_INCREF(__pyx_t_2);

    /* "HTSeq/_HTSeq.pyx":778
 *             self.chrom_vectors[chrom][strand_plus] = \
 *                 ChromVector.create(iv, self.typecode,
 *                                    self.storage, self.memmap_dir)             # <<<<<<<<<<<<<<
 *             iv = iv.copy()
 *             iv.strand = "-"
*/
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_2, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_create, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }

    /* "HTSeq/_HTSeq.pyx":776
 *             self.chrom_vectors[chrom] = {}
 *             iv.strand = "+"
 *             self.chrom_vectors[chrom][strand_plus] = \             # <<<<<<<<<<<<<<
 *                 ChromVector.create(iv, self.typecode,
 *                                    self.storage, self.memmap_dir)
*/
    if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 776, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_v_5HTSeq_6_HTSeq_strand_plus, __pyx_t_1) < 0))) __PYX_ERR(0, 776, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":779
 *                 ChromVector.create(iv, self.typecode,
 *                                    self.storage, self.memmap_dir)
 *             iv = iv.copy()             # <<<<<<<<<<<<<<
 *             iv.strand = "-"
 *             self.chrom_vectors[chrom][strand_minus] = \
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_iv);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __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_1)) __PYX_ERR(0, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 779, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_iv, ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":780
 *                                    self.storage, self.memmap_dir)
 *             iv = iv.copy()
 *             iv.strand = "-"             # <<<<<<<<<<<<<<
 *             self.chrom_vectors[chrom][strand_minus] = \
 *                 ChromVector.create(iv, self.typecode,
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_n_u_strand, __pyx_mstate_global->__pyx_kp_u__18) < (0)) __PYX_ERR(0, 780, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":782
 *             iv.strand = "-"
 *             self.chrom_vectors[chrom][strand_minus] = \
 *                 ChromVector.create(iv, self.typecode,             # <<<<<<<<<<<<<<
 *                                    self.storage, self.memmap_dir)
 *         else:
*/
    __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
    __Pyx_INCREF(__pyx_t_2);

    /* "HTSeq/_HTSeq.pyx":783
 *             self.chrom_vectors[chrom][strand_minus] = \
 *                 ChromVector.create(iv, self.typecode,
 *                                    self.storage, self.memmap_dir)             # <<<<<<<<<<<<<<
 *         else:
 *             self.chrom_vectors[chrom] = {
*/
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_2, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_create, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }

    /* "HTSeq/_HTSeq.pyx":781
 *             iv = iv.copy()
 *             iv.strand = "-"
 *             self.chrom_vectors[chrom][strand_minus] = \             # <<<<<<<<<<<<<<
 *                 ChromVector.create(iv, self.typecode,
 *                                    self.storage, self.memmap_dir)
*/
    if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 781, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_v_5HTSeq_6_HTSeq_strand_minus, __pyx_t_1) < 0))) __PYX_ERR(0, 781, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":773
 *         else:
 *             iv = GenomicInterval(chrom, start_index, start_index + length, ".")
 *         if self.stranded:             # <<<<<<<<<<<<<<
 *             self.chrom_vectors[chrom] = {}
 *             iv.strand = "+"
*/
    goto __pyx_L4;
  }

  /* "HTSeq/_HTSeq.pyx":786
 *         else:
 *             self.chrom_vectors[chrom] = {
 *                 strand_nostrand:  ChromVector.create(iv, self.typecode,             # <<<<<<<<<<<<<<
 *                                                      self.storage,
 *                                                      self.memmap_dir)}
*/
  /*else*/ {
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
    __Pyx_INCREF(__pyx_t_5);

    /* "HTSeq/_HTSeq.pyx":788
 *                 strand_nostrand:  ChromVector.create(iv, self.typecode,
 *                                                      self.storage,
 *                                                      self.memmap_dir)}             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_5, ((PyObject *)__pyx_v_iv), __pyx_v_self->typecode, __pyx_v_self->storage, __pyx_v_self->memmap_dir};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_create, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (PyDict_SetItem(__pyx_t_1, __pyx_v_5HTSeq_6_HTSeq_strand_nostrand, __pyx_t_2) < (0)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":785
 *                                    self.storage, self.memmap_dir)
 *         else:
 *             self.chrom_vectors[chrom] = {             # <<<<<<<<<<<<<<
 *                 strand_nostrand:  ChromVector.create(iv, self.typecode,
 *                                                      self.storage,
*/
    if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 785, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom, __pyx_t_1) < 0))) __PYX_ERR(0, 785, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "HTSeq/_HTSeq.pyx":767
 *             raise TypeError("Illegal index type.")
 * 
 *     def add_chrom(self, chrom, length=sys.maxsize, start_index=0):             # <<<<<<<<<<<<<<
 *         cdef GenomicInterval iv
 *         if length == sys.maxsize:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.add_chrom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_iv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":790
 *                                                      self.memmap_dir)}
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__(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_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__(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__ (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__", 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__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8__reduce__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8__reduce__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "HTSeq/_HTSeq.pyx":791
 * 
 *     def __reduce__(self):
 *         return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, iv):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_GenomicArray_unpickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->stranded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 791, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->typecode);
  __Pyx_GIVEREF(__pyx_v_self->typecode);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->typecode) != (0)) __PYX_ERR(0, 791, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->chrom_vectors);
  __Pyx_GIVEREF(__pyx_v_self->chrom_vectors);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->chrom_vectors) != (0)) __PYX_ERR(0, 791, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __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, 791, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 791, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":790
 *                                                      self.memmap_dir)}
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":793
 *         return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
 * 
 *     def __contains__(self, iv):             # <<<<<<<<<<<<<<
 *         '''Check if the GenomicArray contains a certain interval
 * 
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_11__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_iv); /*proto*/
PyDoc_STRVAR(__pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_10__contains__, "Check if the GenomicArray contains a certain interval\n\n        TODO: this is not implemented yet and will throw NotImplementedError.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_5HTSeq_6_HTSeq_12GenomicArray_10__contains__;
#endif
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_11__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_iv) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10__contains__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), ((PyObject *)__pyx_v_iv));

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

static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10__contains__(CYTHON_UNUSED struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_iv) {
  int __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "HTSeq/_HTSeq.pyx":798
 *         TODO: this is not implemented yet and will throw NotImplementedError.
 *         '''
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def write_bedgraph_file(
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 798, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":793
 *         return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
 * 
 *     def __contains__(self, iv):             # <<<<<<<<<<<<<<
 *         '''Check if the GenomicArray contains a certain interval
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":800
 *         raise NotImplementedError
 * 
 *     def write_bedgraph_file(             # <<<<<<<<<<<<<<
 *             self,
 *             file_or_filename,
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13write_bedgraph_file(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_5HTSeq_6_HTSeq_12GenomicArray_12write_bedgraph_file, "Write GenomicArray to BedGraph file\n\n        BedGraph files are used to visualize genomic \"tracks\", notably in\n        UCSC's genomic viewer. This function stores the GenomicArray into such\n        a file for further use.\n\n        Args:\n            file_or_filename (str, path, or open file handle): Where to store\n              the BedGraph data.\n            strand (\"+\", \"-\", or \".\"): Which strand to store the array onto.\n            track_options (str): A string pre-formatted to describe the track\n              options as they appear on the first line of the BedGraph file,\n              after \"track type=bedGraph\".\n            separator (str): the pattern that separates the columns.\n\n        The BedGraph file format is described here:\n\n            http://genome.ucsc.edu/goldenPath/help/bedgraph.html\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_13write_bedgraph_file = {"write_bedgraph_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13write_bedgraph_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_12write_bedgraph_file};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13write_bedgraph_file(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_file_or_filename = 0;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_v_track_options = 0;
  PyObject *__pyx_v_separator = 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("write_bedgraph_file (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_file_or_filename,&__pyx_mstate_global->__pyx_n_u_strand,&__pyx_mstate_global->__pyx_n_u_track_options,&__pyx_mstate_global->__pyx_n_u_separator,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, 800, __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, 800, __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, 800, __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, 800, __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, 800, __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, "write_bedgraph_file", 0) < (0)) __PYX_ERR(0, 800, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__8));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__19));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_bedgraph_file", 0, 1, 4, i); __PYX_ERR(0, 800, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 800, __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, 800, __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, 800, __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, 800, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__8));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__19));
    }
    __pyx_v_file_or_filename = values[0];
    __pyx_v_strand = values[1];
    __pyx_v_track_options = values[2];
    __pyx_v_separator = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_bedgraph_file", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 800, __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("HTSeq._HTSeq.GenomicArray.write_bedgraph_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_12write_bedgraph_file(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), __pyx_v_file_or_filename, __pyx_v_strand, __pyx_v_track_options, __pyx_v_separator);

  /* 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_5HTSeq_6_HTSeq_12GenomicArray_12write_bedgraph_file(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_file_or_filename, PyObject *__pyx_v_strand, PyObject *__pyx_v_track_options, PyObject *__pyx_v_separator) {
  PyObject *__pyx_v_sep = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_iv = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  PyObject *(*__pyx_t_17)(PyObject *);
  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;
  char const *__pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_bedgraph_file", 0);

  /* "HTSeq/_HTSeq.pyx":826
 *             http://genome.ucsc.edu/goldenPath/help/bedgraph.html
 *         '''
 *         sep = separator             # <<<<<<<<<<<<<<
 * 
 *         if (not self.stranded) and strand != ".":
*/
  __Pyx_INCREF(__pyx_v_separator);
  __pyx_v_sep = __pyx_v_separator;

  /* "HTSeq/_HTSeq.pyx":828
 *         sep = separator
 * 
 *         if (not self.stranded) and strand != ".":             # <<<<<<<<<<<<<<
 *             raise ValueError("Strand specified in unstranded GenomicArray.")
 *         if self.stranded and strand not in (strand_plus, strand_minus):
*/
  __pyx_t_2 = (!__pyx_v_self->stranded);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_strand, __pyx_mstate_global->__pyx_kp_u__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 828, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":829
 * 
 *         if (not self.stranded) and strand != ".":
 *             raise ValueError("Strand specified in unstranded GenomicArray.")             # <<<<<<<<<<<<<<
 *         if self.stranded and strand not in (strand_plus, strand_minus):
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Strand_specified_in_unstranded_G};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 829, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":828
 *         sep = separator
 * 
 *         if (not self.stranded) and strand != ".":             # <<<<<<<<<<<<<<
 *             raise ValueError("Strand specified in unstranded GenomicArray.")
 *         if self.stranded and strand not in (strand_plus, strand_minus):
*/
  }

  /* "HTSeq/_HTSeq.pyx":830
 *         if (not self.stranded) and strand != ".":
 *             raise ValueError("Strand specified in unstranded GenomicArray.")
 *         if self.stranded and strand not in (strand_plus, strand_minus):             # <<<<<<<<<<<<<<
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
 *         if hasattr(file_or_filename, "write"):
*/
  if (__pyx_v_self->stranded) {
  } else {
    __pyx_t_1 = __pyx_v_self->stranded;
    goto __pyx_L7_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_v_strand);
  __pyx_t_3 = __pyx_v_strand;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_plus, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 830, __pyx_L1_error)
  if (__pyx_t_6) {
  } else {
    __pyx_t_2 = __pyx_t_6;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 830, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_6;
  __pyx_L9_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __pyx_t_2;
  __pyx_t_1 = __pyx_t_6;
  __pyx_L7_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":831
 *             raise ValueError("Strand specified in unstranded GenomicArray.")
 *         if self.stranded and strand not in (strand_plus, strand_minus):
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")             # <<<<<<<<<<<<<<
 *         if hasattr(file_or_filename, "write"):
 *             f = file_or_filename
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Strand_must_be_specified_for_str};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 831, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":830
 *         if (not self.stranded) and strand != ".":
 *             raise ValueError("Strand specified in unstranded GenomicArray.")
 *         if self.stranded and strand not in (strand_plus, strand_minus):             # <<<<<<<<<<<<<<
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
 *         if hasattr(file_or_filename, "write"):
*/
  }

  /* "HTSeq/_HTSeq.pyx":832
 *         if self.stranded and strand not in (strand_plus, strand_minus):
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
 *         if hasattr(file_or_filename, "write"):             # <<<<<<<<<<<<<<
 *             f = file_or_filename
 *         else:
*/
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_file_or_filename, __pyx_mstate_global->__pyx_n_u_write); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 832, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":833
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
 *         if hasattr(file_or_filename, "write"):
 *             f = file_or_filename             # <<<<<<<<<<<<<<
 *         else:
 *             f = open(file_or_filename, "w")
*/
    __Pyx_INCREF(__pyx_v_file_or_filename);
    __pyx_v_f = __pyx_v_file_or_filename;

    /* "HTSeq/_HTSeq.pyx":832
 *         if self.stranded and strand not in (strand_plus, strand_minus):
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
 *         if hasattr(file_or_filename, "write"):             # <<<<<<<<<<<<<<
 *             f = file_or_filename
 *         else:
*/
    goto __pyx_L11;
  }

  /* "HTSeq/_HTSeq.pyx":835
 *             f = file_or_filename
 *         else:
 *             f = open(file_or_filename, "w")             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_file_or_filename, __pyx_mstate_global->__pyx_n_u_w_2};
      __pyx_t_3 = __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_3)) __PYX_ERR(0, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_v_f = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L11:;

  /* "HTSeq/_HTSeq.pyx":837
 *             f = open(file_or_filename, "w")
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.header:
 *                 f.write(self.header)
*/
  /*try:*/ {

    /* "HTSeq/_HTSeq.pyx":838
 * 
 *         try:
 *             if self.header:             # <<<<<<<<<<<<<<
 *                 f.write(self.header)
 *                 if not self.header.endswith('\n'):
*/
    if (__pyx_v_self->header == Py_None) __pyx_t_1 = 0;
    else
    {
      Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_self->header);
      if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 838, __pyx_L13_error)
      __pyx_t_1 = (__pyx_temp != 0);
    }

    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":839
 *         try:
 *             if self.header:
 *                 f.write(self.header)             # <<<<<<<<<<<<<<
 *                 if not self.header.endswith('\n'):
 *                     f.write('\n')
*/
      __pyx_t_4 = __pyx_v_f;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->header};
        __pyx_t_3 = __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;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":840
 *             if self.header:
 *                 f.write(self.header)
 *                 if not self.header.endswith('\n'):             # <<<<<<<<<<<<<<
 *                     f.write('\n')
 *             if track_options == "":
*/
      if (unlikely(__pyx_v_self->header == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "endswith");
        __PYX_ERR(0, 840, __pyx_L13_error)
      }
      __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_self->header, __pyx_mstate_global->__pyx_kp_u__20, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 840, __pyx_L13_error)
      __pyx_t_6 = (!__pyx_t_1);
      if (__pyx_t_6) {

        /* "HTSeq/_HTSeq.pyx":841
 *                 f.write(self.header)
 *                 if not self.header.endswith('\n'):
 *                     f.write('\n')             # <<<<<<<<<<<<<<
 *             if track_options == "":
 *                 f.write("track type=bedGraph\n")
*/
        __pyx_t_4 = __pyx_v_f;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u__20};
          __pyx_t_3 = __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;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "HTSeq/_HTSeq.pyx":840
 *             if self.header:
 *                 f.write(self.header)
 *                 if not self.header.endswith('\n'):             # <<<<<<<<<<<<<<
 *                     f.write('\n')
 *             if track_options == "":
*/
      }

      /* "HTSeq/_HTSeq.pyx":838
 * 
 *         try:
 *             if self.header:             # <<<<<<<<<<<<<<
 *                 f.write(self.header)
 *                 if not self.header.endswith('\n'):
*/
    }

    /* "HTSeq/_HTSeq.pyx":842
 *                 if not self.header.endswith('\n'):
 *                     f.write('\n')
 *             if track_options == "":             # <<<<<<<<<<<<<<
 *                 f.write("track type=bedGraph\n")
 *             else:
*/
    __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_track_options, __pyx_mstate_global->__pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 842, __pyx_L13_error)
    if (__pyx_t_6) {

      /* "HTSeq/_HTSeq.pyx":843
 *                     f.write('\n')
 *             if track_options == "":
 *                 f.write("track type=bedGraph\n")             # <<<<<<<<<<<<<<
 *             else:
 *                 f.write("track type=bedGraph %s\n" % track_options)
*/
      __pyx_t_4 = __pyx_v_f;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_track_type_bedGraph};
        __pyx_t_3 = __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;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 843, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":842
 *                 if not self.header.endswith('\n'):
 *                     f.write('\n')
 *             if track_options == "":             # <<<<<<<<<<<<<<
 *                 f.write("track type=bedGraph\n")
 *             else:
*/
      goto __pyx_L17;
    }

    /* "HTSeq/_HTSeq.pyx":845
 *                 f.write("track type=bedGraph\n")
 *             else:
 *                 f.write("track type=bedGraph %s\n" % track_options)             # <<<<<<<<<<<<<<
 *             for chrom in self.chrom_vectors:
 *                 for iv, value in self.chrom_vectors[chrom][strand].steps():
*/
    /*else*/ {
      __pyx_t_4 = __pyx_v_f;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_track_type_bedGraph_s, __pyx_v_track_options); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 845, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
        __pyx_t_3 = __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_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L17:;

    /* "HTSeq/_HTSeq.pyx":846
 *             else:
 *                 f.write("track type=bedGraph %s\n" % track_options)
 *             for chrom in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                 for iv, value in self.chrom_vectors[chrom][strand].steps():
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
*/
    __pyx_t_8 = 0;
    if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 846, __pyx_L13_error)
    }
    __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_self->chrom_vectors, 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 846, __pyx_L13_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_7;
    __pyx_t_7 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_9, &__pyx_t_8, &__pyx_t_7, NULL, NULL, __pyx_t_10);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 846, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "HTSeq/_HTSeq.pyx":847
 *                 f.write("track type=bedGraph %s\n" % track_options)
 *             for chrom in self.chrom_vectors:
 *                 for iv, value in self.chrom_vectors[chrom][strand].steps():             # <<<<<<<<<<<<<<
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
 *                         continue
*/
      if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 847, __pyx_L13_error)
      }
      __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 847, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_v_strand); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 847, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_4 = __pyx_t_13;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_steps, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 847, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_13 = __pyx_t_7; __Pyx_INCREF(__pyx_t_13);
        __pyx_t_14 = 0;
        __pyx_t_15 = NULL;
      } else {
        __pyx_t_14 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 847, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 847, __pyx_L13_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_15)) {
          if (likely(PyList_CheckExact(__pyx_t_13))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 847, __pyx_L13_error)
              #endif
              if (__pyx_t_14 >= __pyx_temp) break;
            }
            __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_13, __pyx_t_14, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_14;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 847, __pyx_L13_error)
              #endif
              if (__pyx_t_14 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_14));
            #else
            __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_14);
            #endif
            ++__pyx_t_14;
          }
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 847, __pyx_L13_error)
        } else {
          __pyx_t_7 = __pyx_t_15(__pyx_t_13);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 847, __pyx_L13_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_7);
        if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
          PyObject* sequence = __pyx_t_7;
          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, 847, __pyx_L13_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_4);
            __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_12);
          } else {
            __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L13_error)
            __Pyx_XGOTREF(__pyx_t_4);
            __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 847, __pyx_L13_error)
            __Pyx_XGOTREF(__pyx_t_12);
          }
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 847, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_16 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 847, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_16);
          index = 0; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L22_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_4);
          index = 1; __pyx_t_12 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_12)) goto __pyx_L22_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_12);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < (0)) __PYX_ERR(0, 847, __pyx_L13_error)
          __pyx_t_17 = NULL;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          goto __pyx_L23_unpacking_done;
          __pyx_L22_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_17 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 847, __pyx_L13_error)
          __pyx_L23_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_iv, __pyx_t_4);
        __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_12);
        __pyx_t_12 = 0;

        /* "HTSeq/_HTSeq.pyx":848
 *             for chrom in self.chrom_vectors:
 *                 for iv, value in self.chrom_vectors[chrom][strand].steps():
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:             # <<<<<<<<<<<<<<
 *                         continue
 *                     f.write(
*/
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyLong_SubtractObjC(__pyx_t_12, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_RichCompare(__pyx_t_7, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (!__pyx_t_1) {
        } else {
          __pyx_t_6 = __pyx_t_1;
          goto __pyx_L25_bool_binop_done;
        }
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_12, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 848, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = __pyx_t_1;
        __pyx_L25_bool_binop_done:;
        if (__pyx_t_6) {

          /* "HTSeq/_HTSeq.pyx":849
 *                 for iv, value in self.chrom_vectors[chrom][strand].steps():
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
 *                         continue             # <<<<<<<<<<<<<<
 *                     f.write(
 *                         sep.join(
*/
          goto __pyx_L20_continue;

          /* "HTSeq/_HTSeq.pyx":848
 *             for chrom in self.chrom_vectors:
 *                 for iv, value in self.chrom_vectors[chrom][strand].steps():
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:             # <<<<<<<<<<<<<<
 *                         continue
 *                     f.write(
*/
        }

        /* "HTSeq/_HTSeq.pyx":850
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
 *                         continue
 *                     f.write(             # <<<<<<<<<<<<<<
 *                         sep.join(
 *                             (iv.chrom, str(iv.start), str(iv.end), str(value)),
*/
        __pyx_t_7 = __pyx_v_f;
        __Pyx_INCREF(__pyx_t_7);

        /* "HTSeq/_HTSeq.pyx":851
 *                         continue
 *                     f.write(
 *                         sep.join(             # <<<<<<<<<<<<<<
 *                             (iv.chrom, str(iv.start), str(iv.end), str(value)),
 *                             )+'\n',
*/
        __pyx_t_16 = __pyx_v_sep;
        __Pyx_INCREF(__pyx_t_16);

        /* "HTSeq/_HTSeq.pyx":852
 *                     f.write(
 *                         sep.join(
 *                             (iv.chrom, str(iv.start), str(iv.end), str(value)),             # <<<<<<<<<<<<<<
 *                             )+'\n',
 *                         )
*/
        __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 852, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_18);
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 852, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = __Pyx_PyObject_Unicode(__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 852, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 852, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_21 = __Pyx_PyObject_Unicode(__pyx_t_19); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 852, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_21);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 852, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_22 = PyTuple_New(4); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 852, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_22);
        __Pyx_GIVEREF(__pyx_t_18);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_18) != (0)) __PYX_ERR(0, 852, __pyx_L13_error);
        __Pyx_GIVEREF(__pyx_t_20);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20) != (0)) __PYX_ERR(0, 852, __pyx_L13_error);
        __Pyx_GIVEREF(__pyx_t_21);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_21) != (0)) __PYX_ERR(0, 852, __pyx_L13_error);
        __Pyx_GIVEREF(__pyx_t_19);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 3, __pyx_t_19) != (0)) __PYX_ERR(0, 852, __pyx_L13_error);
        __pyx_t_18 = 0;
        __pyx_t_20 = 0;
        __pyx_t_21 = 0;
        __pyx_t_19 = 0;
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_22};
          __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 851, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_12);
        }

        /* "HTSeq/_HTSeq.pyx":853
 *                         sep.join(
 *                             (iv.chrom, str(iv.start), str(iv.end), str(value)),
 *                             )+'\n',             # <<<<<<<<<<<<<<
 *                         )
 *         finally:
*/
        __pyx_t_22 = PyNumber_Add(__pyx_t_12, __pyx_mstate_global->__pyx_kp_u__20); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 853, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_22);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_22};
          __pyx_t_4 = __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_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "HTSeq/_HTSeq.pyx":847
 *                 f.write("track type=bedGraph %s\n" % track_options)
 *             for chrom in self.chrom_vectors:
 *                 for iv, value in self.chrom_vectors[chrom][strand].steps():             # <<<<<<<<<<<<<<
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
 *                         continue
*/
        __pyx_L20_continue:;
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "HTSeq/_HTSeq.pyx":857
 *         finally:
 *             # Close the file only if we were the ones to open it
 *             if not hasattr(file_or_filename, "write"):             # <<<<<<<<<<<<<<
 *                 f.close()
 * 
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_6 = __Pyx_HasAttr(__pyx_v_file_or_filename, __pyx_mstate_global->__pyx_n_u_write); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 857, __pyx_L1_error)
      __pyx_t_1 = (!__pyx_t_6);
      if (__pyx_t_1) {

        /* "HTSeq/_HTSeq.pyx":858
 *             # Close the file only if we were the ones to open it
 *             if not hasattr(file_or_filename, "write"):
 *                 f.close()             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
        __pyx_t_13 = __pyx_v_f;
        __Pyx_INCREF(__pyx_t_13);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "HTSeq/_HTSeq.pyx":857
 *         finally:
 *             # Close the file only if we were the ones to open it
 *             if not hasattr(file_or_filename, "write"):             # <<<<<<<<<<<<<<
 *                 f.close()
 * 
*/
      }
      goto __pyx_L14;
    }
    __pyx_L13_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_XDECREF(__pyx_t_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_7); __pyx_t_7 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29);
      if ( unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
      __Pyx_XGOTREF(__pyx_t_24);
      __Pyx_XGOTREF(__pyx_t_25);
      __Pyx_XGOTREF(__pyx_t_26);
      __Pyx_XGOTREF(__pyx_t_27);
      __Pyx_XGOTREF(__pyx_t_28);
      __Pyx_XGOTREF(__pyx_t_29);
      __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
      {
        __pyx_t_1 = __Pyx_HasAttr(__pyx_v_file_or_filename, __pyx_mstate_global->__pyx_n_u_write); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 857, __pyx_L30_error)
        __pyx_t_6 = (!__pyx_t_1);
        if (__pyx_t_6) {

          /* "HTSeq/_HTSeq.pyx":858
 *             # Close the file only if we were the ones to open it
 *             if not hasattr(file_or_filename, "write"):
 *                 f.close()             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
          __pyx_t_13 = __pyx_v_f;
          __Pyx_INCREF(__pyx_t_13);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
            __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L30_error)
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "HTSeq/_HTSeq.pyx":857
 *         finally:
 *             # Close the file only if we were the ones to open it
 *             if not hasattr(file_or_filename, "write"):             # <<<<<<<<<<<<<<
 *                 f.close()
 * 
*/
        }
      }
      __Pyx_XGIVEREF(__pyx_t_27);
      __Pyx_XGIVEREF(__pyx_t_28);
      __Pyx_XGIVEREF(__pyx_t_29);
      __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
      __Pyx_XGIVEREF(__pyx_t_24);
      __Pyx_XGIVEREF(__pyx_t_25);
      __Pyx_XGIVEREF(__pyx_t_26);
      __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26);
      __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
      __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_23;
      goto __pyx_L1_error;
      __pyx_L30_error:;
      __Pyx_XGIVEREF(__pyx_t_27);
      __Pyx_XGIVEREF(__pyx_t_28);
      __Pyx_XGIVEREF(__pyx_t_29);
      __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
      __Pyx_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_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L14:;
  }

  /* "HTSeq/_HTSeq.pyx":800
 *         raise NotImplementedError
 * 
 *     def write_bedgraph_file(             # <<<<<<<<<<<<<<
 *             self,
 *             file_or_filename,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.write_bedgraph_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sep);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_iv);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":860
 *                 f.close()
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_bedgraph_file(cls, file_or_filename, strand=".", typecode="d"):
 *         '''Create GenomicArray from BedGraph file
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15from_bedgraph_file(PyObject *__pyx_v_cls, 
#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_5HTSeq_6_HTSeq_12GenomicArray_14from_bedgraph_file, "Create GenomicArray from BedGraph file\n\n        See GenomicArray.write_bedgraph_file for details on the file format.\n\n        Args:\n            file_or_filename (str, path, or open file handle): Where to load\n              the BedGraph data from.\n            strand (\"+\", \"-\", or \".\"): strandedness of the returned array.\n            typecode (\"d\", \"i\", or \"l\"): Type of data in the file.\n              \"d\" means floating point (double), \"i\" is integer, \"l\" is long\n              integer.\n\n        Returns:\n            A GenomicArray instance with the data.\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_15from_bedgraph_file = {"from_bedgraph_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15from_bedgraph_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_14from_bedgraph_file};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15from_bedgraph_file(PyObject *__pyx_v_cls, 
#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_file_or_filename = 0;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_v_typecode = 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("from_bedgraph_file (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_file_or_filename,&__pyx_mstate_global->__pyx_n_u_strand,&__pyx_mstate_global->__pyx_n_u_typecode,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, 860, __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, 860, __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, 860, __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, 860, __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, "from_bedgraph_file", 0) < (0)) __PYX_ERR(0, 860, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__8));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_d));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("from_bedgraph_file", 0, 1, 3, i); __PYX_ERR(0, 860, __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, 860, __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, 860, __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, 860, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__8));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_d));
    }
    __pyx_v_file_or_filename = values[0];
    __pyx_v_strand = values[1];
    __pyx_v_typecode = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_bedgraph_file", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 860, __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("HTSeq._HTSeq.GenomicArray.from_bedgraph_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_14from_bedgraph_file(((PyTypeObject*)__pyx_v_cls), __pyx_v_file_or_filename, __pyx_v_strand, __pyx_v_typecode);

  /* 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_5HTSeq_6_HTSeq_12GenomicArray_14from_bedgraph_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_file_or_filename, PyObject *__pyx_v_strand, PyObject *__pyx_v_typecode) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_header = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_array = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_v_value = NULL;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  char const *__pyx_t_17;
  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;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_bedgraph_file", 0);

  /* "HTSeq/_HTSeq.pyx":877
 *             A GenomicArray instance with the data.
 *         '''
 *         if hasattr(file_or_filename, "read"):             # <<<<<<<<<<<<<<
 *             f = file_or_filename
 *         else:
*/
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_file_or_filename, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 877, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":878
 *         '''
 *         if hasattr(file_or_filename, "read"):
 *             f = file_or_filename             # <<<<<<<<<<<<<<
 *         else:
 *             f = open(file_or_filename, "r")
*/
    __Pyx_INCREF(__pyx_v_file_or_filename);
    __pyx_v_f = __pyx_v_file_or_filename;

    /* "HTSeq/_HTSeq.pyx":877
 *             A GenomicArray instance with the data.
 *         '''
 *         if hasattr(file_or_filename, "read"):             # <<<<<<<<<<<<<<
 *             f = file_or_filename
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":880
 *             f = file_or_filename
 *         else:
 *             f = open(file_or_filename, "r")             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_file_or_filename, __pyx_mstate_global->__pyx_n_u_r};
      __pyx_t_2 = __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_2)) __PYX_ERR(0, 880, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_f = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":882
 *             f = open(file_or_filename, "r")
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             # Find beginning of actual contents
 *             header = []
*/
  /*try:*/ {

    /* "HTSeq/_HTSeq.pyx":884
 *         try:
 *             # Find beginning of actual contents
 *             header = []             # <<<<<<<<<<<<<<
 *             for line in f:
 *                 if line.startswith('track type=bedGraph'):
*/
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_header = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":885
 *             # Find beginning of actual contents
 *             header = []
 *             for line in f:             # <<<<<<<<<<<<<<
 *                 if line.startswith('track type=bedGraph'):
 *                     break
*/
    if (likely(PyList_CheckExact(__pyx_v_f)) || PyTuple_CheckExact(__pyx_v_f)) {
      __pyx_t_2 = __pyx_v_f; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        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, 885, __pyx_L5_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_5;
        } 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, 885, __pyx_L5_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5);
          #endif
          ++__pyx_t_5;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L5_error)
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_2);
        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, 885, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":886
 *             header = []
 *             for line in f:
 *                 if line.startswith('track type=bedGraph'):             # <<<<<<<<<<<<<<
 *                     break
 *                 header.append(line)
*/
      __pyx_t_7 = __pyx_v_line;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_track_type_bedGraph_2};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 886, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_1) {

        /* "HTSeq/_HTSeq.pyx":887
 *             for line in f:
 *                 if line.startswith('track type=bedGraph'):
 *                     break             # <<<<<<<<<<<<<<
 *                 header.append(line)
 *             else:
*/
        goto __pyx_L8_break;

        /* "HTSeq/_HTSeq.pyx":886
 *             header = []
 *             for line in f:
 *                 if line.startswith('track type=bedGraph'):             # <<<<<<<<<<<<<<
 *                     break
 *                 header.append(line)
*/
      }

      /* "HTSeq/_HTSeq.pyx":888
 *                 if line.startswith('track type=bedGraph'):
 *                     break
 *                 header.append(line)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise IOError(
*/
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_header, __pyx_v_line); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 888, __pyx_L5_error)

      /* "HTSeq/_HTSeq.pyx":885
 *             # Find beginning of actual contents
 *             header = []
 *             for line in f:             # <<<<<<<<<<<<<<
 *                 if line.startswith('track type=bedGraph'):
 *                     break
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L10_for_else;
    __pyx_L8_break:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L11_for_end;
    /*else*/ {
      __pyx_L10_for_else:;

      /* "HTSeq/_HTSeq.pyx":890
 *                 header.append(line)
 *             else:
 *                 raise IOError(             # <<<<<<<<<<<<<<
 *                     "header line with 'track type=bedGraph' not found."
 *                 )
*/
      __pyx_t_3 = NULL;
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_header_line_with_track_type_bedG};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IOError)), __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, 890, __pyx_L5_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, 890, __pyx_L5_error)
    }
    __pyx_L11_for_end:;

    /* "HTSeq/_HTSeq.pyx":895
 * 
 *             # Create the instance with autochromosomes
 *             array = cls(             # <<<<<<<<<<<<<<
 *                 "auto-write",
 *                 stranded=strand != ".",
*/
    __pyx_t_3 = NULL;

    /* "HTSeq/_HTSeq.pyx":897
 *             array = cls(
 *                 "auto-write",
 *                 stranded=strand != ".",             # <<<<<<<<<<<<<<
 *                 typecode=typecode,
 *                 storage='step',
*/
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_strand, __pyx_mstate_global->__pyx_kp_u__8, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 897, __pyx_L5_error)

    /* "HTSeq/_HTSeq.pyx":900
 *                 typecode=typecode,
 *                 storage='step',
 *                 header=''.join(header),             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_9 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__12, __pyx_v_header); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 900, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_auto_write};
      __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 895, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_stranded, __pyx_t_7, __pyx_t_10, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 895, __pyx_L5_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_typecode, __pyx_v_typecode, __pyx_t_10, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 895, __pyx_L5_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_storage, __pyx_mstate_global->__pyx_n_u_step, __pyx_t_10, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 895, __pyx_L5_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_header, __pyx_t_9, __pyx_t_10, __pyx_callargs+2, 3) < (0)) __PYX_ERR(0, 895, __pyx_L5_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_v_cls, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
      __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_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 895, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_array = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":904
 * 
 *             # Load contents
 *             for line in f:             # <<<<<<<<<<<<<<
 *                 chrom, start, end, value = line.rstrip('\n\r').split()
 *                 start, end = int(start), int(end)
*/
    if (likely(PyList_CheckExact(__pyx_v_f)) || PyTuple_CheckExact(__pyx_v_f)) {
      __pyx_t_2 = __pyx_v_f; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 904, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        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, 904, __pyx_L5_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          __pyx_t_10 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_5;
        } 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, 904, __pyx_L5_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5));
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5);
          #endif
          ++__pyx_t_5;
        }
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 904, __pyx_L5_error)
      } else {
        __pyx_t_10 = __pyx_t_6(__pyx_t_2);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 904, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF_SET(__pyx_v_line, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "HTSeq/_HTSeq.pyx":905
 *             # Load contents
 *             for line in f:
 *                 chrom, start, end, value = line.rstrip('\n\r').split()             # <<<<<<<<<<<<<<
 *                 start, end = int(start), int(end)
 *                 if typecode in ('i', 'l'):
*/
      __pyx_t_3 = __pyx_v_line;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__21};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_rstrip, __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_7)) __PYX_ERR(0, 905, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_9 = __pyx_t_7;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
        __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 905, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
        PyObject* sequence = __pyx_t_10;
        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, 905, __pyx_L5_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_9);
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
          __Pyx_INCREF(__pyx_t_3);
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 3);
          __Pyx_INCREF(__pyx_t_11);
        } else {
          __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 905, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 905, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_9);
          __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 905, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 905, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_11);
        }
        #else
        {
          Py_ssize_t i;
          PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_9,&__pyx_t_3,&__pyx_t_11};
          for (i=0; i < 4; i++) {
            PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 905, __pyx_L5_error)
            __Pyx_GOTREF(item);
            *(temps[i]) = item;
          }
        }
        #endif
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else {
        Py_ssize_t index = -1;
        PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_9,&__pyx_t_3,&__pyx_t_11};
        __pyx_t_12 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 905, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
        for (index=0; index < 4; index++) {
          PyObject* item = __pyx_t_13(__pyx_t_12); if (unlikely(!item)) goto __pyx_L14_unpacking_failed;
          __Pyx_GOTREF(item);
          *(temps[index]) = item;
        }
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 4) < (0)) __PYX_ERR(0, 905, __pyx_L5_error)
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L15_unpacking_done;
        __pyx_L14_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 905, __pyx_L5_error)
        __pyx_L15_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "HTSeq/_HTSeq.pyx":906
 *             for line in f:
 *                 chrom, start, end, value = line.rstrip('\n\r').split()
 *                 start, end = int(start), int(end)             # <<<<<<<<<<<<<<
 *                 if typecode in ('i', 'l'):
 *                     value = int(value)
*/
      __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_v_start); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 906, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyNumber_Int(__pyx_v_end); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 906, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_DECREF_SET(__pyx_v_end, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "HTSeq/_HTSeq.pyx":907
 *                 chrom, start, end, value = line.rstrip('\n\r').split()
 *                 start, end = int(start), int(end)
 *                 if typecode in ('i', 'l'):             # <<<<<<<<<<<<<<
 *                     value = int(value)
 *                 elif typecode == 'd':
*/
      __Pyx_INCREF(__pyx_v_typecode);
      __pyx_t_11 = __pyx_v_typecode;
      __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_i, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 907, __pyx_L5_error)
      if (!__pyx_t_14) {
      } else {
        __pyx_t_1 = __pyx_t_14;
        goto __pyx_L17_bool_binop_done;
      }
      __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_l, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 907, __pyx_L5_error)
      __pyx_t_1 = __pyx_t_14;
      __pyx_L17_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_14 = __pyx_t_1;
      if (__pyx_t_14) {

        /* "HTSeq/_HTSeq.pyx":908
 *                 start, end = int(start), int(end)
 *                 if typecode in ('i', 'l'):
 *                     value = int(value)             # <<<<<<<<<<<<<<
 *                 elif typecode == 'd':
 *                     value = float(value)
*/
        __pyx_t_11 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 908, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "HTSeq/_HTSeq.pyx":907
 *                 chrom, start, end, value = line.rstrip('\n\r').split()
 *                 start, end = int(start), int(end)
 *                 if typecode in ('i', 'l'):             # <<<<<<<<<<<<<<
 *                     value = int(value)
 *                 elif typecode == 'd':
*/
        goto __pyx_L16;
      }

      /* "HTSeq/_HTSeq.pyx":909
 *                 if typecode in ('i', 'l'):
 *                     value = int(value)
 *                 elif typecode == 'd':             # <<<<<<<<<<<<<<
 *                     value = float(value)
 *                 else:
*/
      __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_typecode, __pyx_mstate_global->__pyx_n_u_d, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 909, __pyx_L5_error)
      if (likely(__pyx_t_14)) {

        /* "HTSeq/_HTSeq.pyx":910
 *                     value = int(value)
 *                 elif typecode == 'd':
 *                     value = float(value)             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(f"Typecode not supported: {typecode}")
*/
        __pyx_t_11 = __Pyx_PyNumber_Float(__pyx_v_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 910, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "HTSeq/_HTSeq.pyx":909
 *                 if typecode in ('i', 'l'):
 *                     value = int(value)
 *                 elif typecode == 'd':             # <<<<<<<<<<<<<<
 *                     value = float(value)
 *                 else:
*/
        goto __pyx_L16;
      }

      /* "HTSeq/_HTSeq.pyx":912
 *                     value = float(value)
 *                 else:
 *                     raise ValueError(f"Typecode not supported: {typecode}")             # <<<<<<<<<<<<<<
 * 
 *                 iv = GenomicInterval(chrom, start, end, strand=strand)
*/
      /*else*/ {
        __pyx_t_10 = NULL;
        __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_typecode, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Typecode_not_supported, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 912, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_4 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 912, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_Raise(__pyx_t_11, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(0, 912, __pyx_L5_error)
      }
      __pyx_L16:;

      /* "HTSeq/_HTSeq.pyx":914
 *                     raise ValueError(f"Typecode not supported: {typecode}")
 * 
 *                 iv = GenomicInterval(chrom, start, end, strand=strand)             # <<<<<<<<<<<<<<
 *                 array[iv] = value
 * 
*/
      __pyx_t_9 = NULL;
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_9, __pyx_v_chrom, __pyx_v_start, __pyx_v_end};
        __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 914, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_strand, __pyx_v_strand, __pyx_t_10, __pyx_callargs+4, 0) < (0)) __PYX_ERR(0, 914, __pyx_L5_error)
        __pyx_t_11 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 914, __pyx_L5_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_11);
      }
      __Pyx_XDECREF_SET(__pyx_v_iv, ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_11));
      __pyx_t_11 = 0;

      /* "HTSeq/_HTSeq.pyx":915
 * 
 *                 iv = GenomicInterval(chrom, start, end, strand=strand)
 *                 array[iv] = value             # <<<<<<<<<<<<<<
 * 
 *         finally:
*/
      if (unlikely((PyObject_SetItem(__pyx_v_array, ((PyObject *)__pyx_v_iv), __pyx_v_value) < 0))) __PYX_ERR(0, 915, __pyx_L5_error)

      /* "HTSeq/_HTSeq.pyx":904
 * 
 *             # Load contents
 *             for line in f:             # <<<<<<<<<<<<<<
 *                 chrom, start, end, value = line.rstrip('\n\r').split()
 *                 start, end = int(start), int(end)
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "HTSeq/_HTSeq.pyx":919
 *         finally:
 *             # Close the file only if we were the ones to open it
 *             if not hasattr(file_or_filename, "read"):             # <<<<<<<<<<<<<<
 *                 f.close()
 * 
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_14 = __Pyx_HasAttr(__pyx_v_file_or_filename, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 919, __pyx_L1_error)
      __pyx_t_1 = (!__pyx_t_14);
      if (__pyx_t_1) {

        /* "HTSeq/_HTSeq.pyx":920
 *             # Close the file only if we were the ones to open it
 *             if not hasattr(file_or_filename, "read"):
 *                 f.close()             # <<<<<<<<<<<<<<
 * 
 *         return array
*/
        __pyx_t_11 = __pyx_v_f;
        __Pyx_INCREF(__pyx_t_11);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "HTSeq/_HTSeq.pyx":919
 *         finally:
 *             # Close the file only if we were the ones to open it
 *             if not hasattr(file_or_filename, "read"):             # <<<<<<<<<<<<<<
 *                 f.close()
 * 
*/
      }
      goto __pyx_L6;
    }
    __pyx_L5_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 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_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
      if ( unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_21);
      __Pyx_XGOTREF(__pyx_t_22);
      __Pyx_XGOTREF(__pyx_t_23);
      __pyx_t_15 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
      {
        __pyx_t_1 = __Pyx_HasAttr(__pyx_v_file_or_filename, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 919, __pyx_L22_error)
        __pyx_t_14 = (!__pyx_t_1);
        if (__pyx_t_14) {

          /* "HTSeq/_HTSeq.pyx":920
 *             # Close the file only if we were the ones to open it
 *             if not hasattr(file_or_filename, "read"):
 *                 f.close()             # <<<<<<<<<<<<<<
 * 
 *         return array
*/
          __pyx_t_11 = __pyx_v_f;
          __Pyx_INCREF(__pyx_t_11);
          __pyx_t_4 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "HTSeq/_HTSeq.pyx":919
 *         finally:
 *             # Close the file only if we were the ones to open it
 *             if not hasattr(file_or_filename, "read"):             # <<<<<<<<<<<<<<
 *                 f.close()
 * 
*/
        }
      }
      __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);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
      __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
      goto __pyx_L1_error;
      __pyx_L22_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);
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L6:;
  }

  /* "HTSeq/_HTSeq.pyx":922
 *                 f.close()
 * 
 *         return array             # <<<<<<<<<<<<<<
 * 
 *     def write_bigwig_file(
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_array);
  __pyx_r = __pyx_v_array;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":860
 *                 f.close()
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_bedgraph_file(cls, file_or_filename, strand=".", typecode="d"):
 *         '''Create GenomicArray from BedGraph file
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.from_bedgraph_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_header);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_array);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF((PyObject *)__pyx_v_iv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":924
 *         return array
 * 
 *     def write_bigwig_file(             # <<<<<<<<<<<<<<
 *             self,
 *             filename,
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file(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_5HTSeq_6_HTSeq_12GenomicArray_16write_bigwig_file, "Write GenomicArray to BigWig file\n\n        BigWig files are used to visualize genomic \"tracks\", notably in\n        UCSC's genomic viewer. They are, in a sense, the binary compressed\n        equivalent of BedGraph files. This function stores the GenomicArray\n        into such a file for further use.\n\n        Args:\n            filename (str or path): Where to store the data.\n            strand (\".\", \"+\", or \"-\"): Which strand to write to file.\n\n        The BigWig file format is described here:\n\n            http://genome.ucsc.edu/goldenPath/help/bigWig.html\n\n        NOTE: This function requires the package pyBigWig at:\n\n            https://github.com/deeptools/pyBigWig\n\n        Install it via pip, conda, or see instructions at that page.\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file = {"write_bigwig_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_16write_bigwig_file};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_strand = 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("write_bigwig_file (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_filename,&__pyx_mstate_global->__pyx_n_u_strand,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, 924, __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, 924, __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, 924, __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, "write_bigwig_file", 0) < (0)) __PYX_ERR(0, 924, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__8));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_bigwig_file", 0, 1, 2, i); __PYX_ERR(0, 924, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 924, __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, 924, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__8));
    }
    __pyx_v_filename = values[0];
    __pyx_v_strand = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_bigwig_file", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 924, __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("HTSeq._HTSeq.GenomicArray.write_bigwig_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_16write_bigwig_file(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), __pyx_v_filename, __pyx_v_strand);

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

/* "HTSeq/_HTSeq.pyx":975
 *             bufsize = 1000
 * 
 *             def write_with_buffer(bw, entries, bufsize, newentry=None):             # <<<<<<<<<<<<<<
 *                 if newentry is not None:
 *                     for key in entries:
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file_1write_with_buffer(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_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file_1write_with_buffer = {"write_with_buffer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file_1write_with_buffer, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file_1write_with_buffer(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_bw = 0;
  PyObject *__pyx_v_entries = 0;
  PyObject *__pyx_v_bufsize = 0;
  PyObject *__pyx_v_newentry = 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("write_with_buffer (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_bw,&__pyx_mstate_global->__pyx_n_u_entries,&__pyx_mstate_global->__pyx_n_u_bufsize,&__pyx_mstate_global->__pyx_n_u_newentry,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, 975, __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, 975, __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, 975, __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, 975, __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, 975, __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, "write_with_buffer", 0) < (0)) __PYX_ERR(0, 975, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_with_buffer", 0, 3, 4, i); __PYX_ERR(0, 975, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 975, __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, 975, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 975, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 975, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_bw = values[0];
    __pyx_v_entries = values[1];
    __pyx_v_bufsize = values[2];
    __pyx_v_newentry = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_with_buffer", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 975, __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("HTSeq._HTSeq.GenomicArray.write_bigwig_file.write_with_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file_write_with_buffer(__pyx_self, __pyx_v_bw, __pyx_v_entries, __pyx_v_bufsize, __pyx_v_newentry);

  /* 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_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file_write_with_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bw, PyObject *__pyx_v_entries, PyObject *__pyx_v_bufsize, PyObject *__pyx_v_newentry) {
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_with_buffer", 0);

  /* "HTSeq/_HTSeq.pyx":976
 * 
 *             def write_with_buffer(bw, entries, bufsize, newentry=None):
 *                 if newentry is not None:             # <<<<<<<<<<<<<<
 *                     for key in entries:
 *                         entries[key].append(newentry[key])
*/
  __pyx_t_1 = (__pyx_v_newentry != Py_None);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":977
 *             def write_with_buffer(bw, entries, bufsize, newentry=None):
 *                 if newentry is not None:
 *                     for key in entries:             # <<<<<<<<<<<<<<
 *                         entries[key].append(newentry[key])
 *                 if len(entries) >= bufsize:
*/
    if (likely(PyList_CheckExact(__pyx_v_entries)) || PyTuple_CheckExact(__pyx_v_entries)) {
      __pyx_t_2 = __pyx_v_entries; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_entries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 977, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 977, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 977, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 977, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "HTSeq/_HTSeq.pyx":978
 *                 if newentry is not None:
 *                     for key in entries:
 *                         entries[key].append(newentry[key])             # <<<<<<<<<<<<<<
 *                 if len(entries) >= bufsize:
 *                     bw.addEntries(
*/
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_entries, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_newentry, __pyx_v_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 978, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_Append(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 978, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "HTSeq/_HTSeq.pyx":977
 *             def write_with_buffer(bw, entries, bufsize, newentry=None):
 *                 if newentry is not None:
 *                     for key in entries:             # <<<<<<<<<<<<<<
 *                         entries[key].append(newentry[key])
 *                 if len(entries) >= bufsize:
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":976
 * 
 *             def write_with_buffer(bw, entries, bufsize, newentry=None):
 *                 if newentry is not None:             # <<<<<<<<<<<<<<
 *                     for key in entries:
 *                         entries[key].append(newentry[key])
*/
  }

  /* "HTSeq/_HTSeq.pyx":979
 *                     for key in entries:
 *                         entries[key].append(newentry[key])
 *                 if len(entries) >= bufsize:             # <<<<<<<<<<<<<<
 *                     bw.addEntries(
 *                         entries['chrom'], entries['start'],
*/
  __pyx_t_3 = PyObject_Length(__pyx_v_entries); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 979, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_bufsize, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 979, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 979, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":980
 *                         entries[key].append(newentry[key])
 *                 if len(entries) >= bufsize:
 *                     bw.addEntries(             # <<<<<<<<<<<<<<
 *                         entries['chrom'], entries['start'],
 *                         ends=entries['ends'], values=entries['values'],
*/
    __pyx_t_2 = __pyx_v_bw;
    __Pyx_INCREF(__pyx_t_2);

    /* "HTSeq/_HTSeq.pyx":981
 *                 if len(entries) >= bufsize:
 *                     bw.addEntries(
 *                         entries['chrom'], entries['start'],             # <<<<<<<<<<<<<<
 *                         ends=entries['ends'], values=entries['values'],
 *                     )
*/
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_entries, __pyx_mstate_global->__pyx_n_u_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_entries, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);

    /* "HTSeq/_HTSeq.pyx":982
 *                     bw.addEntries(
 *                         entries['chrom'], entries['start'],
 *                         ends=entries['ends'], values=entries['values'],             # <<<<<<<<<<<<<<
 *                     )
 *                     for key in entries:
*/
    __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_v_entries, __pyx_mstate_global->__pyx_n_u_ends); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_v_entries, __pyx_mstate_global->__pyx_n_u_values); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, __pyx_t_5, __pyx_t_8};
      __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 980, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ends, __pyx_t_9, __pyx_t_12, __pyx_callargs+3, 0) < (0)) __PYX_ERR(0, 980, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_values, __pyx_t_10, __pyx_t_12, __pyx_callargs+3, 1) < (0)) __PYX_ERR(0, 980, __pyx_L1_error)
      __pyx_t_6 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_addEntries, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 980, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":984
 *                         ends=entries['ends'], values=entries['values'],
 *                     )
 *                     for key in entries:             # <<<<<<<<<<<<<<
 *                         entries[key].clear()
 * 
*/
    if (likely(PyList_CheckExact(__pyx_v_entries)) || PyTuple_CheckExact(__pyx_v_entries)) {
      __pyx_t_6 = __pyx_v_entries; __Pyx_INCREF(__pyx_t_6);
      __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_entries); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 984, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        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, 984, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_3;
        } 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, 984, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_3));
          #else
          __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 984, __pyx_L1_error)
      } else {
        __pyx_t_12 = __pyx_t_4(__pyx_t_6);
        if (unlikely(!__pyx_t_12)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 984, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "HTSeq/_HTSeq.pyx":985
 *                     )
 *                     for key in entries:
 *                         entries[key].clear()             # <<<<<<<<<<<<<<
 * 
 *             for chrom in self.chrom_vectors:
*/
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_entries, __pyx_v_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __pyx_t_9;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
        __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 985, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "HTSeq/_HTSeq.pyx":984
 *                         ends=entries['ends'], values=entries['values'],
 *                     )
 *                     for key in entries:             # <<<<<<<<<<<<<<
 *                         entries[key].clear()
 * 
*/
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "HTSeq/_HTSeq.pyx":979
 *                     for key in entries:
 *                         entries[key].append(newentry[key])
 *                 if len(entries) >= bufsize:             # <<<<<<<<<<<<<<
 *                     bw.addEntries(
 *                         entries['chrom'], entries['start'],
*/
  }

  /* "HTSeq/_HTSeq.pyx":975
 *             bufsize = 1000
 * 
 *             def write_with_buffer(bw, entries, bufsize, newentry=None):             # <<<<<<<<<<<<<<
 *                 if newentry is not None:
 *                     for key in entries:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.write_bigwig_file.write_with_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":924
 *         return array
 * 
 *     def write_bigwig_file(             # <<<<<<<<<<<<<<
 *             self,
 *             filename,
*/

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_16write_bigwig_file(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_strand) {
  PyObject *__pyx_v_pyBigWig = NULL;
  PyObject *__pyx_v_bw = NULL;
  PyObject *__pyx_v_header = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_cv = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_v_entries = NULL;
  long __pyx_v_bufsize;
  PyObject *__pyx_v_write_with_buffer = 0;
  PyObject *__pyx_v_iv = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_entry = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  PyObject *(*__pyx_t_20)(PyObject *);
  PyObject *__pyx_t_21 = NULL;
  PyObject *(*__pyx_t_22)(PyObject *);
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_bigwig_file", 0);

  /* "HTSeq/_HTSeq.pyx":950
 *         Install it via pip, conda, or see instructions at that page.
 *         '''
 *         try:             # <<<<<<<<<<<<<<
 *             import pyBigWig
 *         except ImportError:
*/
  {
    __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:*/ {

      /* "HTSeq/_HTSeq.pyx":951
 *         '''
 *         try:
 *             import pyBigWig             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             raise ImportError(
*/
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyBigWig, 0, 0, NULL, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L3_error)
      __pyx_t_4 = __pyx_t_5;
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pyBigWig = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":950
 *         Install it via pip, conda, or see instructions at that page.
 *         '''
 *         try:             # <<<<<<<<<<<<<<
 *             import pyBigWig
 *         except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":952
 *         try:
 *             import pyBigWig
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             raise ImportError(
 *                 'pyBigWig is required to write a GenomicArray to a bigWig file',
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.write_bigwig_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 952, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "HTSeq/_HTSeq.pyx":953
 *             import pyBigWig
 *         except ImportError:
 *             raise ImportError(             # <<<<<<<<<<<<<<
 *                 'pyBigWig is required to write a GenomicArray to a bigWig file',
 *             )
*/
      __pyx_t_10 = NULL;
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_pyBigWig_is_required_to_write_a};
        __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 953, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(0, 953, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "HTSeq/_HTSeq.pyx":950
 *         Install it via pip, conda, or see instructions at that page.
 *         '''
 *         try:             # <<<<<<<<<<<<<<
 *             import pyBigWig
 *         except ImportError:
*/
    __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:;
  }

  /* "HTSeq/_HTSeq.pyx":957
 *             )
 * 
 *         if (not self.stranded) and strand != ".":             # <<<<<<<<<<<<<<
 *             raise ValueError("Strand specified in unstranded GenomicArray.")
 *         if self.stranded and strand not in (strand_plus, strand_minus):
*/
  __pyx_t_13 = (!__pyx_v_self->stranded);
  if (__pyx_t_13) {
  } else {
    __pyx_t_12 = __pyx_t_13;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_v_strand, __pyx_mstate_global->__pyx_kp_u__8, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 957, __pyx_L1_error)
  __pyx_t_12 = __pyx_t_13;
  __pyx_L12_bool_binop_done:;
  if (unlikely(__pyx_t_12)) {

    /* "HTSeq/_HTSeq.pyx":958
 * 
 *         if (not self.stranded) and strand != ".":
 *             raise ValueError("Strand specified in unstranded GenomicArray.")             # <<<<<<<<<<<<<<
 *         if self.stranded and strand not in (strand_plus, strand_minus):
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
*/
    __pyx_t_7 = NULL;
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_Strand_specified_in_unstranded_G};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(0, 958, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":957
 *             )
 * 
 *         if (not self.stranded) and strand != ".":             # <<<<<<<<<<<<<<
 *             raise ValueError("Strand specified in unstranded GenomicArray.")
 *         if self.stranded and strand not in (strand_plus, strand_minus):
*/
  }

  /* "HTSeq/_HTSeq.pyx":959
 *         if (not self.stranded) and strand != ".":
 *             raise ValueError("Strand specified in unstranded GenomicArray.")
 *         if self.stranded and strand not in (strand_plus, strand_minus):             # <<<<<<<<<<<<<<
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
 * 
*/
  if (__pyx_v_self->stranded) {
  } else {
    __pyx_t_12 = __pyx_v_self->stranded;
    goto __pyx_L15_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_v_strand);
  __pyx_t_8 = __pyx_v_strand;
  __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_v_5HTSeq_6_HTSeq_strand_plus, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 959, __pyx_L1_error)
  if (__pyx_t_14) {
  } else {
    __pyx_t_13 = __pyx_t_14;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_v_5HTSeq_6_HTSeq_strand_minus, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 959, __pyx_L1_error)
  __pyx_t_13 = __pyx_t_14;
  __pyx_L17_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_14 = __pyx_t_13;
  __pyx_t_12 = __pyx_t_14;
  __pyx_L15_bool_binop_done:;
  if (unlikely(__pyx_t_12)) {

    /* "HTSeq/_HTSeq.pyx":960
 *             raise ValueError("Strand specified in unstranded GenomicArray.")
 *         if self.stranded and strand not in (strand_plus, strand_minus):
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")             # <<<<<<<<<<<<<<
 * 
 *         with pyBigWig.open(filename, "w") as bw:
*/
    __pyx_t_7 = NULL;
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_Strand_must_be_specified_for_str};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 960, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(0, 960, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":959
 *         if (not self.stranded) and strand != ".":
 *             raise ValueError("Strand specified in unstranded GenomicArray.")
 *         if self.stranded and strand not in (strand_plus, strand_minus):             # <<<<<<<<<<<<<<
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
 * 
*/
  }

  /* "HTSeq/_HTSeq.pyx":962
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
 * 
 *         with pyBigWig.open(filename, "w") as bw:             # <<<<<<<<<<<<<<
 *             # Write header with chromosome info
 *             header = []
*/
  /*with:*/ {
    __pyx_t_7 = __pyx_v_pyBigWig;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w_2};
      __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_open, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 962, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 962, __pyx_L19_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 962, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_9 = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_1, &__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_5);
        /*try:*/ {
          __pyx_v_bw = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":964
 *         with pyBigWig.open(filename, "w") as bw:
 *             # Write header with chromosome info
 *             header = []             # <<<<<<<<<<<<<<
 *             for chrom in self.chrom_vectors:
 *                 cv = self.chrom_vectors[chrom][strand]
*/
          __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 964, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_v_header = ((PyObject*)__pyx_t_9);
          __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":965
 *             # Write header with chromosome info
 *             header = []
 *             for chrom in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                 cv = self.chrom_vectors[chrom][strand]
 *                 end = cv.iv.end
*/
          __pyx_t_15 = 0;
          if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            __PYX_ERR(0, 965, __pyx_L23_error)
          }
          __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_self->chrom_vectors, 1, ((PyObject *)NULL), (&__pyx_t_16), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 965, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_9);
          __pyx_t_9 = __pyx_t_8;
          __pyx_t_8 = 0;
          while (1) {
            __pyx_t_17 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_16, &__pyx_t_15, &__pyx_t_8, NULL, NULL, __pyx_t_6);
            if (unlikely(__pyx_t_17 == 0)) break;
            if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 965, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_8);
            __pyx_t_8 = 0;

            /* "HTSeq/_HTSeq.pyx":966
 *             header = []
 *             for chrom in self.chrom_vectors:
 *                 cv = self.chrom_vectors[chrom][strand]             # <<<<<<<<<<<<<<
 *                 end = cv.iv.end
 *                 header.append((chrom, end))
*/
            if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              __PYX_ERR(0, 966, __pyx_L23_error)
            }
            __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 966, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 966, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF_SET(__pyx_v_cv, __pyx_t_7);
            __pyx_t_7 = 0;

            /* "HTSeq/_HTSeq.pyx":967
 *             for chrom in self.chrom_vectors:
 *                 cv = self.chrom_vectors[chrom][strand]
 *                 end = cv.iv.end             # <<<<<<<<<<<<<<
 *                 header.append((chrom, end))
 *             bw.addHeader(header)
*/
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cv, __pyx_mstate_global->__pyx_n_u_iv); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 967, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 967, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_8);
            __pyx_t_8 = 0;

            /* "HTSeq/_HTSeq.pyx":968
 *                 cv = self.chrom_vectors[chrom][strand]
 *                 end = cv.iv.end
 *                 header.append((chrom, end))             # <<<<<<<<<<<<<<
 *             bw.addHeader(header)
 * 
*/
            __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 968, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_INCREF(__pyx_v_chrom);
            __Pyx_GIVEREF(__pyx_v_chrom);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_chrom) != (0)) __PYX_ERR(0, 968, __pyx_L23_error);
            __Pyx_INCREF(__pyx_v_end);
            __Pyx_GIVEREF(__pyx_v_end);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end) != (0)) __PYX_ERR(0, 968, __pyx_L23_error);
            __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_header, __pyx_t_8); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 968, __pyx_L23_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":969
 *                 end = cv.iv.end
 *                 header.append((chrom, end))
 *             bw.addHeader(header)             # <<<<<<<<<<<<<<
 * 
 *             # Write data (use a buffer for efficiency)
*/
          __pyx_t_8 = __pyx_v_bw;
          __Pyx_INCREF(__pyx_t_8);
          __pyx_t_11 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_header};
            __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_addHeader, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 969, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":972
 * 
 *             # Write data (use a buffer for efficiency)
 *             entries = {'chrom': [], 'start': [], 'ends': [], 'values': []}             # <<<<<<<<<<<<<<
 *             bufsize = 1000
 * 
*/
          __pyx_t_9 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 972, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 972, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_chrom, __pyx_t_8) < (0)) __PYX_ERR(0, 972, __pyx_L23_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 972, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_start, __pyx_t_8) < (0)) __PYX_ERR(0, 972, __pyx_L23_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 972, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ends, __pyx_t_8) < (0)) __PYX_ERR(0, 972, __pyx_L23_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 972, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_values, __pyx_t_8) < (0)) __PYX_ERR(0, 972, __pyx_L23_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_v_entries = ((PyObject*)__pyx_t_9);
          __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":973
 *             # Write data (use a buffer for efficiency)
 *             entries = {'chrom': [], 'start': [], 'ends': [], 'values': []}
 *             bufsize = 1000             # <<<<<<<<<<<<<<
 * 
 *             def write_with_buffer(bw, entries, bufsize, newentry=None):
*/
          __pyx_v_bufsize = 0x3E8;

          /* "HTSeq/_HTSeq.pyx":975
 *             bufsize = 1000
 * 
 *             def write_with_buffer(bw, entries, bufsize, newentry=None):             # <<<<<<<<<<<<<<
 *                 if newentry is not None:
 *                     for key in entries:
*/
          __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file_1write_with_buffer, 0, __pyx_mstate_global->__pyx_n_u_write_bigwig_file_locals_write_w, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 975, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_mstate_global->__pyx_tuple[0]);
          __pyx_v_write_with_buffer = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":987
 *                         entries[key].clear()
 * 
 *             for chrom in self.chrom_vectors:             # <<<<<<<<<<<<<<
 *                 cv = self.chrom_vectors[chrom][strand]
 *                 for iv, value in cv.steps():
*/
          __pyx_t_16 = 0;
          if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            __PYX_ERR(0, 987, __pyx_L23_error)
          }
          __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_self->chrom_vectors, 1, ((PyObject *)NULL), (&__pyx_t_15), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 987, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_9);
          __pyx_t_9 = __pyx_t_8;
          __pyx_t_8 = 0;
          while (1) {
            __pyx_t_17 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_15, &__pyx_t_16, &__pyx_t_8, NULL, NULL, __pyx_t_6);
            if (unlikely(__pyx_t_17 == 0)) break;
            if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 987, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_8);
            __pyx_t_8 = 0;

            /* "HTSeq/_HTSeq.pyx":988
 * 
 *             for chrom in self.chrom_vectors:
 *                 cv = self.chrom_vectors[chrom][strand]             # <<<<<<<<<<<<<<
 *                 for iv, value in cv.steps():
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
*/
            if (unlikely(__pyx_v_self->chrom_vectors == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              __PYX_ERR(0, 988, __pyx_L23_error)
            }
            __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->chrom_vectors, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 988, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 988, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF_SET(__pyx_v_cv, __pyx_t_7);
            __pyx_t_7 = 0;

            /* "HTSeq/_HTSeq.pyx":989
 *             for chrom in self.chrom_vectors:
 *                 cv = self.chrom_vectors[chrom][strand]
 *                 for iv, value in cv.steps():             # <<<<<<<<<<<<<<
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
 *                         continue
*/
            __pyx_t_8 = __pyx_v_cv;
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_11 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
              __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_steps, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 989, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_7);
            }
            if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
              __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8);
              __pyx_t_19 = 0;
              __pyx_t_20 = NULL;
            } else {
              __pyx_t_19 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_20 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 989, __pyx_L23_error)
            }
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            for (;;) {
              if (likely(!__pyx_t_20)) {
                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, 989, __pyx_L23_error)
                    #endif
                    if (__pyx_t_19 >= __pyx_temp) break;
                  }
                  __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_19, __Pyx_ReferenceSharing_OwnStrongReference);
                  ++__pyx_t_19;
                } 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, 989, __pyx_L23_error)
                    #endif
                    if (__pyx_t_19 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_19));
                  #else
                  __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_19);
                  #endif
                  ++__pyx_t_19;
                }
                if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 989, __pyx_L23_error)
              } else {
                __pyx_t_7 = __pyx_t_20(__pyx_t_8);
                if (unlikely(!__pyx_t_7)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 989, __pyx_L23_error)
                    PyErr_Clear();
                  }
                  break;
                }
              }
              __Pyx_GOTREF(__pyx_t_7);
              if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
                PyObject* sequence = __pyx_t_7;
                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, 989, __pyx_L23_error)
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                if (likely(PyTuple_CheckExact(sequence))) {
                  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
                  __Pyx_INCREF(__pyx_t_4);
                  __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
                  __Pyx_INCREF(__pyx_t_10);
                } else {
                  __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
                  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L23_error)
                  __Pyx_XGOTREF(__pyx_t_4);
                  __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
                  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 989, __pyx_L23_error)
                  __Pyx_XGOTREF(__pyx_t_10);
                }
                #else
                __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 989, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_10);
                #endif
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              } else {
                Py_ssize_t index = -1;
                __pyx_t_21 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 989, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_21);
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                __pyx_t_22 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_21);
                index = 0; __pyx_t_4 = __pyx_t_22(__pyx_t_21); if (unlikely(!__pyx_t_4)) goto __pyx_L35_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_4);
                index = 1; __pyx_t_10 = __pyx_t_22(__pyx_t_21); if (unlikely(!__pyx_t_10)) goto __pyx_L35_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_10);
                if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_21), 2) < (0)) __PYX_ERR(0, 989, __pyx_L23_error)
                __pyx_t_22 = NULL;
                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                goto __pyx_L36_unpacking_done;
                __pyx_L35_unpacking_failed:;
                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                __pyx_t_22 = NULL;
                if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                __PYX_ERR(0, 989, __pyx_L23_error)
                __pyx_L36_unpacking_done:;
              }
              __Pyx_XDECREF_SET(__pyx_v_iv, __pyx_t_4);
              __pyx_t_4 = 0;
              __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
              __pyx_t_10 = 0;

              /* "HTSeq/_HTSeq.pyx":990
 *                 cv = self.chrom_vectors[chrom][strand]
 *                 for iv, value in cv.steps():
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:             # <<<<<<<<<<<<<<
 *                         continue
 * 
*/
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_10 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = __Pyx_PyLong_SubtractObjC(__pyx_t_10, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_10 = PyObject_RichCompare(__pyx_t_7, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (!__pyx_t_14) {
              } else {
                __pyx_t_12 = __pyx_t_14;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 990, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_12 = __pyx_t_14;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_12) {

                /* "HTSeq/_HTSeq.pyx":991
 *                 for iv, value in cv.steps():
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *                     entry = {
*/
                goto __pyx_L33_continue;

                /* "HTSeq/_HTSeq.pyx":990
 *                 cv = self.chrom_vectors[chrom][strand]
 *                 for iv, value in cv.steps():
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:             # <<<<<<<<<<<<<<
 *                         continue
 * 
*/
              }

              /* "HTSeq/_HTSeq.pyx":994
 * 
 *                     entry = {
 *                         'chrom': chrom,             # <<<<<<<<<<<<<<
 *                         'start': iv.start,
 *                         'ends': iv.end,
*/
              __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 994, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_4);
              if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_chrom, __pyx_v_chrom) < (0)) __PYX_ERR(0, 994, __pyx_L23_error)

              /* "HTSeq/_HTSeq.pyx":995
 *                     entry = {
 *                         'chrom': chrom,
 *                         'start': iv.start,             # <<<<<<<<<<<<<<
 *                         'ends': iv.end,
 *                         'values': value,
*/
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 995, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_7);
              if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_start, __pyx_t_7) < (0)) __PYX_ERR(0, 994, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

              /* "HTSeq/_HTSeq.pyx":996
 *                         'chrom': chrom,
 *                         'start': iv.start,
 *                         'ends': iv.end,             # <<<<<<<<<<<<<<
 *                         'values': value,
 *                     }
*/
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 996, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_7);
              if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ends, __pyx_t_7) < (0)) __PYX_ERR(0, 994, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

              /* "HTSeq/_HTSeq.pyx":997
 *                         'start': iv.start,
 *                         'ends': iv.end,
 *                         'values': value,             # <<<<<<<<<<<<<<
 *                     }
 *                     write_with_buffer(bw, entries, bufsize, newentry=entry)
*/
              if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_values, __pyx_v_value) < (0)) __PYX_ERR(0, 994, __pyx_L23_error)
              __Pyx_XDECREF_SET(__pyx_v_entry, ((PyObject*)__pyx_t_4));
              __pyx_t_4 = 0;

              /* "HTSeq/_HTSeq.pyx":999
 *                         'values': value,
 *                     }
 *                     write_with_buffer(bw, entries, bufsize, newentry=entry)             # <<<<<<<<<<<<<<
 *             # Flush buffer
 *             write_with_buffer(bw, entries, bufsize=1)
*/
              __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_v_bufsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 999, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_INCREF(__pyx_v_bw);
              __Pyx_GIVEREF(__pyx_v_bw);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_bw) != (0)) __PYX_ERR(0, 999, __pyx_L23_error);
              __Pyx_INCREF(__pyx_v_entries);
              __Pyx_GIVEREF(__pyx_v_entries);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_entries) != (0)) __PYX_ERR(0, 999, __pyx_L23_error);
              __Pyx_GIVEREF(__pyx_t_4);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4) != (0)) __PYX_ERR(0, 999, __pyx_L23_error);
              __pyx_t_4 = 0;
              __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_4);
              if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_newentry, __pyx_v_entry) < (0)) __PYX_ERR(0, 999, __pyx_L23_error)
              __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_write_with_buffer, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 999, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "HTSeq/_HTSeq.pyx":989
 *             for chrom in self.chrom_vectors:
 *                 cv = self.chrom_vectors[chrom][strand]
 *                 for iv, value in cv.steps():             # <<<<<<<<<<<<<<
 *                     if iv.start == -sys.maxsize - 1 or iv.end == sys.maxsize:
 *                         continue
*/
              __pyx_L33_continue:;
            }
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":1001
 *                     write_with_buffer(bw, entries, bufsize, newentry=entry)
 *             # Flush buffer
 *             write_with_buffer(bw, entries, bufsize=1)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
          __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1001, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_v_bw);
          __Pyx_GIVEREF(__pyx_v_bw);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_bw) != (0)) __PYX_ERR(0, 1001, __pyx_L23_error);
          __Pyx_INCREF(__pyx_v_entries);
          __Pyx_GIVEREF(__pyx_v_entries);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_entries) != (0)) __PYX_ERR(0, 1001, __pyx_L23_error);
          __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1001, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_bufsize, __pyx_mstate_global->__pyx_int_1) < (0)) __PYX_ERR(0, 1001, __pyx_L23_error)
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_write_with_buffer, __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1001, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "HTSeq/_HTSeq.pyx":962
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
 * 
 *         with pyBigWig.open(filename, "w") as bw:             # <<<<<<<<<<<<<<
 *             # Write header with chromosome info
 *             header = []
*/
        }
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L28_try_end;
        __pyx_L23_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.write_bigwig_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 962, __pyx_L25_except_error)
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_10, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L25_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 962, __pyx_L25_except_error)
          __Pyx_GOTREF(__pyx_t_23);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_23);
          __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
          if (__pyx_t_12 < (0)) __PYX_ERR(0, 962, __pyx_L25_except_error)
          __pyx_t_14 = (!__pyx_t_12);
          if (unlikely(__pyx_t_14)) {
            __Pyx_GIVEREF(__pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_ErrRestoreWithState(__pyx_t_10, __pyx_t_8, __pyx_t_9);
            __pyx_t_10 = 0;  __pyx_t_8 = 0;  __pyx_t_9 = 0; 
            __PYX_ERR(0, 962, __pyx_L25_except_error)
          }
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L24_exception_handled;
        }
        __pyx_L25_except_error:;
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_1, __pyx_t_5);
        goto __pyx_L1_error;
        __pyx_L24_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_1, __pyx_t_5);
        __pyx_L28_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_3) {
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1], NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
    goto __pyx_L44;
    __pyx_L19_error:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L1_error;
    __pyx_L44:;
  }

  /* "HTSeq/_HTSeq.pyx":924
 *         return array
 * 
 *     def write_bigwig_file(             # <<<<<<<<<<<<<<
 *             self,
 *             filename,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.write_bigwig_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyBigWig);
  __Pyx_XDECREF(__pyx_v_bw);
  __Pyx_XDECREF(__pyx_v_header);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_cv);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_v_entries);
  __Pyx_XDECREF(__pyx_v_write_with_buffer);
  __Pyx_XDECREF(__pyx_v_iv);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_entry);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1003
 *             write_with_buffer(bw, entries, bufsize=1)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_bigwig_file(cls, filename, strand=".", typecode="d"):
 *         '''Create GenomicArray from BigWig file
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_19from_bigwig_file(PyObject *__pyx_v_cls, 
#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_5HTSeq_6_HTSeq_12GenomicArray_18from_bigwig_file, "Create GenomicArray from BigWig file\n\n        See GenomicArray.write_bigwig for details on the file format.\n\n        Args:\n            filename (str or path): Where to load the data from.\n            strand (\"+\", \"-\", or \".\"): strandedness of the returned array.\n            typecode (\"d\", \"i\", or \"l\"): Type of data in the file.\n              \"d\" means floating point (double), \"i\" is integer, \"l\" is long\n              integer.\n\n        Returns:\n            A GenomicArray instance with the data.\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_19from_bigwig_file = {"from_bigwig_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_19from_bigwig_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_18from_bigwig_file};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_19from_bigwig_file(PyObject *__pyx_v_cls, 
#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_filename = 0;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_v_typecode = 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("from_bigwig_file (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_filename,&__pyx_mstate_global->__pyx_n_u_strand,&__pyx_mstate_global->__pyx_n_u_typecode,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, 1003, __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, 1003, __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, 1003, __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, 1003, __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, "from_bigwig_file", 0) < (0)) __PYX_ERR(0, 1003, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__8));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_d));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("from_bigwig_file", 0, 1, 3, i); __PYX_ERR(0, 1003, __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, 1003, __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, 1003, __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, 1003, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__8));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_d));
    }
    __pyx_v_filename = values[0];
    __pyx_v_strand = values[1];
    __pyx_v_typecode = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_bigwig_file", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 1003, __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("HTSeq._HTSeq.GenomicArray.from_bigwig_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_18from_bigwig_file(((PyTypeObject*)__pyx_v_cls), __pyx_v_filename, __pyx_v_strand, __pyx_v_typecode);

  /* 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_5HTSeq_6_HTSeq_12GenomicArray_18from_bigwig_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename, PyObject *__pyx_v_strand, PyObject *__pyx_v_typecode) {
  CYTHON_UNUSED PyObject *__pyx_v_pyBigWig = NULL;
  PyObject *__pyx_v_BigWig_Reader = NULL;
  PyObject *__pyx_v_bw = NULL;
  PyObject *__pyx_v_chrom_dict = NULL;
  PyObject *__pyx_v_array = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_intervals = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *(*__pyx_t_20)(PyObject *);
  int __pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_bigwig_file", 0);

  /* "HTSeq/_HTSeq.pyx":1019
 *             A GenomicArray instance with the data.
 *         '''
 *         try:             # <<<<<<<<<<<<<<
 *             import pyBigWig
 *         except ImportError:
*/
  {
    __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:*/ {

      /* "HTSeq/_HTSeq.pyx":1020
 *         '''
 *         try:
 *             import pyBigWig             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             raise ImportError(
*/
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyBigWig, 0, 0, NULL, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1020, __pyx_L3_error)
      __pyx_t_4 = __pyx_t_5;
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pyBigWig = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":1019
 *             A GenomicArray instance with the data.
 *         '''
 *         try:             # <<<<<<<<<<<<<<
 *             import pyBigWig
 *         except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":1021
 *         try:
 *             import pyBigWig
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             raise ImportError(
 *                 'pyBigWig is required to write a GenomicArray to a bigWig file',
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.from_bigwig_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 1021, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "HTSeq/_HTSeq.pyx":1022
 *             import pyBigWig
 *         except ImportError:
 *             raise ImportError(             # <<<<<<<<<<<<<<
 *                 'pyBigWig is required to write a GenomicArray to a bigWig file',
 *             )
*/
      __pyx_t_10 = NULL;
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_pyBigWig_is_required_to_write_a};
        __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1022, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(0, 1022, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "HTSeq/_HTSeq.pyx":1019
 *             A GenomicArray instance with the data.
 *         '''
 *         try:             # <<<<<<<<<<<<<<
 *             import pyBigWig
 *         except ImportError:
*/
    __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:;
  }

  /* "HTSeq/_HTSeq.pyx":1027
 * 
 *         # Avoid circular import
 *         from HTSeq import BigWig_Reader             # <<<<<<<<<<<<<<
 * 
 *         with BigWig_Reader(filename) as bw:
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_BigWig_Reader};
    __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_HTSeq, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error)
  }
  __pyx_t_8 = __pyx_t_3;
  __Pyx_GOTREF(__pyx_t_8);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_BigWig_Reader};
    __pyx_t_12 = 0; {
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_imported_names[__pyx_t_12]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1027, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      switch (__pyx_t_12) {
        case 0:
        __Pyx_INCREF(__pyx_t_7);
        __pyx_v_BigWig_Reader = __pyx_t_7;
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1029
 *         from HTSeq import BigWig_Reader
 * 
 *         with BigWig_Reader(filename) as bw:             # <<<<<<<<<<<<<<
 *             chrom_dict = dict(bw.chroms())
 * 
*/
  /*with:*/ {
    __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_v_BigWig_Reader);
    __pyx_t_4 = __pyx_v_BigWig_Reader; 
    __pyx_t_11 = 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_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_filename};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1029, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1029, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_9 = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_1, &__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_5);
        /*try:*/ {
          __pyx_v_bw = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":1030
 * 
 *         with BigWig_Reader(filename) as bw:
 *             chrom_dict = dict(bw.chroms())             # <<<<<<<<<<<<<<
 * 
 *             # Create the instance with specified chromosomes
*/
          __pyx_t_8 = NULL;
          __pyx_t_7 = __pyx_v_bw;
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_11 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_chroms, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1030, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_11 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4};
            __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(&PyDict_Type), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1030, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __pyx_v_chrom_dict = ((PyObject*)__pyx_t_9);
          __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":1033
 * 
 *             # Create the instance with specified chromosomes
 *             array = cls(             # <<<<<<<<<<<<<<
 *                 chrom_dict,
 *                 stranded=strand != ".",
*/
          __pyx_t_4 = NULL;

          /* "HTSeq/_HTSeq.pyx":1035
 *             array = cls(
 *                 chrom_dict,
 *                 stranded=strand != ".",             # <<<<<<<<<<<<<<
 *                 typecode=typecode,
 *                 storage='step',
*/
          __pyx_t_8 = PyObject_RichCompare(__pyx_v_strand, __pyx_mstate_global->__pyx_kp_u__8, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1035, __pyx_L15_error)

          /* "HTSeq/_HTSeq.pyx":1036
 *                 chrom_dict,
 *                 stranded=strand != ".",
 *                 typecode=typecode,             # <<<<<<<<<<<<<<
 *                 storage='step',
 *             )
*/
          __pyx_t_11 = 1;
          {
            PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_4, __pyx_v_chrom_dict};
            __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1033, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_7);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_stranded, __pyx_t_8, __pyx_t_7, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1033, __pyx_L15_error)
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_typecode, __pyx_v_typecode, __pyx_t_7, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 1033, __pyx_L15_error)
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_storage, __pyx_mstate_global->__pyx_n_u_step, __pyx_t_7, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 1033, __pyx_L15_error)
            __pyx_t_9 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_v_cls, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1033, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __pyx_v_array = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":1040
 *             )
 * 
 *             for chrom in chrom_dict:             # <<<<<<<<<<<<<<
 *                 intervals = bw.intervals(chrom, raw=True)
 *                 for i, (start, end, value) in enumerate(intervals):
*/
          __pyx_t_12 = 0;
          __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_chrom_dict, 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1040, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_9);
          __pyx_t_9 = __pyx_t_7;
          __pyx_t_7 = 0;
          while (1) {
            __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_13, &__pyx_t_12, &__pyx_t_7, NULL, NULL, __pyx_t_6);
            if (unlikely(__pyx_t_14 == 0)) break;
            if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 1040, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_7);
            __pyx_t_7 = 0;

            /* "HTSeq/_HTSeq.pyx":1041
 * 
 *             for chrom in chrom_dict:
 *                 intervals = bw.intervals(chrom, raw=True)             # <<<<<<<<<<<<<<
 *                 for i, (start, end, value) in enumerate(intervals):
 *                     # Set the chromosome offset with the first value, since
*/
            __pyx_t_8 = __pyx_v_bw;
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_11 = 0;
            {
              PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_v_chrom};
              __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L15_error)
              __Pyx_GOTREF(__pyx_t_4);
              if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_raw, Py_True, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1041, __pyx_L15_error)
              __pyx_t_7 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_intervals, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1041, __pyx_L15_error)
              __Pyx_GOTREF(__pyx_t_7);
            }
            __Pyx_XDECREF_SET(__pyx_v_intervals, __pyx_t_7);
            __pyx_t_7 = 0;

            /* "HTSeq/_HTSeq.pyx":1042
 *             for chrom in chrom_dict:
 *                 intervals = bw.intervals(chrom, raw=True)
 *                 for i, (start, end, value) in enumerate(intervals):             # <<<<<<<<<<<<<<
 *                     # Set the chromosome offset with the first value, since
 *                     # they are ordered. The StepVector will be offset compared
*/
            __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
            __pyx_t_7 = __pyx_mstate_global->__pyx_int_0;
            if (likely(PyList_CheckExact(__pyx_v_intervals)) || PyTuple_CheckExact(__pyx_v_intervals)) {
              __pyx_t_4 = __pyx_v_intervals; __Pyx_INCREF(__pyx_t_4);
              __pyx_t_15 = 0;
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_15 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_intervals); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1042, __pyx_L15_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1042, __pyx_L15_error)
            }
            for (;;) {
              if (likely(!__pyx_t_16)) {
                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, 1042, __pyx_L15_error)
                    #endif
                    if (__pyx_t_15 >= __pyx_temp) break;
                  }
                  __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference);
                  ++__pyx_t_15;
                } 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, 1042, __pyx_L15_error)
                    #endif
                    if (__pyx_t_15 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_15));
                  #else
                  __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_15);
                  #endif
                  ++__pyx_t_15;
                }
                if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1042, __pyx_L15_error)
              } else {
                __pyx_t_8 = __pyx_t_16(__pyx_t_4);
                if (unlikely(!__pyx_t_8)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1042, __pyx_L15_error)
                    PyErr_Clear();
                  }
                  break;
                }
              }
              __Pyx_GOTREF(__pyx_t_8);
              if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
                PyObject* sequence = __pyx_t_8;
                Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
                if (unlikely(size != 3)) {
                  if (size > 3) __Pyx_RaiseTooManyValuesError(3);
                  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                  __PYX_ERR(0, 1042, __pyx_L15_error)
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                if (likely(PyTuple_CheckExact(sequence))) {
                  __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
                  __Pyx_INCREF(__pyx_t_10);
                  __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1);
                  __Pyx_INCREF(__pyx_t_17);
                  __pyx_t_18 = PyTuple_GET_ITEM(sequence, 2);
                  __Pyx_INCREF(__pyx_t_18);
                } else {
                  __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
                  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1042, __pyx_L15_error)
                  __Pyx_XGOTREF(__pyx_t_10);
                  __pyx_t_17 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
                  if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1042, __pyx_L15_error)
                  __Pyx_XGOTREF(__pyx_t_17);
                  __pyx_t_18 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
                  if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1042, __pyx_L15_error)
                  __Pyx_XGOTREF(__pyx_t_18);
                }
                #else
                __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1042, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_10);
                __pyx_t_17 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1042, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_17);
                __pyx_t_18 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1042, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_18);
                #endif
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              } else {
                Py_ssize_t index = -1;
                __pyx_t_19 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1042, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_19);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                __pyx_t_20 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_19);
                index = 0; __pyx_t_10 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_10)) goto __pyx_L25_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_10);
                index = 1; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L25_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_17);
                index = 2; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L25_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_18);
                if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 3) < (0)) __PYX_ERR(0, 1042, __pyx_L15_error)
                __pyx_t_20 = NULL;
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                goto __pyx_L26_unpacking_done;
                __pyx_L25_unpacking_failed:;
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                __pyx_t_20 = NULL;
                if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                __PYX_ERR(0, 1042, __pyx_L15_error)
                __pyx_L26_unpacking_done:;
              }
              __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_10);
              __pyx_t_10 = 0;
              __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_17);
              __pyx_t_17 = 0;
              __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_18);
              __pyx_t_18 = 0;
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
              __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_t_7, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1042, __pyx_L15_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_7);
              __pyx_t_7 = __pyx_t_8;
              __pyx_t_8 = 0;

              /* "HTSeq/_HTSeq.pyx":1046
 *                     # they are ordered. The StepVector will be offset compared
 *                     # to that.
 *                     if i == 0:             # <<<<<<<<<<<<<<
 *                         array.chrom_vectors[chrom][strand].offset = start
 *                         array.chrom_vectors[chrom][strand].iv.start = start
*/
              __pyx_t_21 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_21 < 0))) __PYX_ERR(0, 1046, __pyx_L15_error)
              if (__pyx_t_21) {

                /* "HTSeq/_HTSeq.pyx":1047
 *                     # to that.
 *                     if i == 0:
 *                         array.chrom_vectors[chrom][strand].offset = start             # <<<<<<<<<<<<<<
 *                         array.chrom_vectors[chrom][strand].iv.start = start
 * 
*/
                __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_mstate_global->__pyx_n_u_chrom_vectors); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1047, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_8);
                __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_chrom); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1047, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_18);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_v_strand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1047, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                if (__Pyx_PyObject_SetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_offset, __pyx_v_start) < (0)) __PYX_ERR(0, 1047, __pyx_L15_error)
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                /* "HTSeq/_HTSeq.pyx":1048
 *                     if i == 0:
 *                         array.chrom_vectors[chrom][strand].offset = start
 *                         array.chrom_vectors[chrom][strand].iv.start = start             # <<<<<<<<<<<<<<
 * 
 *                     # Bypass GenomicArray.__setitem__ for efficiency
*/
                __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_mstate_global->__pyx_n_u_chrom_vectors); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1048, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_8);
                __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_chrom); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1048, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_18);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_v_strand); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1048, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_iv); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1048, __pyx_L15_error)
                __Pyx_GOTREF(__pyx_t_18);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                if (__Pyx_PyObject_SetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_start, __pyx_v_start) < (0)) __PYX_ERR(0, 1048, __pyx_L15_error)
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

                /* "HTSeq/_HTSeq.pyx":1046
 *                     # they are ordered. The StepVector will be offset compared
 *                     # to that.
 *                     if i == 0:             # <<<<<<<<<<<<<<
 *                         array.chrom_vectors[chrom][strand].offset = start
 *                         array.chrom_vectors[chrom][strand].iv.start = start
*/
              }

              /* "HTSeq/_HTSeq.pyx":1054
 *                     # we know the length of chromosomes a priori from the
 *                     # header.
 *                     array.chrom_vectors[chrom][strand][start: end] = value             # <<<<<<<<<<<<<<
 * 
 *         return array
*/
              __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_mstate_global->__pyx_n_u_chrom_vectors); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1054, __pyx_L15_error)
              __Pyx_GOTREF(__pyx_t_18);
              __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1054, __pyx_L15_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_strand); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1054, __pyx_L15_error)
              __Pyx_GOTREF(__pyx_t_18);
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (__Pyx_PyObject_SetSlice(__pyx_t_18, __pyx_v_value, 0, 0, &__pyx_v_start, &__pyx_v_end, NULL, 0, 0, 1) < (0)) __PYX_ERR(0, 1054, __pyx_L15_error)
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

              /* "HTSeq/_HTSeq.pyx":1042
 *             for chrom in chrom_dict:
 *                 intervals = bw.intervals(chrom, raw=True)
 *                 for i, (start, end, value) in enumerate(intervals):             # <<<<<<<<<<<<<<
 *                     # Set the chromosome offset with the first value, since
 *                     # they are ordered. The StepVector will be offset compared
*/
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "HTSeq/_HTSeq.pyx":1029
 *         from HTSeq import BigWig_Reader
 * 
 *         with BigWig_Reader(filename) as bw:             # <<<<<<<<<<<<<<
 *             chrom_dict = dict(bw.chroms())
 * 
*/
        }
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L20_try_end;
        __pyx_L15_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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("HTSeq._HTSeq.GenomicArray.from_bigwig_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_7, &__pyx_t_4) < 0) __PYX_ERR(0, 1029, __pyx_L17_except_error)
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_18 = PyTuple_Pack(3, __pyx_t_9, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1029, __pyx_L17_except_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_18, NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1029, __pyx_L17_except_error)
          __Pyx_GOTREF(__pyx_t_22);
          __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_22);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          if (__pyx_t_21 < (0)) __PYX_ERR(0, 1029, __pyx_L17_except_error)
          __pyx_t_23 = (!__pyx_t_21);
          if (unlikely(__pyx_t_23)) {
            __Pyx_GIVEREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_7);
            __Pyx_XGIVEREF(__pyx_t_4);
            __Pyx_ErrRestoreWithState(__pyx_t_9, __pyx_t_7, __pyx_t_4);
            __pyx_t_9 = 0;  __pyx_t_7 = 0;  __pyx_t_4 = 0; 
            __PYX_ERR(0, 1029, __pyx_L17_except_error)
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L16_exception_handled;
        }
        __pyx_L17_except_error:;
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_1, __pyx_t_5);
        goto __pyx_L1_error;
        __pyx_L16_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_1, __pyx_t_5);
        __pyx_L20_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_3) {
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1], NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1029, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        goto __pyx_L14;
      }
      __pyx_L14:;
    }
    goto __pyx_L32;
    __pyx_L11_error:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L1_error;
    __pyx_L32:;
  }

  /* "HTSeq/_HTSeq.pyx":1056
 *                     array.chrom_vectors[chrom][strand][start: end] = value
 * 
 *         return array             # <<<<<<<<<<<<<<
 * 
 *     def steps(self):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_array)) { __Pyx_RaiseUnboundLocalError("array"); __PYX_ERR(0, 1056, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_v_array);
  __pyx_r = __pyx_v_array;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1003
 *             write_with_buffer(bw, entries, bufsize=1)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_bigwig_file(cls, filename, strand=".", typecode="d"):
 *         '''Create GenomicArray from BigWig file
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.from_bigwig_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyBigWig);
  __Pyx_XDECREF(__pyx_v_BigWig_Reader);
  __Pyx_XDECREF(__pyx_v_bw);
  __Pyx_XDECREF(__pyx_v_chrom_dict);
  __Pyx_XDECREF(__pyx_v_array);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_intervals);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1058
 *         return array
 * 
 *     def steps(self):             # <<<<<<<<<<<<<<
 *         '''Get the steps, independent of storage method
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_21steps(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_5HTSeq_6_HTSeq_12GenomicArray_20steps, "Get the steps, independent of storage method\n\n        Each \"step\" is a GenomicInterval with fixed value of the array. For\n        instance, if we have 3 counts on chromosome '1' between 0 and 10\n        (exclded) and 6 counts between 10 and 20 (end of chromosome), we would\n        get two steps: (0, 10, 3) and (10, 20, 6). If the GenomicArray is\n        stranded, genomic intervals of the appropriate strandedness are\n        returned.\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_21steps = {"steps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_21steps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_20steps};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_21steps(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("steps (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("steps", 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("steps", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_20steps(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":1068
 *         returned.
 *         '''
 *         return _HTSeq_internal.GenomicArray_steps(self)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_HTSeq_internal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_GenomicArray_steps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1058
 *         return array
 * 
 *     def steps(self):             # <<<<<<<<<<<<<<
 *         '''Get the steps, independent of storage method
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":616
 *     """
 * 
 *     cdef public dict chrom_vectors             # <<<<<<<<<<<<<<
 *     cdef readonly bint stranded
 *     cdef readonly str typecode
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->chrom_vectors);
  __pyx_r = __pyx_v_self->chrom_vectors;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->chrom_vectors);
  __Pyx_DECREF(__pyx_v_self->chrom_vectors);
  __pyx_v_self->chrom_vectors = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.chrom_vectors.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->chrom_vectors);
  __Pyx_DECREF(__pyx_v_self->chrom_vectors);
  __pyx_v_self->chrom_vectors = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pyx":617
 * 
 *     cdef public dict chrom_vectors
 *     cdef readonly bint stranded             # <<<<<<<<<<<<<<
 *     cdef readonly str typecode
 *     cdef public str auto_add_chroms
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8stranded_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8stranded_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8stranded___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8stranded___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->stranded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.stranded.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":618
 *     cdef public dict chrom_vectors
 *     cdef readonly bint stranded
 *     cdef readonly str typecode             # <<<<<<<<<<<<<<
 *     cdef public str auto_add_chroms
 *     cdef readonly str storage
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8typecode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8typecode_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8typecode___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_8typecode___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->typecode);
  __pyx_r = __pyx_v_self->typecode;
  goto __pyx_L0;

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

/* "HTSeq/_HTSeq.pyx":619
 *     cdef readonly bint stranded
 *     cdef readonly str typecode
 *     cdef public str auto_add_chroms             # <<<<<<<<<<<<<<
 *     cdef readonly str storage
 *     cdef readonly str memmap_dir
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->auto_add_chroms);
  __pyx_r = __pyx_v_self->auto_add_chroms;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 619, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->auto_add_chroms);
  __Pyx_DECREF(__pyx_v_self->auto_add_chroms);
  __pyx_v_self->auto_add_chroms = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.auto_add_chroms.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->auto_add_chroms);
  __Pyx_DECREF(__pyx_v_self->auto_add_chroms);
  __pyx_v_self->auto_add_chroms = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pyx":620
 *     cdef readonly str typecode
 *     cdef public str auto_add_chroms
 *     cdef readonly str storage             # <<<<<<<<<<<<<<
 *     cdef readonly str memmap_dir
 *     cdef public str header
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7storage_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7storage_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_7storage___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_7storage___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->storage);
  __pyx_r = __pyx_v_self->storage;
  goto __pyx_L0;

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

/* "HTSeq/_HTSeq.pyx":621
 *     cdef public str auto_add_chroms
 *     cdef readonly str storage
 *     cdef readonly str memmap_dir             # <<<<<<<<<<<<<<
 *     cdef public str header
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->memmap_dir);
  __pyx_r = __pyx_v_self->memmap_dir;
  goto __pyx_L0;

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

/* "HTSeq/_HTSeq.pyx":622
 *     cdef readonly str storage
 *     cdef readonly str memmap_dir
 *     cdef public str header             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, object chroms, bint stranded=True, str typecode='d',
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_6header_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_6header_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6header___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6header___get__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->header);
  __pyx_r = __pyx_v_self->header;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_6header_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_6header_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6header_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6header_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->header);
  __Pyx_DECREF(__pyx_v_self->header);
  __pyx_v_self->header = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.GenomicArray.header.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_6header_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_6header_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6header_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_12GenomicArray_6header_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->header);
  __Pyx_DECREF(__pyx_v_self->header);
  __pyx_v_self->header = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pyx":1071
 * 
 * 
 * def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):             # <<<<<<<<<<<<<<
 *     ga = GenomicArray({}, stranded, typecode)
 *     ga.chrom_vectors = chrom_vectors
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_5_GenomicArray_unpickle(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_5HTSeq_6_HTSeq_5_GenomicArray_unpickle = {"_GenomicArray_unpickle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_5_GenomicArray_unpickle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_5_GenomicArray_unpickle(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_stranded = 0;
  PyObject *__pyx_v_typecode = 0;
  PyObject *__pyx_v_chrom_vectors = 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("_GenomicArray_unpickle (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_stranded,&__pyx_mstate_global->__pyx_n_u_typecode,&__pyx_mstate_global->__pyx_n_u_chrom_vectors,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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, "_GenomicArray_unpickle", 0) < (0)) __PYX_ERR(0, 1071, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_GenomicArray_unpickle", 1, 3, 3, i); __PYX_ERR(0, 1071, __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, 1071, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1071, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1071, __pyx_L3_error)
    }
    __pyx_v_stranded = values[0];
    __pyx_v_typecode = values[1];
    __pyx_v_chrom_vectors = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_GenomicArray_unpickle", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1071, __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("HTSeq._HTSeq._GenomicArray_unpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_4_GenomicArray_unpickle(__pyx_self, __pyx_v_stranded, __pyx_v_typecode, __pyx_v_chrom_vectors);

  /* 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_5HTSeq_6_HTSeq_4_GenomicArray_unpickle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stranded, PyObject *__pyx_v_typecode, PyObject *__pyx_v_chrom_vectors) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *__pyx_v_ga = 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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_GenomicArray_unpickle", 0);

  /* "HTSeq/_HTSeq.pyx":1072
 * 
 * def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):
 *     ga = GenomicArray({}, stranded, typecode)             # <<<<<<<<<<<<<<
 *     ga.chrom_vectors = chrom_vectors
 *     return ga
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_v_stranded, __pyx_v_typecode};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_callargs+__pyx_t_4, (4-__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, 1072, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ga = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1073
 * def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):
 *     ga = GenomicArray({}, stranded, typecode)
 *     ga.chrom_vectors = chrom_vectors             # <<<<<<<<<<<<<<
 *     return ga
 * 
*/
  __pyx_t_1 = __pyx_v_chrom_vectors;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 1073, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_ga->chrom_vectors);
  __Pyx_DECREF(__pyx_v_ga->chrom_vectors);
  __pyx_v_ga->chrom_vectors = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1074
 *     ga = GenomicArray({}, stranded, typecode)
 *     ga.chrom_vectors = chrom_vectors
 *     return ga             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_ga);
  __pyx_r = ((PyObject *)__pyx_v_ga);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1071
 * 
 * 
 * def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):             # <<<<<<<<<<<<<<
 *     ga = GenomicArray({}, stranded, typecode)
 *     ga.chrom_vectors = chrom_vectors
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq._GenomicArray_unpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ga);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1082
 * 
 * 
 * def _make_translation_table_for_complementation():             # <<<<<<<<<<<<<<
 *     return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation = {"_make_translation_table_for_complementation", (PyCFunction)__pyx_pw_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation, METH_NOARGS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_make_translation_table_for_complementation (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_6_make_translation_table_for_complementation(__pyx_self);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_6_make_translation_table_for_complementation(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("_make_translation_table_for_complementation", 0);

  /* "HTSeq/_HTSeq.pyx":1083
 * 
 * def _make_translation_table_for_complementation():
 *     return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyBytes_Type)), __pyx_mstate_global->__pyx_n_u_maketrans); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1082
 * 
 * 
 * def _make_translation_table_for_complementation():             # <<<<<<<<<<<<<<
 *     return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
 * 
*/

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

/* "HTSeq/_HTSeq.pyx":1089
 * 
 * 
 * cpdef bytes reverse_complement(bytes seq):             # <<<<<<<<<<<<<<
 *     """Returns the reverse complement of DNA sequence 'seq'. Does not yet
 *     work with extended IUPAC nucleotide letters or RNA."""
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9reverse_complement(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 PyObject *__pyx_f_5HTSeq_6_HTSeq_reverse_complement(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reverse_complement", 0);

  /* "HTSeq/_HTSeq.pyx":1093
 *     work with extended IUPAC nucleotide letters or RNA."""
 * 
 *     return seq[::-1].translate(_translation_table_for_complementation)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_seq, __pyx_mstate_global->__pyx_slice[1]); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_translate, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1089
 * 
 * 
 * cpdef bytes reverse_complement(bytes seq):             # <<<<<<<<<<<<<<
 *     """Returns the reverse complement of DNA sequence 'seq'. Does not yet
 *     work with extended IUPAC nucleotide letters or RNA."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9reverse_complement(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_5HTSeq_6_HTSeq_8reverse_complement, "Returns the reverse complement of DNA sequence 'seq'. Does not yet\n    work with extended IUPAC nucleotide letters or RNA.");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_9reverse_complement = {"reverse_complement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_9reverse_complement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_8reverse_complement};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9reverse_complement(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_seq = 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("reverse_complement (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_seq,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, 1089, __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, 1089, __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, "reverse_complement", 0) < (0)) __PYX_ERR(0, 1089, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reverse_complement", 1, 1, 1, i); __PYX_ERR(0, 1089, __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, 1089, __pyx_L3_error)
    }
    __pyx_v_seq = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reverse_complement", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1089, __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("HTSeq._HTSeq.reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seq), (&PyBytes_Type), 1, "seq", 1))) __PYX_ERR(0, 1089, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8reverse_complement(__pyx_self, __pyx_v_seq);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8reverse_complement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  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("reverse_complement", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(__pyx_v_seq, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1102
 *     """A Sequence, typically of DNA, with a name."""
 * 
 *     def __init__(self, bytes seq, str name="unnamed"):             # <<<<<<<<<<<<<<
 *         self.seq = seq
 *         self.name = name
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_name = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_seq,&__pyx_mstate_global->__pyx_n_u_name_2,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, 1102, __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, 1102, __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, 1102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1102, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_unnamed));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(0, 1102, __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, 1102, __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, 1102, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_unnamed));
    }
    __pyx_v_seq = ((PyObject*)values[0]);
    __pyx_v_name = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1102, __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("HTSeq._HTSeq.Sequence.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seq), (&PyBytes_Type), 1, "seq", 1))) __PYX_ERR(0, 1102, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 1102, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_seq, __pyx_v_name);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence___init__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":1103
 * 
 *     def __init__(self, bytes seq, str name="unnamed"):
 *         self.seq = seq             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.descr = None
*/
  __Pyx_INCREF(__pyx_v_seq);
  __Pyx_GIVEREF(__pyx_v_seq);
  __Pyx_GOTREF(__pyx_v_self->seq);
  __Pyx_DECREF(__pyx_v_self->seq);
  __pyx_v_self->seq = __pyx_v_seq;

  /* "HTSeq/_HTSeq.pyx":1104
 *     def __init__(self, bytes seq, str name="unnamed"):
 *         self.seq = seq
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.descr = None
 * 
*/
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "HTSeq/_HTSeq.pyx":1105
 *         self.seq = seq
 *         self.name = name
 *         self.descr = None             # <<<<<<<<<<<<<<
 * 
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->descr);
  __Pyx_DECREF(__pyx_v_self->descr);
  __pyx_v_self->descr = ((PyObject*)Py_None);

  /* "HTSeq/_HTSeq.pyx":1102
 *     """A Sequence, typically of DNA, with a name."""
 * 
 *     def __init__(self, bytes seq, str name="unnamed"):             # <<<<<<<<<<<<<<
 *         self.seq = seq
 *         self.name = name
*/

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

/* "HTSeq/_HTSeq.pyx":1107
 *         self.descr = None
 * 
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):             # <<<<<<<<<<<<<<
 *         if rename:
 *             return Sequence(
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement(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 struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement *__pyx_optional_args) {
  int __pyx_v_rename = ((int)1);
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_reverse_complement", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_rename = __pyx_optional_args->rename;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_get_reverse_complement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_rename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1107, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 1107, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":1108
 * 
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):
 *         if rename:             # <<<<<<<<<<<<<<
 *             return Sequence(
 *                 reverse_complement(self.seq),
*/
  if (__pyx_v_rename) {

    /* "HTSeq/_HTSeq.pyx":1109
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):
 *         if rename:
 *             return Sequence(             # <<<<<<<<<<<<<<
 *                 reverse_complement(self.seq),
 *                 "revcomp_of_" + self.name)
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = NULL;

    /* "HTSeq/_HTSeq.pyx":1110
 *         if rename:
 *             return Sequence(
 *                 reverse_complement(self.seq),             # <<<<<<<<<<<<<<
 *                 "revcomp_of_" + self.name)
 *         else:
*/
    __pyx_t_4 = __pyx_v_self->seq;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_4), 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":1111
 *             return Sequence(
 *                 reverse_complement(self.seq),
 *                 "revcomp_of_" + self.name)             # <<<<<<<<<<<<<<
 *         else:
 *             return Sequence(
*/
    __pyx_t_4 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_n_u_revcomp_of, __pyx_v_self->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1108
 * 
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):
 *         if rename:             # <<<<<<<<<<<<<<
 *             return Sequence(
 *                 reverse_complement(self.seq),
*/
  }

  /* "HTSeq/_HTSeq.pyx":1113
 *                 "revcomp_of_" + self.name)
 *         else:
 *             return Sequence(             # <<<<<<<<<<<<<<
 *                 reverse_complement(self.seq),
 *                 self.name)
*/
  /*else*/ {
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = NULL;

    /* "HTSeq/_HTSeq.pyx":1114
 *         else:
 *             return Sequence(
 *                 reverse_complement(self.seq),             # <<<<<<<<<<<<<<
 *                 self.name)
 * 
*/
    __pyx_t_5 = __pyx_v_self->seq;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_5), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "HTSeq/_HTSeq.pyx":1115
 *             return Sequence(
 *                 reverse_complement(self.seq),
 *                 self.name)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
*/
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_self->name};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __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_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1113, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":1107
 *         self.descr = None
 * 
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):             # <<<<<<<<<<<<<<
 *         if rename:
 *             return Sequence(
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement(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_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement = {"get_reverse_complement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement(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
) {
  int __pyx_v_rename;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_reverse_complement (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_rename,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, 1107, __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, 1107, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_reverse_complement", 0) < (0)) __PYX_ERR(0, 1107, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1107, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_rename = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_rename == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1107, __pyx_L3_error)
    } else {
      __pyx_v_rename = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_reverse_complement", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1107, __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("HTSeq._HTSeq.Sequence.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_2get_reverse_complement(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_rename);

  /* 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_5HTSeq_6_HTSeq_8Sequence_2get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, int __pyx_v_rename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_reverse_complement", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.rename = __pyx_v_rename;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence->get_reverse_complement(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1117
 *                 self.name)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.seq.decode()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4__str__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":1118
 * 
 *     def __str__(self):
 *         return self.seq.decode()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_self->seq == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
    __PYX_ERR(0, 1118, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_decode_bytes(__pyx_v_self->seq, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1117
 *                 self.name)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.seq.decode()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1120
 *         return self.seq.decode()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s object '%s' (length %d)>" % (
 *             self.__class__.__name__, self.name, len(self.seq))
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_6__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5[7];
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":1121
 * 
 *     def __repr__(self):
 *         return "<%s object '%s' (length %d)>" % (             # <<<<<<<<<<<<<<
 *             self.__class__.__name__, self.name, len(self.seq))
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "HTSeq/_HTSeq.pyx":1122
 *     def __repr__(self):
 *         return "<%s object '%s' (length %d)>" % (
 *             self.__class__.__name__, self.name, len(self.seq))             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_self->seq;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1122, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyBytes_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_4, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_5[1] = __pyx_t_1;
  __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_object;
  __pyx_t_5[3] = __pyx_t_2;
  __pyx_t_5[4] = __pyx_mstate_global->__pyx_kp_u_length_2;
  __pyx_t_5[5] = __pyx_t_3;
  __pyx_t_5[6] = __pyx_mstate_global->__pyx_kp_u__22;

  /* "HTSeq/_HTSeq.pyx":1121
 * 
 *     def __repr__(self):
 *         return "<%s object '%s' (length %d)>" % (             # <<<<<<<<<<<<<<
 *             self.__class__.__name__, self.name, len(self.seq))
 * 
*/
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 7, 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1120
 *         return self.seq.decode()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s object '%s' (length %d)>" % (
 *             self.__class__.__name__, self.name, len(self.seq))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1124
 *             self.__class__.__name__, self.name, len(self.seq))
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return len(self.seq)
 * 
*/

/* Python wrapper */
static Py_ssize_t __pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_8__len__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_5HTSeq_6_HTSeq_8Sequence_8__len__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "HTSeq/_HTSeq.pyx":1125
 * 
 *     def __len__(self):
 *         return len(self.seq)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
*/
  __pyx_t_1 = __pyx_v_self->seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1125, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1124
 *             self.__class__.__name__, self.name, len(self.seq))
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return len(self.seq)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1127
 *         return len(self.seq)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         if self.name.endswith("[part]"):
 *             new_name = self.name
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_10__getitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyObject *)__pyx_v_item));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_10__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_new_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "HTSeq/_HTSeq.pyx":1128
 * 
 *     def __getitem__(self, item):
 *         if self.name.endswith("[part]"):             # <<<<<<<<<<<<<<
 *             new_name = self.name
 *         else:
*/
  if (unlikely(__pyx_v_self->name == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "endswith");
    __PYX_ERR(0, 1128, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_self->name, __pyx_mstate_global->__pyx_kp_u_part, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1128, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1129
 *     def __getitem__(self, item):
 *         if self.name.endswith("[part]"):
 *             new_name = self.name             # <<<<<<<<<<<<<<
 *         else:
 *             new_name = self.name + "[part]"
*/
    __pyx_t_2 = __pyx_v_self->name;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_new_name = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":1128
 * 
 *     def __getitem__(self, item):
 *         if self.name.endswith("[part]"):             # <<<<<<<<<<<<<<
 *             new_name = self.name
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1131
 *             new_name = self.name
 *         else:
 *             new_name = self.name + "[part]"             # <<<<<<<<<<<<<<
 *         return Sequence(self.seq[item], new_name)
 * 
*/
  /*else*/ {
    __pyx_t_2 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_self->name, __pyx_mstate_global->__pyx_kp_u_part); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_new_name = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1132
 *         else:
 *             new_name = self.name + "[part]"
 *         return Sequence(self.seq[item], new_name)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->seq, __pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_v_new_name};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __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_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1127
 *         return len(self.seq)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         if self.name.endswith("[part]"):
 *             new_name = self.name
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1134
 *         return Sequence(self.seq[item], new_name)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {'seq': self.seq,
 *                 'name': self.name,
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_13__getstate__(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_5HTSeq_6_HTSeq_8Sequence_13__getstate__ = {"__getstate__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_13__getstate__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_13__getstate__(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("__getstate__ (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("__getstate__", 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("__getstate__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_12__getstate__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":1135
 * 
 *     def __getstate__(self):
 *         return {'seq': self.seq,             # <<<<<<<<<<<<<<
 *                 'name': self.name,
 *                 'descr': self.descr}
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_seq, __pyx_v_self->seq) < (0)) __PYX_ERR(0, 1135, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":1136
 *     def __getstate__(self):
 *         return {'seq': self.seq,
 *                 'name': self.name,             # <<<<<<<<<<<<<<
 *                 'descr': self.descr}
 * 
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_v_self->name) < (0)) __PYX_ERR(0, 1135, __pyx_L1_error)

  /* "HTSeq/_HTSeq.pyx":1137
 *         return {'seq': self.seq,
 *                 'name': self.name,
 *                 'descr': self.descr}             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_descr, __pyx_v_self->descr) < (0)) __PYX_ERR(0, 1135, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1134
 *         return Sequence(self.seq[item], new_name)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {'seq': self.seq,
 *                 'name': self.name,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1139
 *                 'descr': self.descr}
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.seq = state['seq']
 *         self.name = state['name']
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_15__setstate__(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_5HTSeq_6_HTSeq_8Sequence_15__setstate__ = {"__setstate__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_15__setstate__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_15__setstate__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_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__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,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, 1139, __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, 1139, __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__", 0) < (0)) __PYX_ERR(0, 1139, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 1, 1, i); __PYX_ERR(0, 1139, __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, 1139, __pyx_L3_error)
    }
    __pyx_v_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1139, __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("HTSeq._HTSeq.Sequence.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_14__setstate__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_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_5HTSeq_6_HTSeq_8Sequence_14__setstate__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "HTSeq/_HTSeq.pyx":1140
 * 
 *     def __setstate__(self, state):
 *         self.seq = state['seq']             # <<<<<<<<<<<<<<
 *         self.name = state['name']
 *         self.descr = state['descr']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_state, __pyx_mstate_global->__pyx_n_u_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 1140, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->seq);
  __Pyx_DECREF(__pyx_v_self->seq);
  __pyx_v_self->seq = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1141
 *     def __setstate__(self, state):
 *         self.seq = state['seq']
 *         self.name = state['name']             # <<<<<<<<<<<<<<
 *         self.descr = state['descr']
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_state, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1141, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1142
 *         self.seq = state['seq']
 *         self.name = state['name']
 *         self.descr = state['descr']             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_state, __pyx_mstate_global->__pyx_n_u_descr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->descr);
  __Pyx_DECREF(__pyx_v_self->descr);
  __pyx_v_self->descr = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1139
 *                 'descr': self.descr}
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.seq = state['seq']
 *         self.name = state['name']
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1144
 *         self.descr = state['descr']
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (self.__class__, (self.seq, self.name), self.__getstate__())
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_17__reduce__(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_5HTSeq_6_HTSeq_8Sequence_17__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_17__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_17__reduce__(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__ (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__", 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__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_16__reduce__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":1145
 * 
 *     def __reduce__(self):
 *         return (self.__class__, (self.seq, self.name), self.__getstate__())             # <<<<<<<<<<<<<<
 * 
 *     def write_to_fasta_file(self, fasta_file, characters_per_line=70):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->seq);
  __Pyx_GIVEREF(__pyx_v_self->seq);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->seq) != (0)) __PYX_ERR(0, 1145, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->name) != (0)) __PYX_ERR(0, 1145, __pyx_L1_error);
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getstate, __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, 1145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1145, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 1145, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 1145, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1144
 *         self.descr = state['descr']
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (self.__class__, (self.seq, self.name), self.__getstate__())
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1147
 *         return (self.__class__, (self.seq, self.name), self.__getstate__())
 * 
 *     def write_to_fasta_file(self, fasta_file, characters_per_line=70):             # <<<<<<<<<<<<<<
 *         """Write sequence to file in FASTA format.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file(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_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file, "Write sequence to file in FASTA format.\n\n        Arguments:\n                - fasta_file (file handle): destination file\n                    - characters_per_line (int >=0): if 0, write the whole sequence on a single line. Otherwise, break into several lines if the sequence is long enough.\n\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file = {"write_to_fasta_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_fasta_file = 0;
  PyObject *__pyx_v_characters_per_line = 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("write_to_fasta_file (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_fasta_file,&__pyx_mstate_global->__pyx_n_u_characters_per_line,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, 1147, __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, 1147, __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, 1147, __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, "write_to_fasta_file", 0) < (0)) __PYX_ERR(0, 1147, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_70));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_to_fasta_file", 0, 1, 2, i); __PYX_ERR(0, 1147, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1147, __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, 1147, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_70));
    }
    __pyx_v_fasta_file = values[0];
    __pyx_v_characters_per_line = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_to_fasta_file", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1147, __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("HTSeq._HTSeq.Sequence.write_to_fasta_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_fasta_file, __pyx_v_characters_per_line);

  /* 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_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_fasta_file, PyObject *__pyx_v_characters_per_line) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6[5];
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_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("write_to_fasta_file", 0);

  /* "HTSeq/_HTSeq.pyx":1155
 * 
 *         """
 *         if self.descr is not None:             # <<<<<<<<<<<<<<
 *             fasta_file.write(">%s %s\n" % (self.name, self.descr))
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->descr != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1156
 *         """
 *         if self.descr is not None:
 *             fasta_file.write(">%s %s\n" % (self.name, self.descr))             # <<<<<<<<<<<<<<
 *         else:
 *             fasta_file.write(">%s\n" % self.name)
*/
    __pyx_t_3 = __pyx_v_fasta_file;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_v_self->descr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u__15;
    __pyx_t_6[1] = __pyx_t_4;
    __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__23;
    __pyx_t_6[3] = __pyx_t_5;
    __pyx_t_6[4] = __pyx_mstate_global->__pyx_kp_u__20;
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 5, 1 * 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (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_2)) __PYX_ERR(0, 1156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":1155
 * 
 *         """
 *         if self.descr is not None:             # <<<<<<<<<<<<<<
 *             fasta_file.write(">%s %s\n" % (self.name, self.descr))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1158
 *             fasta_file.write(">%s %s\n" % (self.name, self.descr))
 *         else:
 *             fasta_file.write(">%s\n" % self.name)             # <<<<<<<<<<<<<<
 * 
 *         if characters_per_line == 0:
*/
  /*else*/ {
    __pyx_t_7 = __pyx_v_fasta_file;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_s, __pyx_v_self->name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1160
 *             fasta_file.write(">%s\n" % self.name)
 * 
 *         if characters_per_line == 0:             # <<<<<<<<<<<<<<
 *             fasta_file.write(self.seq.decode() + "\n")
 *         else:
*/
  __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_characters_per_line, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1160, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1161
 * 
 *         if characters_per_line == 0:
 *             fasta_file.write(self.seq.decode() + "\n")             # <<<<<<<<<<<<<<
 *         else:
 *             i = 0
*/
    __pyx_t_3 = __pyx_v_fasta_file;
    __Pyx_INCREF(__pyx_t_3);
    if (unlikely(__pyx_v_self->seq == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
      __PYX_ERR(0, 1161, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_decode_bytes(__pyx_v_self->seq, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__20); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":1160
 *             fasta_file.write(">%s\n" % self.name)
 * 
 *         if characters_per_line == 0:             # <<<<<<<<<<<<<<
 *             fasta_file.write(self.seq.decode() + "\n")
 *         else:
*/
    goto __pyx_L4;
  }

  /* "HTSeq/_HTSeq.pyx":1163
 *             fasta_file.write(self.seq.decode() + "\n")
 *         else:
 *             i = 0             # <<<<<<<<<<<<<<
 *             while i * characters_per_line < len(self.seq):
 *                 fasta_file.write(
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_v_i = __pyx_mstate_global->__pyx_int_0;

    /* "HTSeq/_HTSeq.pyx":1164
 *         else:
 *             i = 0
 *             while i * characters_per_line < len(self.seq):             # <<<<<<<<<<<<<<
 *                 fasta_file.write(
 *                     self.seq[i * characters_per_line: (i + 1) * characters_per_line].decode() + "\n")
*/
    while (1) {
      __pyx_t_2 = PyNumber_Multiply(__pyx_v_i, __pyx_v_characters_per_line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __pyx_v_self->seq;
      __Pyx_INCREF(__pyx_t_5);
      if (unlikely(__pyx_t_5 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 1164, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_PyBytes_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_1) break;

      /* "HTSeq/_HTSeq.pyx":1165
 *             i = 0
 *             while i * characters_per_line < len(self.seq):
 *                 fasta_file.write(             # <<<<<<<<<<<<<<
 *                     self.seq[i * characters_per_line: (i + 1) * characters_per_line].decode() + "\n")
 *                 i += 1
*/
      __pyx_t_5 = __pyx_v_fasta_file;
      __Pyx_INCREF(__pyx_t_5);

      /* "HTSeq/_HTSeq.pyx":1166
 *             while i * characters_per_line < len(self.seq):
 *                 fasta_file.write(
 *                     self.seq[i * characters_per_line: (i + 1) * characters_per_line].decode() + "\n")             # <<<<<<<<<<<<<<
 *                 i += 1
 * 
*/
      if (unlikely(__pyx_v_self->seq == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 1166, __pyx_L1_error)
      }
      __pyx_t_2 = PyNumber_Multiply(__pyx_v_i, __pyx_v_characters_per_line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = (__pyx_t_2 == Py_None);
      if (__pyx_t_1) {
        __pyx_t_9 = 0;
      } else {
        __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1166, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_10;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyNumber_Multiply(__pyx_t_2, __pyx_v_characters_per_line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = (__pyx_t_7 == Py_None);
      if (__pyx_t_1) {
        __pyx_t_10 = PY_SSIZE_T_MAX;
      } else {
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1166, __pyx_L1_error)
        __pyx_t_10 = __pyx_t_11;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_decode_bytes(__pyx_v_self->seq, __pyx_t_9, __pyx_t_10, NULL, NULL, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1167
 *                 fasta_file.write(
 *                     self.seq[i * characters_per_line: (i + 1) * characters_per_line].decode() + "\n")
 *                 i += 1             # <<<<<<<<<<<<<<
 * 
 *     cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_):
*/
      __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;
    }
  }
  __pyx_L4:;

  /* "HTSeq/_HTSeq.pyx":1147
 *         return (self.__class__, (self.seq, self.name), self.__getstate__())
 * 
 *     def write_to_fasta_file(self, fasta_file, characters_per_line=70):             # <<<<<<<<<<<<<<
 *         """Write sequence to file in FASTA format.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.write_to_fasta_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1169
 *                 i += 1
 * 
 *     cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_):             # <<<<<<<<<<<<<<
 * 
 *         cdef numpy.ndarray[numpy.int64_t, ndim = 2] count_array = count_array_
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_8Sequence_add_bases_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyArrayObject *__pyx_v_count_array_, int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_v_count_array = 0;
  int __pyx_v_seq_length;
  npy_intp __pyx_v_i;
  char __pyx_v_b;
  char *__pyx_v_seq_cstr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_count_array;
  __Pyx_Buffer __pyx_pybuffer_count_array;
  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;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  char *__pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  npy_intp __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_bases_to_count_array", 0);
  __pyx_pybuffer_count_array.pybuffer.buf = NULL;
  __pyx_pybuffer_count_array.refcount = 0;
  __pyx_pybuffernd_count_array.data = NULL;
  __pyx_pybuffernd_count_array.rcbuffer = &__pyx_pybuffer_count_array;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_add_bases_to_count_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_count_array_)};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":1171
 *     cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_):
 * 
 *         cdef numpy.ndarray[numpy.int64_t, ndim = 2] count_array = count_array_             # <<<<<<<<<<<<<<
 *         cdef int seq_length = len(self.seq)
 * 
*/
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_count_array_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_count_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 1171, __pyx_L1_error)
    } else {__pyx_pybuffernd_count_array.diminfo[0].strides = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_count_array.diminfo[0].shape = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_count_array.diminfo[1].strides = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_count_array.diminfo[1].shape = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.shape[1];
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_count_array_);
  __pyx_v_count_array = ((PyArrayObject *)__pyx_v_count_array_);

  /* "HTSeq/_HTSeq.pyx":1172
 * 
 *         cdef numpy.ndarray[numpy.int64_t, ndim = 2] count_array = count_array_
 *         cdef int seq_length = len(self.seq)             # <<<<<<<<<<<<<<
 * 
 *         if numpy.PyArray_DIMS(count_array)[0] < seq_length:
*/
  __pyx_t_1 = __pyx_v_self->seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1172, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seq_length = __pyx_t_6;

  /* "HTSeq/_HTSeq.pyx":1174
 *         cdef int seq_length = len(self.seq)
 * 
 *         if numpy.PyArray_DIMS(count_array)[0] < seq_length:             # <<<<<<<<<<<<<<
 *             raise ValueError("'count_array' too small for sequence.")
 *         if numpy.PyArray_DIMS(count_array)[1] < 5:
*/
  __pyx_t_7 = ((PyArray_DIMS(((PyArrayObject *)__pyx_v_count_array))[0]) < __pyx_v_seq_length);
  if (unlikely(__pyx_t_7)) {

    /* "HTSeq/_HTSeq.pyx":1175
 * 
 *         if numpy.PyArray_DIMS(count_array)[0] < seq_length:
 *             raise ValueError("'count_array' too small for sequence.")             # <<<<<<<<<<<<<<
 *         if numpy.PyArray_DIMS(count_array)[1] < 5:
 *             raise ValueError("'count_array' has too few columns.")
*/
    __pyx_t_2 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_count_array_too_small_for_seque};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __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, 1175, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1174
 *         cdef int seq_length = len(self.seq)
 * 
 *         if numpy.PyArray_DIMS(count_array)[0] < seq_length:             # <<<<<<<<<<<<<<
 *             raise ValueError("'count_array' too small for sequence.")
 *         if numpy.PyArray_DIMS(count_array)[1] < 5:
*/
  }

  /* "HTSeq/_HTSeq.pyx":1176
 *         if numpy.PyArray_DIMS(count_array)[0] < seq_length:
 *             raise ValueError("'count_array' too small for sequence.")
 *         if numpy.PyArray_DIMS(count_array)[1] < 5:             # <<<<<<<<<<<<<<
 *             raise ValueError("'count_array' has too few columns.")
 * 
*/
  __pyx_t_7 = ((PyArray_DIMS(((PyArrayObject *)__pyx_v_count_array))[1]) < 5);
  if (unlikely(__pyx_t_7)) {

    /* "HTSeq/_HTSeq.pyx":1177
 *             raise ValueError("'count_array' too small for sequence.")
 *         if numpy.PyArray_DIMS(count_array)[1] < 5:
 *             raise ValueError("'count_array' has too few columns.")             # <<<<<<<<<<<<<<
 * 
 *         cdef numpy.npy_intp i
*/
    __pyx_t_2 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_count_array_has_too_few_columns};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __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, 1177, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1176
 *         if numpy.PyArray_DIMS(count_array)[0] < seq_length:
 *             raise ValueError("'count_array' too small for sequence.")
 *         if numpy.PyArray_DIMS(count_array)[1] < 5:             # <<<<<<<<<<<<<<
 *             raise ValueError("'count_array' has too few columns.")
 * 
*/
  }

  /* "HTSeq/_HTSeq.pyx":1181
 *         cdef numpy.npy_intp i
 *         cdef char b
 *         cdef char * seq_cstr = self.seq             # <<<<<<<<<<<<<<
 *         for i in range(seq_length):
 *             b = seq_cstr[i]
*/
  if (unlikely(__pyx_v_self->seq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1181, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->seq); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1181, __pyx_L1_error)
  __pyx_v_seq_cstr = __pyx_t_8;

  /* "HTSeq/_HTSeq.pyx":1182
 *         cdef char b
 *         cdef char * seq_cstr = self.seq
 *         for i in range(seq_length):             # <<<<<<<<<<<<<<
 *             b = seq_cstr[i]
 *             if b in [b'A', b'a']:
*/
  __pyx_t_9 = __pyx_v_seq_length;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "HTSeq/_HTSeq.pyx":1183
 *         cdef char * seq_cstr = self.seq
 *         for i in range(seq_length):
 *             b = seq_cstr[i]             # <<<<<<<<<<<<<<
 *             if b in [b'A', b'a']:
 *                 count_array[i, 0] += 1
*/
    __pyx_v_b = (__pyx_v_seq_cstr[__pyx_v_i]);

    /* "HTSeq/_HTSeq.pyx":1184
 *         for i in range(seq_length):
 *             b = seq_cstr[i]
 *             if b in [b'A', b'a']:             # <<<<<<<<<<<<<<
 *                 count_array[i, 0] += 1
 *             elif b in [b'C', b'c']:
*/
    switch (__pyx_v_b) {
      case 'A':
      case 'a':

      /* "HTSeq/_HTSeq.pyx":1185
 *             b = seq_cstr[i]
 *             if b in [b'A', b'a']:
 *                 count_array[i, 0] += 1             # <<<<<<<<<<<<<<
 *             elif b in [b'C', b'c']:
 *                 count_array[i, 1] += 1
*/
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_13 = 0;
      __pyx_t_14 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_count_array.diminfo[0].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_14 = 0;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_count_array.diminfo[1].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 1;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_14 = 1;
      if (unlikely(__pyx_t_14 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_14);
        __PYX_ERR(0, 1185, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;

      /* "HTSeq/_HTSeq.pyx":1184
 *         for i in range(seq_length):
 *             b = seq_cstr[i]
 *             if b in [b'A', b'a']:             # <<<<<<<<<<<<<<
 *                 count_array[i, 0] += 1
 *             elif b in [b'C', b'c']:
*/
      break;
      case 'C':

      /* "HTSeq/_HTSeq.pyx":1186
 *             if b in [b'A', b'a']:
 *                 count_array[i, 0] += 1
 *             elif b in [b'C', b'c']:             # <<<<<<<<<<<<<<
 *                 count_array[i, 1] += 1
 *             elif b in [b'G', b'g']:
*/
      case 'c':

      /* "HTSeq/_HTSeq.pyx":1187
 *                 count_array[i, 0] += 1
 *             elif b in [b'C', b'c']:
 *                 count_array[i, 1] += 1             # <<<<<<<<<<<<<<
 *             elif b in [b'G', b'g']:
 *                 count_array[i, 2] += 1
*/
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_12 = 1;
      __pyx_t_14 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_count_array.diminfo[0].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_14 = 0;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_count_array.diminfo[1].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 1;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_14 = 1;
      if (unlikely(__pyx_t_14 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_14);
        __PYX_ERR(0, 1187, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;

      /* "HTSeq/_HTSeq.pyx":1186
 *             if b in [b'A', b'a']:
 *                 count_array[i, 0] += 1
 *             elif b in [b'C', b'c']:             # <<<<<<<<<<<<<<
 *                 count_array[i, 1] += 1
 *             elif b in [b'G', b'g']:
*/
      break;
      case 'G':

      /* "HTSeq/_HTSeq.pyx":1188
 *             elif b in [b'C', b'c']:
 *                 count_array[i, 1] += 1
 *             elif b in [b'G', b'g']:             # <<<<<<<<<<<<<<
 *                 count_array[i, 2] += 1
 *             elif b in [b'T', b't']:
*/
      case 'g':

      /* "HTSeq/_HTSeq.pyx":1189
 *                 count_array[i, 1] += 1
 *             elif b in [b'G', b'g']:
 *                 count_array[i, 2] += 1             # <<<<<<<<<<<<<<
 *             elif b in [b'T', b't']:
 *                 count_array[i, 3] += 1
*/
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_13 = 2;
      __pyx_t_14 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_count_array.diminfo[0].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_14 = 0;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_count_array.diminfo[1].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 1;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_14 = 1;
      if (unlikely(__pyx_t_14 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_14);
        __PYX_ERR(0, 1189, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;

      /* "HTSeq/_HTSeq.pyx":1188
 *             elif b in [b'C', b'c']:
 *                 count_array[i, 1] += 1
 *             elif b in [b'G', b'g']:             # <<<<<<<<<<<<<<
 *                 count_array[i, 2] += 1
 *             elif b in [b'T', b't']:
*/
      break;
      case 'T':

      /* "HTSeq/_HTSeq.pyx":1190
 *             elif b in [b'G', b'g']:
 *                 count_array[i, 2] += 1
 *             elif b in [b'T', b't']:             # <<<<<<<<<<<<<<
 *                 count_array[i, 3] += 1
 *             elif b in [b'N', b'n', b'.']:
*/
      case 't':

      /* "HTSeq/_HTSeq.pyx":1191
 *                 count_array[i, 2] += 1
 *             elif b in [b'T', b't']:
 *                 count_array[i, 3] += 1             # <<<<<<<<<<<<<<
 *             elif b in [b'N', b'n', b'.']:
 *                 count_array[i, 4] += 1
*/
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_12 = 3;
      __pyx_t_14 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_count_array.diminfo[0].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_14 = 0;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_count_array.diminfo[1].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 1;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_14 = 1;
      if (unlikely(__pyx_t_14 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_14);
        __PYX_ERR(0, 1191, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;

      /* "HTSeq/_HTSeq.pyx":1190
 *             elif b in [b'G', b'g']:
 *                 count_array[i, 2] += 1
 *             elif b in [b'T', b't']:             # <<<<<<<<<<<<<<
 *                 count_array[i, 3] += 1
 *             elif b in [b'N', b'n', b'.']:
*/
      break;
      case 'N':

      /* "HTSeq/_HTSeq.pyx":1192
 *             elif b in [b'T', b't']:
 *                 count_array[i, 3] += 1
 *             elif b in [b'N', b'n', b'.']:             # <<<<<<<<<<<<<<
 *                 count_array[i, 4] += 1
 *             else:
*/
      case 'n':
      case '.':

      /* "HTSeq/_HTSeq.pyx":1193
 *                 count_array[i, 3] += 1
 *             elif b in [b'N', b'n', b'.']:
 *                 count_array[i, 4] += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError("Illegal base letter encountered.")
*/
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_13 = 4;
      __pyx_t_14 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_count_array.diminfo[0].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_14 = 0;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_count_array.diminfo[1].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 1;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_14 = 1;
      if (unlikely(__pyx_t_14 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_14);
        __PYX_ERR(0, 1193, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;

      /* "HTSeq/_HTSeq.pyx":1192
 *             elif b in [b'T', b't']:
 *                 count_array[i, 3] += 1
 *             elif b in [b'N', b'n', b'.']:             # <<<<<<<<<<<<<<
 *                 count_array[i, 4] += 1
 *             else:
*/
      break;
      default:

      /* "HTSeq/_HTSeq.pyx":1195
 *                 count_array[i, 4] += 1
 *             else:
 *                 raise ValueError("Illegal base letter encountered.")             # <<<<<<<<<<<<<<
 * 
 *         return None
*/
      __pyx_t_2 = NULL;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Illegal_base_letter_encountered};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __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, 1195, __pyx_L1_error)
      break;
    }
  }

  /* "HTSeq/_HTSeq.pyx":1197
 *                 raise ValueError("Illegal base letter encountered.")
 * 
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1169
 *                 i += 1
 * 
 *     cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_):             # <<<<<<<<<<<<<<
 * 
 *         cdef numpy.ndarray[numpy.int64_t, ndim = 2] count_array = count_array_
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.add_bases_to_count_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_count_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array(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_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array = {"add_bases_to_count_array", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array(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
) {
  PyArrayObject *__pyx_v_count_array_ = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_bases_to_count_array (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_count_array,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, 1169, __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, 1169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_bases_to_count_array", 0) < (0)) __PYX_ERR(0, 1169, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_bases_to_count_array", 1, 1, 1, i); __PYX_ERR(0, 1169, __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, 1169, __pyx_L3_error)
    }
    __pyx_v_count_array_ = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_bases_to_count_array", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1169, __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("HTSeq._HTSeq.Sequence.add_bases_to_count_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count_array_), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "count_array_", 0))) __PYX_ERR(0, 1169, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_20add_bases_to_count_array(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_count_array_);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_20add_bases_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyArrayObject *__pyx_v_count_array_) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_bases_to_count_array", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_8Sequence_add_bases_to_count_array(__pyx_v_self, __pyx_v_count_array_, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.add_bases_to_count_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1199
 *         return None
 * 
 *     cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.):             # <<<<<<<<<<<<<<
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end(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 struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_left_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end *__pyx_optional_args) {
  float __pyx_v_mismatch_prop = ((float)0.);
  int __pyx_v_seqlen;
  int __pyx_v_patlen;
  int __pyx_v_minlen;
  char *__pyx_v_seq_cstr;
  char *__pyx_v_pat_cstr;
  int __pyx_v_match;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_num_mismatches;
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__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;
  char *__pyx_t_9;
  long __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trim_left_end", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_mismatch_prop = __pyx_optional_args->mismatch_prop;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_trim_left_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_mismatch_prop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1199, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_pattern), __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 1199, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":1200
 * 
 *     cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
 *         cdef int seqlen = len(self.seq)             # <<<<<<<<<<<<<<
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
*/
  __pyx_t_1 = __pyx_v_self->seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1200, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seqlen = __pyx_t_7;

  /* "HTSeq/_HTSeq.pyx":1201
 *     cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)             # <<<<<<<<<<<<<<
 *         cdef int minlen
 *         if seqlen < patlen:
*/
  __pyx_t_1 = __pyx_v_pattern->seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1201, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_patlen = __pyx_t_7;

  /* "HTSeq/_HTSeq.pyx":1203
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
*/
  __pyx_t_8 = (__pyx_v_seqlen < __pyx_v_patlen);
  if (__pyx_t_8) {

    /* "HTSeq/_HTSeq.pyx":1204
 *         cdef int minlen
 *         if seqlen < patlen:
 *             minlen = seqlen             # <<<<<<<<<<<<<<
 *         else:
 *             minlen = patlen
*/
    __pyx_v_minlen = __pyx_v_seqlen;

    /* "HTSeq/_HTSeq.pyx":1203
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1206
 *             minlen = seqlen
 *         else:
 *             minlen = patlen             # <<<<<<<<<<<<<<
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq
*/
  /*else*/ {
    __pyx_v_minlen = __pyx_v_patlen;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1207
 *         else:
 *             minlen = patlen
 *         cdef char * seq_cstr = self.seq             # <<<<<<<<<<<<<<
 *         cdef char * pat_cstr = pattern.seq
 *         cdef int match = 0
*/
  if (unlikely(__pyx_v_self->seq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1207, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->seq); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 1207, __pyx_L1_error)
  __pyx_v_seq_cstr = __pyx_t_9;

  /* "HTSeq/_HTSeq.pyx":1208
 *             minlen = patlen
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq             # <<<<<<<<<<<<<<
 *         cdef int match = 0
 *         cdef int i, j
*/
  if (unlikely(__pyx_v_pattern->seq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1208, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 1208, __pyx_L1_error)
  __pyx_v_pat_cstr = __pyx_t_9;

  /* "HTSeq/_HTSeq.pyx":1209
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq
 *         cdef int match = 0             # <<<<<<<<<<<<<<
 *         cdef int i, j
 *         cdef int num_mismatches
*/
  __pyx_v_match = 0;

  /* "HTSeq/_HTSeq.pyx":1212
 *         cdef int i, j
 *         cdef int num_mismatches
 *         for i in range(1, minlen + 1):             # <<<<<<<<<<<<<<
 *             num_mismatches = 0
 *             for j in range(i):
*/
  __pyx_t_10 = (__pyx_v_minlen + 1);
  __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;

    /* "HTSeq/_HTSeq.pyx":1213
 *         cdef int num_mismatches
 *         for i in range(1, minlen + 1):
 *             num_mismatches = 0             # <<<<<<<<<<<<<<
 *             for j in range(i):
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
*/
    __pyx_v_num_mismatches = 0;

    /* "HTSeq/_HTSeq.pyx":1214
 *         for i in range(1, minlen + 1):
 *             num_mismatches = 0
 *             for j in range(i):             # <<<<<<<<<<<<<<
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
 *                     num_mismatches += 1
*/
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "HTSeq/_HTSeq.pyx":1215
 *             num_mismatches = 0
 *             for j in range(i):
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:             # <<<<<<<<<<<<<<
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:
*/
      __pyx_t_8 = ((__pyx_v_seq_cstr[__pyx_v_j]) != (__pyx_v_pat_cstr[((__pyx_v_patlen - __pyx_v_i) + __pyx_v_j)]));
      if (__pyx_t_8) {

        /* "HTSeq/_HTSeq.pyx":1216
 *             for j in range(i):
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
 *                     num_mismatches += 1             # <<<<<<<<<<<<<<
 *                     if num_mismatches > mismatch_prop * i:
 *                         break
*/
        __pyx_v_num_mismatches = (__pyx_v_num_mismatches + 1);

        /* "HTSeq/_HTSeq.pyx":1217
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
*/
        __pyx_t_8 = (__pyx_v_num_mismatches > (__pyx_v_mismatch_prop * __pyx_v_i));
        if (__pyx_t_8) {

          /* "HTSeq/_HTSeq.pyx":1218
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:
 *                         break             # <<<<<<<<<<<<<<
 *             else:
 *                 match = i
*/
          goto __pyx_L7_break;

          /* "HTSeq/_HTSeq.pyx":1217
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
*/
        }

        /* "HTSeq/_HTSeq.pyx":1215
 *             num_mismatches = 0
 *             for j in range(i):
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:             # <<<<<<<<<<<<<<
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:
*/
      }
    }
    /*else*/ {

      /* "HTSeq/_HTSeq.pyx":1220
 *                         break
 *             else:
 *                 match = i             # <<<<<<<<<<<<<<
 *         return self[match: seqlen]
 * 
*/
      __pyx_v_match = __pyx_v_i;
    }
    __pyx_L7_break:;
  }

  /* "HTSeq/_HTSeq.pyx":1221
 *             else:
 *                 match = i
 *         return self[match: seqlen]             # <<<<<<<<<<<<<<
 * 
 *     cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), __pyx_v_match, __pyx_v_seqlen, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 1221, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1199
 *         return None
 * 
 *     cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.):             # <<<<<<<<<<<<<<
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.trim_left_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end(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_5HTSeq_6_HTSeq_8Sequence_23trim_left_end = {"trim_left_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_23trim_left_end(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
  float __pyx_v_mismatch_prop;
  #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("trim_left_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_pattern,&__pyx_mstate_global->__pyx_n_u_mismatch_prop,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, 1199, __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, 1199, __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, 1199, __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, "trim_left_end", 0) < (0)) __PYX_ERR(0, 1199, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("trim_left_end", 0, 1, 2, i); __PYX_ERR(0, 1199, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1199, __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, 1199, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pattern = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)values[0]);
    if (values[1]) {
      __pyx_v_mismatch_prop = __Pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_mismatch_prop == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1199, __pyx_L3_error)
    } else {
      __pyx_v_mismatch_prop = ((float)0.);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("trim_left_end", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1199, __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("HTSeq._HTSeq.Sequence.trim_left_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pattern), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 1199, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_22trim_left_end(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_pattern, __pyx_v_mismatch_prop);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_22trim_left_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, float __pyx_v_mismatch_prop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trim_left_end", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.mismatch_prop = __pyx_v_mismatch_prop;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence->trim_left_end(__pyx_v_self, __pyx_v_pattern, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.trim_left_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1223
 *         return self[match: seqlen]
 * 
 *     cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.):             # <<<<<<<<<<<<<<
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end(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 struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_right_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end *__pyx_optional_args) {
  float __pyx_v_mismatch_prop = ((float)0.);
  int __pyx_v_seqlen;
  int __pyx_v_patlen;
  int __pyx_v_minlen;
  char *__pyx_v_seq_cstr;
  char *__pyx_v_pat_cstr;
  int __pyx_v_match;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_num_mismatches;
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__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;
  char *__pyx_t_9;
  long __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trim_right_end", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_mismatch_prop = __pyx_optional_args->mismatch_prop;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_trim_right_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_mismatch_prop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_pattern), __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1223, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 1223, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":1224
 * 
 *     cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
 *         cdef int seqlen = len(self.seq)             # <<<<<<<<<<<<<<
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
*/
  __pyx_t_1 = __pyx_v_self->seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1224, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seqlen = __pyx_t_7;

  /* "HTSeq/_HTSeq.pyx":1225
 *     cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.):
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)             # <<<<<<<<<<<<<<
 *         cdef int minlen
 *         if seqlen < patlen:
*/
  __pyx_t_1 = __pyx_v_pattern->seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1225, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_patlen = __pyx_t_7;

  /* "HTSeq/_HTSeq.pyx":1227
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
*/
  __pyx_t_8 = (__pyx_v_seqlen < __pyx_v_patlen);
  if (__pyx_t_8) {

    /* "HTSeq/_HTSeq.pyx":1228
 *         cdef int minlen
 *         if seqlen < patlen:
 *             minlen = seqlen             # <<<<<<<<<<<<<<
 *         else:
 *             minlen = patlen
*/
    __pyx_v_minlen = __pyx_v_seqlen;

    /* "HTSeq/_HTSeq.pyx":1227
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1230
 *             minlen = seqlen
 *         else:
 *             minlen = patlen             # <<<<<<<<<<<<<<
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq
*/
  /*else*/ {
    __pyx_v_minlen = __pyx_v_patlen;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1231
 *         else:
 *             minlen = patlen
 *         cdef char * seq_cstr = self.seq             # <<<<<<<<<<<<<<
 *         cdef char * pat_cstr = pattern.seq
 *         cdef int match = 0
*/
  if (unlikely(__pyx_v_self->seq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1231, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->seq); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L1_error)
  __pyx_v_seq_cstr = __pyx_t_9;

  /* "HTSeq/_HTSeq.pyx":1232
 *             minlen = patlen
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq             # <<<<<<<<<<<<<<
 *         cdef int match = 0
 *         cdef int i, j
*/
  if (unlikely(__pyx_v_pattern->seq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1232, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 1232, __pyx_L1_error)
  __pyx_v_pat_cstr = __pyx_t_9;

  /* "HTSeq/_HTSeq.pyx":1233
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq
 *         cdef int match = 0             # <<<<<<<<<<<<<<
 *         cdef int i, j
 *         cdef int num_mismatches
*/
  __pyx_v_match = 0;

  /* "HTSeq/_HTSeq.pyx":1236
 *         cdef int i, j
 *         cdef int num_mismatches
 *         for i in range(1, minlen + 1):             # <<<<<<<<<<<<<<
 *             num_mismatches = 0
 *             for j in range(i):
*/
  __pyx_t_10 = (__pyx_v_minlen + 1);
  __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;

    /* "HTSeq/_HTSeq.pyx":1237
 *         cdef int num_mismatches
 *         for i in range(1, minlen + 1):
 *             num_mismatches = 0             # <<<<<<<<<<<<<<
 *             for j in range(i):
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
*/
    __pyx_v_num_mismatches = 0;

    /* "HTSeq/_HTSeq.pyx":1238
 *         for i in range(1, minlen + 1):
 *             num_mismatches = 0
 *             for j in range(i):             # <<<<<<<<<<<<<<
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
 *                     num_mismatches += 1
*/
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "HTSeq/_HTSeq.pyx":1239
 *             num_mismatches = 0
 *             for j in range(i):
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:             # <<<<<<<<<<<<<<
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:
*/
      __pyx_t_8 = ((__pyx_v_seq_cstr[((__pyx_v_seqlen - __pyx_v_i) + __pyx_v_j)]) != (__pyx_v_pat_cstr[__pyx_v_j]));
      if (__pyx_t_8) {

        /* "HTSeq/_HTSeq.pyx":1240
 *             for j in range(i):
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
 *                     num_mismatches += 1             # <<<<<<<<<<<<<<
 *                     if num_mismatches > mismatch_prop * i:
 *                         break
*/
        __pyx_v_num_mismatches = (__pyx_v_num_mismatches + 1);

        /* "HTSeq/_HTSeq.pyx":1241
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
*/
        __pyx_t_8 = (__pyx_v_num_mismatches > (__pyx_v_mismatch_prop * __pyx_v_i));
        if (__pyx_t_8) {

          /* "HTSeq/_HTSeq.pyx":1242
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:
 *                         break             # <<<<<<<<<<<<<<
 *             else:
 *                 match = i
*/
          goto __pyx_L7_break;

          /* "HTSeq/_HTSeq.pyx":1241
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
*/
        }

        /* "HTSeq/_HTSeq.pyx":1239
 *             num_mismatches = 0
 *             for j in range(i):
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:             # <<<<<<<<<<<<<<
 *                     num_mismatches += 1
 *                     if num_mismatches > mismatch_prop * i:
*/
      }
    }
    /*else*/ {

      /* "HTSeq/_HTSeq.pyx":1244
 *                         break
 *             else:
 *                 match = i             # <<<<<<<<<<<<<<
 *         return self[0: seqlen - match]
 * 
*/
      __pyx_v_match = __pyx_v_i;
    }
    __pyx_L7_break:;
  }

  /* "HTSeq/_HTSeq.pyx":1245
 *             else:
 *                 match = i
 *         return self[0: seqlen - match]             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, (__pyx_v_seqlen - __pyx_v_match), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence))))) __PYX_ERR(0, 1245, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1223
 *         return self[match: seqlen]
 * 
 *     cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.):             # <<<<<<<<<<<<<<
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.trim_right_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end(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_5HTSeq_6_HTSeq_8Sequence_25trim_right_end = {"trim_right_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_25trim_right_end(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
  float __pyx_v_mismatch_prop;
  #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("trim_right_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_pattern,&__pyx_mstate_global->__pyx_n_u_mismatch_prop,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, 1223, __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, 1223, __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, 1223, __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, "trim_right_end", 0) < (0)) __PYX_ERR(0, 1223, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("trim_right_end", 0, 1, 2, i); __PYX_ERR(0, 1223, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1223, __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, 1223, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pattern = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)values[0]);
    if (values[1]) {
      __pyx_v_mismatch_prop = __Pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_mismatch_prop == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1223, __pyx_L3_error)
    } else {
      __pyx_v_mismatch_prop = ((float)0.);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("trim_right_end", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1223, __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("HTSeq._HTSeq.Sequence.trim_right_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pattern), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 1223, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_24trim_right_end(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), __pyx_v_pattern, __pyx_v_mismatch_prop);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_24trim_right_end(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, float __pyx_v_mismatch_prop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trim_right_end", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.mismatch_prop = __pyx_v_mismatch_prop;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence->trim_right_end(__pyx_v_self, __pyx_v_pattern, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.trim_right_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":20
 * 
 * cdef class Sequence(object):
 *    cdef public bytes seq             # <<<<<<<<<<<<<<
 *    cdef public str name
 *    cdef public str descr
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->seq);
  __pyx_r = __pyx_v_self->seq;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 20, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->seq);
  __Pyx_DECREF(__pyx_v_self->seq);
  __pyx_v_self->seq = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.seq.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_3seq_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->seq);
  __Pyx_DECREF(__pyx_v_self->seq);
  __pyx_v_self->seq = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pxd":21
 * cdef class Sequence(object):
 *    cdef public bytes seq
 *    cdef public str name             # <<<<<<<<<<<<<<
 *    cdef public str descr
 *    cpdef Sequence get_reverse_complement(self, bint rename=?)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_4name_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pxd":22
 *    cdef public bytes seq
 *    cdef public str name
 *    cdef public str descr             # <<<<<<<<<<<<<<
 *    cpdef Sequence get_reverse_complement(self, bint rename=?)
 *    cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->descr);
  __pyx_r = __pyx_v_self->descr;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(2, 22, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->descr);
  __Pyx_DECREF(__pyx_v_self->descr);
  __pyx_v_self->descr = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Sequence.descr.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_8Sequence_5descr_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->descr);
  __Pyx_DECREF(__pyx_v_self->descr);
  __pyx_v_self->descr = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pyx":1254
 *     """
 * 
 *     def __init__(self, bytes seq, str name, bytes qualstr, str qualscale="phred"):             # <<<<<<<<<<<<<<
 *         """ Construct a SequenceWithQuality object.
 * 
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_5HTSeq_6_HTSeq_21SequenceWithQualities___init__, " Construct a SequenceWithQuality object.\n\n          seq       - The actual sequence.\n          name      - The sequence name or ID\n          qualstr   - The quality string. Must have the same length as seq\n          qualscale - The encoding scale of the quality string. Must be one of\n                        \"phred\", \"solexa\", \"solexa-old\", or \"noquals\" )\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_5HTSeq_6_HTSeq_21SequenceWithQualities___init__;
#endif
static int __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_qualstr = 0;
  PyObject *__pyx_v_qualscale = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_seq,&__pyx_mstate_global->__pyx_n_u_name_2,&__pyx_mstate_global->__pyx_n_u_qualstr,&__pyx_mstate_global->__pyx_n_u_qualscale,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, 1254, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1254, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1254, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1254, __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, 1254, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1254, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_phred));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 1254, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1254, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1254, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1254, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1254, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_phred));
    }
    __pyx_v_seq = ((PyObject*)values[0]);
    __pyx_v_name = ((PyObject*)values[1]);
    __pyx_v_qualstr = ((PyObject*)values[2]);
    __pyx_v_qualscale = ((PyObject*)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 1254, __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("HTSeq._HTSeq.SequenceWithQualities.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seq), (&PyBytes_Type), 1, "seq", 1))) __PYX_ERR(0, 1254, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 1254, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qualstr), (&PyBytes_Type), 1, "qualstr", 1))) __PYX_ERR(0, 1254, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qualscale), (&PyUnicode_Type), 1, "qualscale", 1))) __PYX_ERR(0, 1254, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_seq, __pyx_v_name, __pyx_v_qualstr, __pyx_v_qualscale);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities___init__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_name, PyObject *__pyx_v_qualstr, PyObject *__pyx_v_qualscale) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":1263
 *                         "phred", "solexa", "solexa-old", or "noquals" )
 *         """
 *         Sequence.__init__(self, seq, name)             # <<<<<<<<<<<<<<
 *         if qualscale != "noquals":
 *             if len(seq) != len(qualstr):
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_seq, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1264
 *         """
 *         Sequence.__init__(self, seq, name)
 *         if qualscale != "noquals":             # <<<<<<<<<<<<<<
 *             if len(seq) != len(qualstr):
 *                 raise ValueError("'seq' and 'qualstr' do not have the same length.")
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_qualscale, __pyx_mstate_global->__pyx_n_u_noquals, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1265
 *         Sequence.__init__(self, seq, name)
 *         if qualscale != "noquals":
 *             if len(seq) != len(qualstr):             # <<<<<<<<<<<<<<
 *                 raise ValueError("'seq' and 'qualstr' do not have the same length.")
 *             self._qualstr = qualstr
*/
    if (unlikely(__pyx_v_seq == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 1265, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyBytes_GET_SIZE(__pyx_v_seq); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1265, __pyx_L1_error)
    if (unlikely(__pyx_v_qualstr == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 1265, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyBytes_GET_SIZE(__pyx_v_qualstr); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1265, __pyx_L1_error)
    __pyx_t_4 = (__pyx_t_5 != __pyx_t_6);
    if (unlikely(__pyx_t_4)) {

      /* "HTSeq/_HTSeq.pyx":1266
 *         if qualscale != "noquals":
 *             if len(seq) != len(qualstr):
 *                 raise ValueError("'seq' and 'qualstr' do not have the same length.")             # <<<<<<<<<<<<<<
 *             self._qualstr = qualstr
 *         else:
*/
      __pyx_t_2 = NULL;
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_seq_and_qualstr_do_not_have_the};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __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, 1266, __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, 1266, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":1265
 *         Sequence.__init__(self, seq, name)
 *         if qualscale != "noquals":
 *             if len(seq) != len(qualstr):             # <<<<<<<<<<<<<<
 *                 raise ValueError("'seq' and 'qualstr' do not have the same length.")
 *             self._qualstr = qualstr
*/
    }

    /* "HTSeq/_HTSeq.pyx":1267
 *             if len(seq) != len(qualstr):
 *                 raise ValueError("'seq' and 'qualstr' do not have the same length.")
 *             self._qualstr = qualstr             # <<<<<<<<<<<<<<
 *         else:
 *             self._qualstr = b''
*/
    __Pyx_INCREF(__pyx_v_qualstr);
    __Pyx_GIVEREF(__pyx_v_qualstr);
    __Pyx_GOTREF(__pyx_v_self->_qualstr);
    __Pyx_DECREF(__pyx_v_self->_qualstr);
    __pyx_v_self->_qualstr = __pyx_v_qualstr;

    /* "HTSeq/_HTSeq.pyx":1264
 *         """
 *         Sequence.__init__(self, seq, name)
 *         if qualscale != "noquals":             # <<<<<<<<<<<<<<
 *             if len(seq) != len(qualstr):
 *                 raise ValueError("'seq' and 'qualstr' do not have the same length.")
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1269
 *             self._qualstr = qualstr
 *         else:
 *             self._qualstr = b''             # <<<<<<<<<<<<<<
 *         self._qualscale = qualscale
 *         self._qualarr = None
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__12);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b__12);
    __Pyx_GOTREF(__pyx_v_self->_qualstr);
    __Pyx_DECREF(__pyx_v_self->_qualstr);
    __pyx_v_self->_qualstr = __pyx_mstate_global->__pyx_kp_b__12;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1270
 *         else:
 *             self._qualstr = b''
 *         self._qualscale = qualscale             # <<<<<<<<<<<<<<
 *         self._qualarr = None
 *         self._qualstr_phred = b''
*/
  __Pyx_INCREF(__pyx_v_qualscale);
  __Pyx_GIVEREF(__pyx_v_qualscale);
  __Pyx_GOTREF(__pyx_v_self->_qualscale);
  __Pyx_DECREF(__pyx_v_self->_qualscale);
  __pyx_v_self->_qualscale = __pyx_v_qualscale;

  /* "HTSeq/_HTSeq.pyx":1271
 *             self._qualstr = b''
 *         self._qualscale = qualscale
 *         self._qualarr = None             # <<<<<<<<<<<<<<
 *         self._qualstr_phred = b''
 * 
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_qualarr);
  __Pyx_DECREF(__pyx_v_self->_qualarr);
  __pyx_v_self->_qualarr = Py_None;

  /* "HTSeq/_HTSeq.pyx":1272
 *         self._qualscale = qualscale
 *         self._qualarr = None
 *         self._qualstr_phred = b''             # <<<<<<<<<<<<<<
 * 
 *     cdef _fill_qual_arr(SequenceWithQualities self):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__12);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b__12);
  __Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
  __Pyx_DECREF(__pyx_v_self->_qualstr_phred);
  __pyx_v_self->_qualstr_phred = __pyx_mstate_global->__pyx_kp_b__12;

  /* "HTSeq/_HTSeq.pyx":1254
 *     """
 * 
 *     def __init__(self, bytes seq, str name, bytes qualstr, str qualscale="phred"):             # <<<<<<<<<<<<<<
 *         """ Construct a SequenceWithQuality object.
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1274
 *         self._qualstr_phred = b''
 * 
 *     cdef _fill_qual_arr(SequenceWithQualities self):             # <<<<<<<<<<<<<<
 *         cdef int seq_len = len(self.seq)
 *         if self._qualscale == "missing":
*/

static PyObject *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities__fill_qual_arr(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
  int __pyx_v_seq_len;
  PyArrayObject *__pyx_v_qualarr = 0;
  int __pyx_v_i;
  char *__pyx_v_qualstr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_qualarr;
  __Pyx_Buffer __pyx_pybuffer_qualarr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  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;
  char *__pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  __pyx_t_5numpy_uint8_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_fill_qual_arr", 0);
  __pyx_pybuffer_qualarr.pybuffer.buf = NULL;
  __pyx_pybuffer_qualarr.refcount = 0;
  __pyx_pybuffernd_qualarr.data = NULL;
  __pyx_pybuffernd_qualarr.rcbuffer = &__pyx_pybuffer_qualarr;

  /* "HTSeq/_HTSeq.pyx":1275
 * 
 *     cdef _fill_qual_arr(SequenceWithQualities self):
 *         cdef int seq_len = len(self.seq)             # <<<<<<<<<<<<<<
 *         if self._qualscale == "missing":
 *             raise ValueError("Quality string missing.")
*/
  __pyx_t_1 = __pyx_v_self->__pyx_base.seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1275, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seq_len = __pyx_t_2;

  /* "HTSeq/_HTSeq.pyx":1276
 *     cdef _fill_qual_arr(SequenceWithQualities self):
 *         cdef int seq_len = len(self.seq)
 *         if self._qualscale == "missing":             # <<<<<<<<<<<<<<
 *             raise ValueError("Quality string missing.")
 *         if seq_len != len(self._qualstr):
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_mstate_global->__pyx_n_u_missing, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1276, __pyx_L1_error)
  if (unlikely(__pyx_t_3)) {

    /* "HTSeq/_HTSeq.pyx":1277
 *         cdef int seq_len = len(self.seq)
 *         if self._qualscale == "missing":
 *             raise ValueError("Quality string missing.")             # <<<<<<<<<<<<<<
 *         if seq_len != len(self._qualstr):
 *             raise ValueError("Quality string has not the same length as sequence.")
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Quality_string_missing};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1277, __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, 1277, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1276
 *     cdef _fill_qual_arr(SequenceWithQualities self):
 *         cdef int seq_len = len(self.seq)
 *         if self._qualscale == "missing":             # <<<<<<<<<<<<<<
 *             raise ValueError("Quality string missing.")
 *         if seq_len != len(self._qualstr):
*/
  }

  /* "HTSeq/_HTSeq.pyx":1278
 *         if self._qualscale == "missing":
 *             raise ValueError("Quality string missing.")
 *         if seq_len != len(self._qualstr):             # <<<<<<<<<<<<<<
 *             raise ValueError("Quality string has not the same length as sequence.")
 *         cdef numpy.ndarray[numpy.uint8_t, ndim= 1] qualarr = numpy.empty((seq_len, ), numpy.uint8)
*/
  __pyx_t_1 = __pyx_v_self->_qualstr;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1278, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_v_seq_len != __pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "HTSeq/_HTSeq.pyx":1279
 *             raise ValueError("Quality string missing.")
 *         if seq_len != len(self._qualstr):
 *             raise ValueError("Quality string has not the same length as sequence.")             # <<<<<<<<<<<<<<
 *         cdef numpy.ndarray[numpy.uint8_t, ndim= 1] qualarr = numpy.empty((seq_len, ), numpy.uint8)
 *         cdef int i
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Quality_string_has_not_the_same};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __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, 1279, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1278
 *         if self._qualscale == "missing":
 *             raise ValueError("Quality string missing.")
 *         if seq_len != len(self._qualstr):             # <<<<<<<<<<<<<<
 *             raise ValueError("Quality string has not the same length as sequence.")
 *         cdef numpy.ndarray[numpy.uint8_t, ndim= 1] qualarr = numpy.empty((seq_len, ), numpy.uint8)
*/
  }

  /* "HTSeq/_HTSeq.pyx":1280
 *         if seq_len != len(self._qualstr):
 *             raise ValueError("Quality string has not the same length as sequence.")
 *         cdef numpy.ndarray[numpy.uint8_t, ndim= 1] qualarr = numpy.empty((seq_len, ), numpy.uint8)             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef char * qualstr = self._qualstr
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_seq_len); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1280, __pyx_L1_error);
  __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_uint8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_8, __pyx_t_9};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __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;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1280, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qualarr.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_qualarr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 1280, __pyx_L1_error)
    } else {__pyx_pybuffernd_qualarr.diminfo[0].strides = __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qualarr.diminfo[0].shape = __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_qualarr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1282
 *         cdef numpy.ndarray[numpy.uint8_t, ndim= 1] qualarr = numpy.empty((seq_len, ), numpy.uint8)
 *         cdef int i
 *         cdef char * qualstr = self._qualstr             # <<<<<<<<<<<<<<
 *         if self._qualscale == "phred":
 *             for i in range(seq_len):
*/
  if (unlikely(__pyx_v_self->_qualstr == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1282, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_qualstr); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 1282, __pyx_L1_error)
  __pyx_v_qualstr = __pyx_t_10;

  /* "HTSeq/_HTSeq.pyx":1283
 *         cdef int i
 *         cdef char * qualstr = self._qualstr
 *         if self._qualscale == "phred":             # <<<<<<<<<<<<<<
 *             for i in range(seq_len):
 *                 qualarr[i] = qualstr[i] - 33
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_mstate_global->__pyx_n_u_phred, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":1284
 *         cdef char * qualstr = self._qualstr
 *         if self._qualscale == "phred":
 *             for i in range(seq_len):             # <<<<<<<<<<<<<<
 *                 qualarr[i] = qualstr[i] - 33
 *         elif self._qualscale == "solexa":
*/
    __pyx_t_11 = __pyx_v_seq_len;
    __pyx_t_12 = __pyx_t_11;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "HTSeq/_HTSeq.pyx":1285
 *         if self._qualscale == "phred":
 *             for i in range(seq_len):
 *                 qualarr[i] = qualstr[i] - 33             # <<<<<<<<<<<<<<
 *         elif self._qualscale == "solexa":
 *             for i in range(seq_len):
*/
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_qualarr.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_qualarr.diminfo[0].shape)) __pyx_t_15 = 0;
      if (unlikely(__pyx_t_15 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_15);
        __PYX_ERR(0, 1285, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_qualarr.diminfo[0].strides) = ((__pyx_v_qualstr[__pyx_v_i]) - 33);
    }

    /* "HTSeq/_HTSeq.pyx":1283
 *         cdef int i
 *         cdef char * qualstr = self._qualstr
 *         if self._qualscale == "phred":             # <<<<<<<<<<<<<<
 *             for i in range(seq_len):
 *                 qualarr[i] = qualstr[i] - 33
*/
    goto __pyx_L5;
  }

  /* "HTSeq/_HTSeq.pyx":1286
 *             for i in range(seq_len):
 *                 qualarr[i] = qualstr[i] - 33
 *         elif self._qualscale == "solexa":             # <<<<<<<<<<<<<<
 *             for i in range(seq_len):
 *                 qualarr[i] = qualstr[i] - 64
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_mstate_global->__pyx_n_u_solexa, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1286, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":1287
 *                 qualarr[i] = qualstr[i] - 33
 *         elif self._qualscale == "solexa":
 *             for i in range(seq_len):             # <<<<<<<<<<<<<<
 *                 qualarr[i] = qualstr[i] - 64
 *         elif self._qualscale == "solexa-old":
*/
    __pyx_t_11 = __pyx_v_seq_len;
    __pyx_t_12 = __pyx_t_11;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "HTSeq/_HTSeq.pyx":1288
 *         elif self._qualscale == "solexa":
 *             for i in range(seq_len):
 *                 qualarr[i] = qualstr[i] - 64             # <<<<<<<<<<<<<<
 *         elif self._qualscale == "solexa-old":
 *             for i in range(seq_len):
*/
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_qualarr.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_qualarr.diminfo[0].shape)) __pyx_t_15 = 0;
      if (unlikely(__pyx_t_15 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_15);
        __PYX_ERR(0, 1288, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_qualarr.diminfo[0].strides) = ((__pyx_v_qualstr[__pyx_v_i]) - 64);
    }

    /* "HTSeq/_HTSeq.pyx":1286
 *             for i in range(seq_len):
 *                 qualarr[i] = qualstr[i] - 33
 *         elif self._qualscale == "solexa":             # <<<<<<<<<<<<<<
 *             for i in range(seq_len):
 *                 qualarr[i] = qualstr[i] - 64
*/
    goto __pyx_L5;
  }

  /* "HTSeq/_HTSeq.pyx":1289
 *             for i in range(seq_len):
 *                 qualarr[i] = qualstr[i] - 64
 *         elif self._qualscale == "solexa-old":             # <<<<<<<<<<<<<<
 *             for i in range(seq_len):
 *                 qualarr[i] = 10 * \
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_mstate_global->__pyx_kp_u_solexa_old, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1289, __pyx_L1_error)
  if (likely(__pyx_t_3)) {

    /* "HTSeq/_HTSeq.pyx":1290
 *                 qualarr[i] = qualstr[i] - 64
 *         elif self._qualscale == "solexa-old":
 *             for i in range(seq_len):             # <<<<<<<<<<<<<<
 *                 qualarr[i] = 10 * \
 *                     math.log10(1 + 10 ** (qualstr[i] - 64) / 10.0)
*/
    __pyx_t_11 = __pyx_v_seq_len;
    __pyx_t_12 = __pyx_t_11;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "HTSeq/_HTSeq.pyx":1292
 *             for i in range(seq_len):
 *                 qualarr[i] = 10 * \
 *                     math.log10(1 + 10 ** (qualstr[i] - 64) / 10.0)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Illegal quality scale '%s'." % self._qualscale)
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_log10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyFloat_FromDouble((1.0 + (pow(10.0, ((double)((__pyx_v_qualstr[__pyx_v_i]) - 64))) / 10.0))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1292, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }

      /* "HTSeq/_HTSeq.pyx":1291
 *         elif self._qualscale == "solexa-old":
 *             for i in range(seq_len):
 *                 qualarr[i] = 10 * \             # <<<<<<<<<<<<<<
 *                     math.log10(1 + 10 ** (qualstr[i] - 64) / 10.0)
 *         else:
*/
      __pyx_t_8 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_10, __pyx_t_1, 10, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_16 = __Pyx_PyLong_As_npy_uint8(__pyx_t_8); if (unlikely((__pyx_t_16 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1291, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_qualarr.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_qualarr.diminfo[0].shape)) __pyx_t_15 = 0;
      if (unlikely(__pyx_t_15 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_15);
        __PYX_ERR(0, 1291, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qualarr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_qualarr.diminfo[0].strides) = __pyx_t_16;
    }

    /* "HTSeq/_HTSeq.pyx":1289
 *             for i in range(seq_len):
 *                 qualarr[i] = qualstr[i] - 64
 *         elif self._qualscale == "solexa-old":             # <<<<<<<<<<<<<<
 *             for i in range(seq_len):
 *                 qualarr[i] = 10 * \
*/
    goto __pyx_L5;
  }

  /* "HTSeq/_HTSeq.pyx":1294
 *                     math.log10(1 + 10 ** (qualstr[i] - 64) / 10.0)
 *         else:
 *             raise ValueError("Illegal quality scale '%s'." % self._qualscale)             # <<<<<<<<<<<<<<
 *         self._qualarr = qualarr
 * 
*/
  /*else*/ {
    __pyx_t_1 = NULL;
    __pyx_t_9 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Illegal_quality_scale_s, __pyx_v_self->_qualscale); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(0, 1294, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "HTSeq/_HTSeq.pyx":1295
 *         else:
 *             raise ValueError("Illegal quality scale '%s'." % self._qualscale)
 *         self._qualarr = qualarr             # <<<<<<<<<<<<<<
 * 
 *     property qual:
*/
  __Pyx_INCREF((PyObject *)__pyx_v_qualarr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_qualarr);
  __Pyx_GOTREF(__pyx_v_self->_qualarr);
  __Pyx_DECREF(__pyx_v_self->_qualarr);
  __pyx_v_self->_qualarr = ((PyObject *)__pyx_v_qualarr);

  /* "HTSeq/_HTSeq.pyx":1274
 *         self._qualstr_phred = b''
 * 
 *     cdef _fill_qual_arr(SequenceWithQualities self):             # <<<<<<<<<<<<<<
 *         cdef int seq_len = len(self.seq)
 *         if self._qualscale == "missing":
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qualarr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities._fill_qual_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qualarr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_qualarr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1298
 * 
 *     property qual:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._qualarr is None:
 *                 self._fill_qual_arr()
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1299
 *     property qual:
 *         def __get__(self):
 *             if self._qualarr is None:             # <<<<<<<<<<<<<<
 *                 self._fill_qual_arr()
 *             return self._qualarr
*/
  __pyx_t_1 = (__pyx_v_self->_qualarr == Py_None);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1300
 *         def __get__(self):
 *             if self._qualarr is None:
 *                 self._fill_qual_arr()             # <<<<<<<<<<<<<<
 *             return self._qualarr
 * 
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":1299
 *     property qual:
 *         def __get__(self):
 *             if self._qualarr is None:             # <<<<<<<<<<<<<<
 *                 self._fill_qual_arr()
 *             return self._qualarr
*/
  }

  /* "HTSeq/_HTSeq.pyx":1301
 *             if self._qualarr is None:
 *                 self._fill_qual_arr()
 *             return self._qualarr             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, newvalue):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_qualarr);
  __pyx_r = __pyx_v_self->_qualarr;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1298
 * 
 *     property qual:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._qualarr is None:
 *                 self._fill_qual_arr()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.qual.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1303
 *             return self._qualarr
 * 
 *         def __set__(self, newvalue):             # <<<<<<<<<<<<<<
 *             if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):
 *                 raise TypeError("qual can only be assigned a numpy array of type numpy.uint8")
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_newvalue); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_newvalue) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), ((PyObject *)__pyx_v_newvalue));

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

static int __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_newvalue) {
  CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "HTSeq/_HTSeq.pyx":1304
 * 
 *         def __set__(self, newvalue):
 *             if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):             # <<<<<<<<<<<<<<
 *                 raise TypeError("qual can only be assigned a numpy array of type numpy.uint8")
 *             if not (newvalue.shape == (len(self.seq), )):
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_newvalue, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray); 
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_newvalue, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "HTSeq/_HTSeq.pyx":1305
 *         def __set__(self, newvalue):
 *             if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):
 *                 raise TypeError("qual can only be assigned a numpy array of type numpy.uint8")             # <<<<<<<<<<<<<<
 *             if not (newvalue.shape == (len(self.seq), )):
 *                 raise TypeError("assignment to qual with illegal shape")
*/
    __pyx_t_5 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_qual_can_only_be_assigned_a_nump};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1305, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1304
 * 
 *         def __set__(self, newvalue):
 *             if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):             # <<<<<<<<<<<<<<
 *                 raise TypeError("qual can only be assigned a numpy array of type numpy.uint8")
 *             if not (newvalue.shape == (len(self.seq), )):
*/
  }

  /* "HTSeq/_HTSeq.pyx":1306
 *             if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):
 *                 raise TypeError("qual can only be assigned a numpy array of type numpy.uint8")
 *             if not (newvalue.shape == (len(self.seq), )):             # <<<<<<<<<<<<<<
 *                 raise TypeError("assignment to qual with illegal shape")
 *             self._qualarr = newvalue
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_newvalue, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_v_self->__pyx_base.seq;
  __Pyx_INCREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1306, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 1306, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = (!__pyx_t_2);
  if (unlikely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":1307
 *                 raise TypeError("qual can only be assigned a numpy array of type numpy.uint8")
 *             if not (newvalue.shape == (len(self.seq), )):
 *                 raise TypeError("assignment to qual with illegal shape")             # <<<<<<<<<<<<<<
 *             self._qualarr = newvalue
 *             self._qualstr = b""
*/
    __pyx_t_3 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_assignment_to_qual_with_illegal};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1307, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1306
 *             if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):
 *                 raise TypeError("qual can only be assigned a numpy array of type numpy.uint8")
 *             if not (newvalue.shape == (len(self.seq), )):             # <<<<<<<<<<<<<<
 *                 raise TypeError("assignment to qual with illegal shape")
 *             self._qualarr = newvalue
*/
  }

  /* "HTSeq/_HTSeq.pyx":1308
 *             if not (newvalue.shape == (len(self.seq), )):
 *                 raise TypeError("assignment to qual with illegal shape")
 *             self._qualarr = newvalue             # <<<<<<<<<<<<<<
 *             self._qualstr = b""
 *             self._qualscale = "none"
*/
  __Pyx_INCREF(__pyx_v_newvalue);
  __Pyx_GIVEREF(__pyx_v_newvalue);
  __Pyx_GOTREF(__pyx_v_self->_qualarr);
  __Pyx_DECREF(__pyx_v_self->_qualarr);
  __pyx_v_self->_qualarr = __pyx_v_newvalue;

  /* "HTSeq/_HTSeq.pyx":1309
 *                 raise TypeError("assignment to qual with illegal shape")
 *             self._qualarr = newvalue
 *             self._qualstr = b""             # <<<<<<<<<<<<<<
 *             self._qualscale = "none"
 *             self._qualstr_phred = b""
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__12);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b__12);
  __Pyx_GOTREF(__pyx_v_self->_qualstr);
  __Pyx_DECREF(__pyx_v_self->_qualstr);
  __pyx_v_self->_qualstr = __pyx_mstate_global->__pyx_kp_b__12;

  /* "HTSeq/_HTSeq.pyx":1310
 *             self._qualarr = newvalue
 *             self._qualstr = b""
 *             self._qualscale = "none"             # <<<<<<<<<<<<<<
 *             self._qualstr_phred = b""
 *             # Experimentally trying to set qualstr when the array is modified
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_none);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_none);
  __Pyx_GOTREF(__pyx_v_self->_qualscale);
  __Pyx_DECREF(__pyx_v_self->_qualscale);
  __pyx_v_self->_qualscale = __pyx_mstate_global->__pyx_n_u_none;

  /* "HTSeq/_HTSeq.pyx":1311
 *             self._qualstr = b""
 *             self._qualscale = "none"
 *             self._qualstr_phred = b""             # <<<<<<<<<<<<<<
 *             # Experimentally trying to set qualstr when the array is modified
 *             # directly
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__12);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b__12);
  __Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
  __Pyx_DECREF(__pyx_v_self->_qualstr_phred);
  __pyx_v_self->_qualstr_phred = __pyx_mstate_global->__pyx_kp_b__12;

  /* "HTSeq/_HTSeq.pyx":1314
 *             # Experimentally trying to set qualstr when the array is modified
 *             # directly
 *             tmp = self.qualstr             # <<<<<<<<<<<<<<
 *             self._qualstr = self._qualstr_phred
 * 
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_qualstr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_tmp = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "HTSeq/_HTSeq.pyx":1315
 *             # directly
 *             tmp = self.qualstr
 *             self._qualstr = self._qualstr_phred             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_5 = __pyx_v_self->_qualstr_phred;
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->_qualstr);
  __Pyx_DECREF(__pyx_v_self->_qualstr);
  __pyx_v_self->_qualstr = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "HTSeq/_HTSeq.pyx":1303
 *             return self._qualarr
 * 
 *         def __set__(self, newvalue):             # <<<<<<<<<<<<<<
 *             if not (isinstance(newvalue, numpy.ndarray) and newvalue.dtype == numpy.uint8):
 *                 raise TypeError("qual can only be assigned a numpy array of type numpy.uint8")
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.qual.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1317
 *             self._qualstr = self._qualstr_phred
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s object '%s'>" % (self.__class__.__name__, self.name)
 * 
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3[5];
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":1318
 * 
 *     def __repr__(self):
 *         return "<%s object '%s'>" % (self.__class__.__name__, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_3[1] = __pyx_t_1;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object;
  __pyx_t_3[3] = __pyx_t_2;
  __pyx_t_3[4] = __pyx_mstate_global->__pyx_kp_u__5;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __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_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1317
 *             self._qualstr = self._qualstr_phred
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s object '%s'>" % (self.__class__.__name__, self.name)
 * 
*/

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

/* "HTSeq/_HTSeq.pyx":1320
 *         return "<%s object '%s'>" % (self.__class__.__name__, self.name)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         if self.name.endswith("[part]"):
 *             new_name = self.name
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4__getitem__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), ((PyObject *)__pyx_v_item));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_4__getitem__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_new_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "HTSeq/_HTSeq.pyx":1321
 * 
 *     def __getitem__(self, item):
 *         if self.name.endswith("[part]"):             # <<<<<<<<<<<<<<
 *             new_name = self.name
 *         else:
*/
  if (unlikely(__pyx_v_self->__pyx_base.name == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "endswith");
    __PYX_ERR(0, 1321, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_self->__pyx_base.name, __pyx_mstate_global->__pyx_kp_u_part, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1321, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1322
 *     def __getitem__(self, item):
 *         if self.name.endswith("[part]"):
 *             new_name = self.name             # <<<<<<<<<<<<<<
 *         else:
 *             new_name = self.name + "[part]"
*/
    __pyx_t_2 = __pyx_v_self->__pyx_base.name;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_new_name = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":1321
 * 
 *     def __getitem__(self, item):
 *         if self.name.endswith("[part]"):             # <<<<<<<<<<<<<<
 *             new_name = self.name
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1324
 *             new_name = self.name
 *         else:
 *             new_name = self.name + "[part]"             # <<<<<<<<<<<<<<
 *         return SequenceWithQualities(
 *             self.seq[item], new_name, self.qualstr[item])
*/
  /*else*/ {
    __pyx_t_2 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_self->__pyx_base.name, __pyx_mstate_global->__pyx_kp_u_part); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_new_name = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1325
 *         else:
 *             new_name = self.name + "[part]"
 *         return SequenceWithQualities(             # <<<<<<<<<<<<<<
 *             self.seq[item], new_name, self.qualstr[item])
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;

  /* "HTSeq/_HTSeq.pyx":1326
 *             new_name = self.name + "[part]"
 *         return SequenceWithQualities(
 *             self.seq[item], new_name, self.qualstr[item])             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.seq, __pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_qualstr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_4, __pyx_v_new_name, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1320
 *         return "<%s object '%s'>" % (self.__class__.__name__, self.name)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         if self.name.endswith("[part]"):
 *             new_name = self.name
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1328
 *             self.seq[item], new_name, self.qualstr[item])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def qualstr(self):
 *         cdef int seqlen
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
  int __pyx_v_seqlen;
  char *__pyx_v_qualstr_phred_cstr;
  int __pyx_v_i;
  PyArrayObject *__pyx_v_qual_array = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_qual_array;
  __Pyx_Buffer __pyx_pybuffer_qual_array;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __pyx_pybuffer_qual_array.pybuffer.buf = NULL;
  __pyx_pybuffer_qual_array.refcount = 0;
  __pyx_pybuffernd_qual_array.data = NULL;
  __pyx_pybuffernd_qual_array.rcbuffer = &__pyx_pybuffer_qual_array;

  /* "HTSeq/_HTSeq.pyx":1331
 *     def qualstr(self):
 *         cdef int seqlen
 *         cdef char * qualstr_phred_cstr = self._qualstr_phred             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array
*/
  if (unlikely(__pyx_v_self->_qualstr_phred == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1331, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_qualstr_phred); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1331, __pyx_L1_error)
  __pyx_v_qualstr_phred_cstr = __pyx_t_1;

  /* "HTSeq/_HTSeq.pyx":1334
 *         cdef int i
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array
 *         if qualstr_phred_cstr[0] == 0:             # <<<<<<<<<<<<<<
 *             if self._qualscale == "noquals":
 *                 raise ValueError("Quality string missing")
*/
  __pyx_t_2 = ((__pyx_v_qualstr_phred_cstr[0]) == 0);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":1335
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array
 *         if qualstr_phred_cstr[0] == 0:
 *             if self._qualscale == "noquals":             # <<<<<<<<<<<<<<
 *                 raise ValueError("Quality string missing")
 *             if self._qualscale == "phred":
*/
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_mstate_global->__pyx_n_u_noquals, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1335, __pyx_L1_error)
    if (unlikely(__pyx_t_2)) {

      /* "HTSeq/_HTSeq.pyx":1336
 *         if qualstr_phred_cstr[0] == 0:
 *             if self._qualscale == "noquals":
 *                 raise ValueError("Quality string missing")             # <<<<<<<<<<<<<<
 *             if self._qualscale == "phred":
 *                 self._qualstr_phred = self._qualstr
*/
      __pyx_t_4 = NULL;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Quality_string_missing_2};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1336, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1336, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":1335
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array
 *         if qualstr_phred_cstr[0] == 0:
 *             if self._qualscale == "noquals":             # <<<<<<<<<<<<<<
 *                 raise ValueError("Quality string missing")
 *             if self._qualscale == "phred":
*/
    }

    /* "HTSeq/_HTSeq.pyx":1337
 *             if self._qualscale == "noquals":
 *                 raise ValueError("Quality string missing")
 *             if self._qualscale == "phred":             # <<<<<<<<<<<<<<
 *                 self._qualstr_phred = self._qualstr
 *             else:
*/
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_qualscale, __pyx_mstate_global->__pyx_n_u_phred, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1337, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "HTSeq/_HTSeq.pyx":1338
 *                 raise ValueError("Quality string missing")
 *             if self._qualscale == "phred":
 *                 self._qualstr_phred = self._qualstr             # <<<<<<<<<<<<<<
 *             else:
 *                 seqlen = len(self.seq)
*/
      __pyx_t_3 = __pyx_v_self->_qualstr;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
      __Pyx_DECREF(__pyx_v_self->_qualstr_phred);
      __pyx_v_self->_qualstr_phred = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1337
 *             if self._qualscale == "noquals":
 *                 raise ValueError("Quality string missing")
 *             if self._qualscale == "phred":             # <<<<<<<<<<<<<<
 *                 self._qualstr_phred = self._qualstr
 *             else:
*/
      goto __pyx_L5;
    }

    /* "HTSeq/_HTSeq.pyx":1340
 *                 self._qualstr_phred = self._qualstr
 *             else:
 *                 seqlen = len(self.seq)             # <<<<<<<<<<<<<<
 *                 # FIXME: is this fixed now?
 *                 self._qualstr_phred = b' ' * seqlen
*/
    /*else*/ {
      __pyx_t_3 = __pyx_v_self->__pyx_base.seq;
      __Pyx_INCREF(__pyx_t_3);
      if (unlikely(__pyx_t_3 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 1340, __pyx_L1_error)
      }
      __pyx_t_6 = __Pyx_PyBytes_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1340, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_seqlen = __pyx_t_6;

      /* "HTSeq/_HTSeq.pyx":1342
 *                 seqlen = len(self.seq)
 *                 # FIXME: is this fixed now?
 *                 self._qualstr_phred = b' ' * seqlen             # <<<<<<<<<<<<<<
 *                 qualstr_phred_cstr = self._qualstr_phred
 *                 if self._qualarr is None:
*/
      __pyx_t_3 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_kp_b__23, __pyx_v_seqlen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_qualstr_phred);
      __Pyx_DECREF(__pyx_v_self->_qualstr_phred);
      __pyx_v_self->_qualstr_phred = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1343
 *                 # FIXME: is this fixed now?
 *                 self._qualstr_phred = b' ' * seqlen
 *                 qualstr_phred_cstr = self._qualstr_phred             # <<<<<<<<<<<<<<
 *                 if self._qualarr is None:
 *                     self._fill_qual_arr()
*/
      if (unlikely(__pyx_v_self->_qualstr_phred == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
        __PYX_ERR(0, 1343, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_qualstr_phred); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L1_error)
      __pyx_v_qualstr_phred_cstr = __pyx_t_1;

      /* "HTSeq/_HTSeq.pyx":1344
 *                 self._qualstr_phred = b' ' * seqlen
 *                 qualstr_phred_cstr = self._qualstr_phred
 *                 if self._qualarr is None:             # <<<<<<<<<<<<<<
 *                     self._fill_qual_arr()
 *                 qual_array = self._qualarr
*/
      __pyx_t_2 = (__pyx_v_self->_qualarr == Py_None);
      if (__pyx_t_2) {

        /* "HTSeq/_HTSeq.pyx":1345
 *                 qualstr_phred_cstr = self._qualstr_phred
 *                 if self._qualarr is None:
 *                     self._fill_qual_arr()             # <<<<<<<<<<<<<<
 *                 qual_array = self._qualarr
 *                 for i in range(seqlen):
*/
        __pyx_t_3 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1345, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "HTSeq/_HTSeq.pyx":1344
 *                 self._qualstr_phred = b' ' * seqlen
 *                 qualstr_phred_cstr = self._qualstr_phred
 *                 if self._qualarr is None:             # <<<<<<<<<<<<<<
 *                     self._fill_qual_arr()
 *                 qual_array = self._qualarr
*/
      }

      /* "HTSeq/_HTSeq.pyx":1346
 *                 if self._qualarr is None:
 *                     self._fill_qual_arr()
 *                 qual_array = self._qualarr             # <<<<<<<<<<<<<<
 *                 for i in range(seqlen):
 *                     qualstr_phred_cstr[i] = 33 + qual_array[i]
*/
      __pyx_t_3 = __pyx_v_self->_qualarr;
      __Pyx_INCREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1346, __pyx_L1_error)
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
        __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_7 < 0)) {
          PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_qual_array, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          }
          __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
        }
        __pyx_pybuffernd_qual_array.diminfo[0].strides = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qual_array.diminfo[0].shape = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.shape[0];
        if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1346, __pyx_L1_error)
      }
      __pyx_v_qual_array = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1347
 *                     self._fill_qual_arr()
 *                 qual_array = self._qualarr
 *                 for i in range(seqlen):             # <<<<<<<<<<<<<<
 *                     qualstr_phred_cstr[i] = 33 + qual_array[i]
 *         return self._qualstr_phred
*/
      __pyx_t_7 = __pyx_v_seqlen;
      __pyx_t_11 = __pyx_t_7;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;

        /* "HTSeq/_HTSeq.pyx":1348
 *                 qual_array = self._qualarr
 *                 for i in range(seqlen):
 *                     qualstr_phred_cstr[i] = 33 + qual_array[i]             # <<<<<<<<<<<<<<
 *         return self._qualstr_phred
 * 
*/
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = -1;
        if (__pyx_t_13 < 0) {
          __pyx_t_13 += __pyx_pybuffernd_qual_array.diminfo[0].shape;
          if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
        } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_qual_array.diminfo[0].shape)) __pyx_t_14 = 0;
        if (unlikely(__pyx_t_14 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_14);
          __PYX_ERR(0, 1348, __pyx_L1_error)
        }
        (__pyx_v_qualstr_phred_cstr[__pyx_v_i]) = (33 + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_qual_array.diminfo[0].strides)));
      }
    }
    __pyx_L5:;

    /* "HTSeq/_HTSeq.pyx":1334
 *         cdef int i
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array
 *         if qualstr_phred_cstr[0] == 0:             # <<<<<<<<<<<<<<
 *             if self._qualscale == "noquals":
 *                 raise ValueError("Quality string missing")
*/
  }

  /* "HTSeq/_HTSeq.pyx":1349
 *                 for i in range(seqlen):
 *                     qualstr_phred_cstr[i] = 33 + qual_array[i]
 *         return self._qualstr_phred             # <<<<<<<<<<<<<<
 * 
 *     def write_to_fastq_file(self, fastq_file):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_qualstr_phred);
  __pyx_r = __pyx_v_self->_qualstr_phred;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1328
 *             self.seq[item], new_name, self.qualstr[item])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def qualstr(self):
 *         cdef int seqlen
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.qualstr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_qual_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1351
 *         return self._qualstr_phred
 * 
 *     def write_to_fastq_file(self, fastq_file):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "descr") and self.descr is not None:
 *             fastq_file.write("@%s %s\n" % (self.name, self.descr))
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file(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_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file = {"write_to_fastq_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_fastq_file = 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("write_to_fastq_file (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_fastq_file,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, 1351, __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, 1351, __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, "write_to_fastq_file", 0) < (0)) __PYX_ERR(0, 1351, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_to_fastq_file", 1, 1, 1, i); __PYX_ERR(0, 1351, __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, 1351, __pyx_L3_error)
    }
    __pyx_v_fastq_file = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_to_fastq_file", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1351, __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("HTSeq._HTSeq.SequenceWithQualities.write_to_fastq_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_6write_to_fastq_file(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_fastq_file);

  /* 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_5HTSeq_6_HTSeq_21SequenceWithQualities_6write_to_fastq_file(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyObject *__pyx_v_fastq_file) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[5];
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_to_fastq_file", 0);

  /* "HTSeq/_HTSeq.pyx":1352
 * 
 *     def write_to_fastq_file(self, fastq_file):
 *         if hasattr(self, "descr") and self.descr is not None:             # <<<<<<<<<<<<<<
 *             fastq_file.write("@%s %s\n" % (self.name, self.descr))
 *         else:
*/
  __pyx_t_2 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_descr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1352, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->__pyx_base.descr != ((PyObject*)Py_None));
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1353
 *     def write_to_fastq_file(self, fastq_file):
 *         if hasattr(self, "descr") and self.descr is not None:
 *             fastq_file.write("@%s %s\n" % (self.name, self.descr))             # <<<<<<<<<<<<<<
 *         else:
 *             fastq_file.write("@%s\n" % self.name)
*/
    __pyx_t_4 = __pyx_v_fastq_file;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.descr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u__24;
    __pyx_t_7[1] = __pyx_t_5;
    __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__23;
    __pyx_t_7[3] = __pyx_t_6;
    __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u__20;
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 1 * 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":1352
 * 
 *     def write_to_fastq_file(self, fastq_file):
 *         if hasattr(self, "descr") and self.descr is not None:             # <<<<<<<<<<<<<<
 *             fastq_file.write("@%s %s\n" % (self.name, self.descr))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1355
 *             fastq_file.write("@%s %s\n" % (self.name, self.descr))
 *         else:
 *             fastq_file.write("@%s\n" % self.name)             # <<<<<<<<<<<<<<
 *         fastq_file.write(self.seq.decode() + "\n")
 *         fastq_file.write("+\n")
*/
  /*else*/ {
    __pyx_t_8 = __pyx_v_fastq_file;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_4 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_s_2, __pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1355, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1356
 *         else:
 *             fastq_file.write("@%s\n" % self.name)
 *         fastq_file.write(self.seq.decode() + "\n")             # <<<<<<<<<<<<<<
 *         fastq_file.write("+\n")
 *         fastq_file.write(self.qualstr.decode() + "\n")
*/
  __pyx_t_4 = __pyx_v_fastq_file;
  __Pyx_INCREF(__pyx_t_4);
  if (unlikely(__pyx_v_self->__pyx_base.seq == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
    __PYX_ERR(0, 1356, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_decode_bytes(__pyx_v_self->__pyx_base.seq, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u__20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "HTSeq/_HTSeq.pyx":1357
 *             fastq_file.write("@%s\n" % self.name)
 *         fastq_file.write(self.seq.decode() + "\n")
 *         fastq_file.write("+\n")             # <<<<<<<<<<<<<<
 *         fastq_file.write(self.qualstr.decode() + "\n")
 * 
*/
  __pyx_t_6 = __pyx_v_fastq_file;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__25};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "HTSeq/_HTSeq.pyx":1358
 *         fastq_file.write(self.seq.decode() + "\n")
 *         fastq_file.write("+\n")
 *         fastq_file.write(self.qualstr.decode() + "\n")             # <<<<<<<<<<<<<<
 * 
 *     def get_fastq_str(self, bint convert_to_phred=False):
*/
  __pyx_t_6 = __pyx_v_fastq_file;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_qualstr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u__20); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __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_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "HTSeq/_HTSeq.pyx":1351
 *         return self._qualstr_phred
 * 
 *     def write_to_fastq_file(self, fastq_file):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "descr") and self.descr is not None:
 *             fastq_file.write("@%s %s\n" % (self.name, self.descr))
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.write_to_fastq_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1360
 *         fastq_file.write(self.qualstr.decode() + "\n")
 * 
 *     def get_fastq_str(self, bint convert_to_phred=False):             # <<<<<<<<<<<<<<
 *         sio = cStringIO.StringIO()
 *         self.write_to_fastq_file(sio, convert_to_phred)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str(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_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str = {"get_fastq_str", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str(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
) {
  int __pyx_v_convert_to_phred;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fastq_str (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_convert_to_phred,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, 1360, __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, 1360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_fastq_str", 0) < (0)) __PYX_ERR(0, 1360, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_convert_to_phred = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_convert_to_phred == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L3_error)
    } else {
      __pyx_v_convert_to_phred = ((int)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_fastq_str", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1360, __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("HTSeq._HTSeq.SequenceWithQualities.get_fastq_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8get_fastq_str(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_convert_to_phred);

  /* 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_5HTSeq_6_HTSeq_21SequenceWithQualities_8get_fastq_str(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_v_convert_to_phred) {
  PyObject *__pyx_v_sio = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_fastq_str", 0);

  /* "HTSeq/_HTSeq.pyx":1361
 * 
 *     def get_fastq_str(self, bint convert_to_phred=False):
 *         sio = cStringIO.StringIO()             # <<<<<<<<<<<<<<
 *         self.write_to_fastq_file(sio, convert_to_phred)
 *         return sio.getvalue()
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cStringIO); 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_StringIO); 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_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __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_2); __pyx_t_2 = 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_sio = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1362
 *     def get_fastq_str(self, bint convert_to_phred=False):
 *         sio = cStringIO.StringIO()
 *         self.write_to_fastq_file(sio, convert_to_phred)             # <<<<<<<<<<<<<<
 *         return sio.getvalue()
 * 
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_convert_to_phred); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_sio, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write_to_fastq_file, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1363
 *         sio = cStringIO.StringIO()
 *         self.write_to_fastq_file(sio, convert_to_phred)
 *         return sio.getvalue()             # <<<<<<<<<<<<<<
 * 
 *     cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_v_sio;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getvalue, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1360
 *         fastq_file.write(self.qualstr.decode() + "\n")
 * 
 *     def get_fastq_str(self, bint convert_to_phred=False):             # <<<<<<<<<<<<<<
 *         sio = cStringIO.StringIO()
 *         self.write_to_fastq_file(sio, convert_to_phred)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.get_fastq_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sio);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1365
 *         return sio.getvalue()
 * 
 *     cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):             # <<<<<<<<<<<<<<
 *         cdef SequenceWithQualities res
 *         if rename:
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement(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*/
struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args) {
  int __pyx_v_rename = ((int)1);
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_res = 0;
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_reverse_complement", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_rename = __pyx_optional_args->rename;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_get_reverse_complement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_rename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 1365, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":1367
 *     cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):
 *         cdef SequenceWithQualities res
 *         if rename:             # <<<<<<<<<<<<<<
 *             res = SequenceWithQualities(
 *                 reverse_complement(self.seq),
*/
  if (__pyx_v_rename) {

    /* "HTSeq/_HTSeq.pyx":1368
 *         cdef SequenceWithQualities res
 *         if rename:
 *             res = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 reverse_complement(self.seq),
 *                 "revcomp_of_" + self.name,
*/
    __pyx_t_2 = NULL;

    /* "HTSeq/_HTSeq.pyx":1369
 *         if rename:
 *             res = SequenceWithQualities(
 *                 reverse_complement(self.seq),             # <<<<<<<<<<<<<<
 *                 "revcomp_of_" + self.name,
 *                 self._qualstr[::-1],
*/
    __pyx_t_4 = __pyx_v_self->__pyx_base.seq;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_4), 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":1370
 *             res = SequenceWithQualities(
 *                 reverse_complement(self.seq),
 *                 "revcomp_of_" + self.name,             # <<<<<<<<<<<<<<
 *                 self._qualstr[::-1],
 *                 self._qualscale)
*/
    __pyx_t_4 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_n_u_revcomp_of, __pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "HTSeq/_HTSeq.pyx":1371
 *                 reverse_complement(self.seq),
 *                 "revcomp_of_" + self.name,
 *                 self._qualstr[::-1],             # <<<<<<<<<<<<<<
 *                 self._qualscale)
 *         else:
*/
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_self->_qualstr, __pyx_mstate_global->__pyx_slice[1]); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "HTSeq/_HTSeq.pyx":1372
 *                 "revcomp_of_" + self.name,
 *                 self._qualstr[::-1],
 *                 self._qualscale)             # <<<<<<<<<<<<<<
 *         else:
 *             res = SequenceWithQualities(
*/
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_t_5, __pyx_t_4, __pyx_t_3, __pyx_v_self->_qualscale};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __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, 1368, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_res = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1367
 *     cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):
 *         cdef SequenceWithQualities res
 *         if rename:             # <<<<<<<<<<<<<<
 *             res = SequenceWithQualities(
 *                 reverse_complement(self.seq),
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1374
 *                 self._qualscale)
 *         else:
 *             res = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 reverse_complement(self.seq),
 *                 self.name,
*/
  /*else*/ {
    __pyx_t_3 = NULL;

    /* "HTSeq/_HTSeq.pyx":1375
 *         else:
 *             res = SequenceWithQualities(
 *                 reverse_complement(self.seq),             # <<<<<<<<<<<<<<
 *                 self.name,
 *                 self._qualstr[::-1],
*/
    __pyx_t_4 = __pyx_v_self->__pyx_base.seq;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = __pyx_f_5HTSeq_6_HTSeq_reverse_complement(((PyObject*)__pyx_t_4), 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":1377
 *                 reverse_complement(self.seq),
 *                 self.name,
 *                 self._qualstr[::-1],             # <<<<<<<<<<<<<<
 *                 self._qualscale)
 *         if self._qualarr is not None:
*/
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_qualstr, __pyx_mstate_global->__pyx_slice[1]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "HTSeq/_HTSeq.pyx":1378
 *                 self.name,
 *                 self._qualstr[::-1],
 *                 self._qualscale)             # <<<<<<<<<<<<<<
 *         if self._qualarr is not None:
 *             res._qualarr = self._qualarr[::-1]
*/
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_t_5, __pyx_v_self->__pyx_base.name, __pyx_t_4, __pyx_v_self->_qualscale};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_res = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1379
 *                 self._qualstr[::-1],
 *                 self._qualscale)
 *         if self._qualarr is not None:             # <<<<<<<<<<<<<<
 *             res._qualarr = self._qualarr[::-1]
 *         return res
*/
  __pyx_t_7 = (__pyx_v_self->_qualarr != Py_None);
  if (__pyx_t_7) {

    /* "HTSeq/_HTSeq.pyx":1380
 *                 self._qualscale)
 *         if self._qualarr is not None:
 *             res._qualarr = self._qualarr[::-1]             # <<<<<<<<<<<<<<
 *         return res
 * 
*/
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->_qualarr, __pyx_mstate_global->__pyx_slice[1]); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_res->_qualarr);
    __Pyx_DECREF(__pyx_v_res->_qualarr);
    __pyx_v_res->_qualarr = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1379
 *                 self._qualstr[::-1],
 *                 self._qualscale)
 *         if self._qualarr is not None:             # <<<<<<<<<<<<<<
 *             res._qualarr = self._qualarr[::-1]
 *         return res
*/
  }

  /* "HTSeq/_HTSeq.pyx":1381
 *         if self._qualarr is not None:
 *             res._qualarr = self._qualarr[::-1]
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     cpdef object add_qual_to_count_array(SequenceWithQualities self,
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1365
 *         return sio.getvalue()
 * 
 *     cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):             # <<<<<<<<<<<<<<
 *         cdef SequenceWithQualities res
 *         if rename:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement(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_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement = {"get_reverse_complement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement(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
) {
  int __pyx_v_rename;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_reverse_complement (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_rename,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, 1365, __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, 1365, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_reverse_complement", 0) < (0)) __PYX_ERR(0, 1365, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1365, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_rename = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_rename == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1365, __pyx_L3_error)
    } else {
      __pyx_v_rename = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_reverse_complement", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1365, __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("HTSeq._HTSeq.SequenceWithQualities.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10get_reverse_complement(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_rename);

  /* 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_5HTSeq_6_HTSeq_21SequenceWithQualities_10get_reverse_complement(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_v_rename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_reverse_complement", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.rename = __pyx_v_rename;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities->get_reverse_complement(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.get_reverse_complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement__pyx_wrap_1(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args) {
  return __pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement(__pyx_v_self, __pyx_skip_dispatch, __pyx_optional_args);
}

/* "HTSeq/_HTSeq.pyx":1383
 *         return res
 * 
 *     cpdef object add_qual_to_count_array(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *                                          numpy.ndarray count_array_):
 * 
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_add_qual_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyArrayObject *__pyx_v_count_array_, int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_v_count_array = 0;
  PyArrayObject *__pyx_v_qual_array = 0;
  npy_intp __pyx_v_seq_length;
  npy_intp __pyx_v_qual_size;
  npy_intp __pyx_v_i;
  npy_int __pyx_v_q;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_count_array;
  __Pyx_Buffer __pyx_pybuffer_count_array;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_qual_array;
  __Pyx_Buffer __pyx_pybuffer_qual_array;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  npy_intp __pyx_t_7;
  npy_intp __pyx_t_8;
  npy_intp __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_qual_to_count_array", 0);
  __pyx_pybuffer_count_array.pybuffer.buf = NULL;
  __pyx_pybuffer_count_array.refcount = 0;
  __pyx_pybuffernd_count_array.data = NULL;
  __pyx_pybuffernd_count_array.rcbuffer = &__pyx_pybuffer_count_array;
  __pyx_pybuffer_qual_array.pybuffer.buf = NULL;
  __pyx_pybuffer_qual_array.refcount = 0;
  __pyx_pybuffernd_qual_array.data = NULL;
  __pyx_pybuffernd_qual_array.rcbuffer = &__pyx_pybuffer_qual_array;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_add_qual_to_count_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_count_array_)};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":1386
 *                                          numpy.ndarray count_array_):
 * 
 *         cdef numpy.ndarray[numpy.int64_t, ndim = 2] count_array = count_array_             # <<<<<<<<<<<<<<
 *         if self._qualarr is None:
 *             self._fill_qual_arr()
*/
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_count_array_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_count_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 1386, __pyx_L1_error)
    } else {__pyx_pybuffernd_count_array.diminfo[0].strides = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_count_array.diminfo[0].shape = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_count_array.diminfo[1].strides = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_count_array.diminfo[1].shape = __pyx_pybuffernd_count_array.rcbuffer->pybuffer.shape[1];
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_count_array_);
  __pyx_v_count_array = ((PyArrayObject *)__pyx_v_count_array_);

  /* "HTSeq/_HTSeq.pyx":1387
 * 
 *         cdef numpy.ndarray[numpy.int64_t, ndim = 2] count_array = count_array_
 *         if self._qualarr is None:             # <<<<<<<<<<<<<<
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
  __pyx_t_6 = (__pyx_v_self->_qualarr == Py_None);
  if (__pyx_t_6) {

    /* "HTSeq/_HTSeq.pyx":1388
 *         cdef numpy.ndarray[numpy.int64_t, ndim = 2] count_array = count_array_
 *         if self._qualarr is None:
 *             self._fill_qual_arr()             # <<<<<<<<<<<<<<
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1387
 * 
 *         cdef numpy.ndarray[numpy.int64_t, ndim = 2] count_array = count_array_
 *         if self._qualarr is None:             # <<<<<<<<<<<<<<
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
  }

  /* "HTSeq/_HTSeq.pyx":1389
 *         if self._qualarr is None:
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr             # <<<<<<<<<<<<<<
 * 
 *         cdef numpy.npy_intp seq_length = numpy.PyArray_DIMS(qual_array)[0]
*/
  __pyx_t_1 = __pyx_v_self->_qualarr;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1389, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_qual_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 1389, __pyx_L1_error)
    } else {__pyx_pybuffernd_qual_array.diminfo[0].strides = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qual_array.diminfo[0].shape = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_qual_array = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1391
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
 * 
 *         cdef numpy.npy_intp seq_length = numpy.PyArray_DIMS(qual_array)[0]             # <<<<<<<<<<<<<<
 *         cdef numpy.npy_intp qual_size = numpy.PyArray_DIMS(count_array)[1]
 * 
*/
  __pyx_v_seq_length = (PyArray_DIMS(((PyArrayObject *)__pyx_v_qual_array))[0]);

  /* "HTSeq/_HTSeq.pyx":1392
 * 
 *         cdef numpy.npy_intp seq_length = numpy.PyArray_DIMS(qual_array)[0]
 *         cdef numpy.npy_intp qual_size = numpy.PyArray_DIMS(count_array)[1]             # <<<<<<<<<<<<<<
 * 
 *         if seq_length > numpy.PyArray_DIMS(count_array)[0]:
*/
  __pyx_v_qual_size = (PyArray_DIMS(((PyArrayObject *)__pyx_v_count_array))[1]);

  /* "HTSeq/_HTSeq.pyx":1394
 *         cdef numpy.npy_intp qual_size = numpy.PyArray_DIMS(count_array)[1]
 * 
 *         if seq_length > numpy.PyArray_DIMS(count_array)[0]:             # <<<<<<<<<<<<<<
 *             raise ValueError("'count_array' too small for sequence.")
 * 
*/
  __pyx_t_6 = (__pyx_v_seq_length > (PyArray_DIMS(((PyArrayObject *)__pyx_v_count_array))[0]));
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":1395
 * 
 *         if seq_length > numpy.PyArray_DIMS(count_array)[0]:
 *             raise ValueError("'count_array' too small for sequence.")             # <<<<<<<<<<<<<<
 * 
 *         cdef numpy.npy_intp i
*/
    __pyx_t_2 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_count_array_too_small_for_seque};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __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, 1395, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1394
 *         cdef numpy.npy_intp qual_size = numpy.PyArray_DIMS(count_array)[1]
 * 
 *         if seq_length > numpy.PyArray_DIMS(count_array)[0]:             # <<<<<<<<<<<<<<
 *             raise ValueError("'count_array' too small for sequence.")
 * 
*/
  }

  /* "HTSeq/_HTSeq.pyx":1399
 *         cdef numpy.npy_intp i
 *         cdef numpy.npy_int q
 *         for i in range(seq_length):             # <<<<<<<<<<<<<<
 *             q = qual_array[i]
 *             if(q >= qual_size):
*/
  __pyx_t_7 = __pyx_v_seq_length;
  __pyx_t_8 = __pyx_t_7;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "HTSeq/_HTSeq.pyx":1400
 *         cdef numpy.npy_int q
 *         for i in range(seq_length):
 *             q = qual_array[i]             # <<<<<<<<<<<<<<
 *             if(q >= qual_size):
 *                 raise ValueError("Too large quality value encountered.")
*/
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_11 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_pybuffernd_qual_array.diminfo[0].shape;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_qual_array.diminfo[0].shape)) __pyx_t_11 = 0;
    if (unlikely(__pyx_t_11 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_11);
      __PYX_ERR(0, 1400, __pyx_L1_error)
    }
    __pyx_v_q = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_qual_array.diminfo[0].strides));

    /* "HTSeq/_HTSeq.pyx":1401
 *         for i in range(seq_length):
 *             q = qual_array[i]
 *             if(q >= qual_size):             # <<<<<<<<<<<<<<
 *                 raise ValueError("Too large quality value encountered.")
 *             count_array[i, q] += 1
*/
    __pyx_t_6 = (__pyx_v_q >= __pyx_v_qual_size);
    if (unlikely(__pyx_t_6)) {

      /* "HTSeq/_HTSeq.pyx":1402
 *             q = qual_array[i]
 *             if(q >= qual_size):
 *                 raise ValueError("Too large quality value encountered.")             # <<<<<<<<<<<<<<
 *             count_array[i, q] += 1
 * 
*/
      __pyx_t_2 = NULL;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Too_large_quality_value_encounte};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __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, 1402, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":1401
 *         for i in range(seq_length):
 *             q = qual_array[i]
 *             if(q >= qual_size):             # <<<<<<<<<<<<<<
 *                 raise ValueError("Too large quality value encountered.")
 *             count_array[i, q] += 1
*/
    }

    /* "HTSeq/_HTSeq.pyx":1403
 *             if(q >= qual_size):
 *                 raise ValueError("Too large quality value encountered.")
 *             count_array[i, q] += 1             # <<<<<<<<<<<<<<
 * 
 *         return None
*/
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_12 = __pyx_v_q;
    __pyx_t_11 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_pybuffernd_count_array.diminfo[0].shape;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_count_array.diminfo[0].shape)) __pyx_t_11 = 0;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_pybuffernd_count_array.diminfo[1].shape;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 1;
    } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_count_array.diminfo[1].shape)) __pyx_t_11 = 1;
    if (unlikely(__pyx_t_11 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_11);
      __PYX_ERR(0, 1403, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_count_array.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_count_array.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_count_array.diminfo[1].strides) += 1;
  }

  /* "HTSeq/_HTSeq.pyx":1405
 *             count_array[i, q] += 1
 * 
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1383
 *         return res
 * 
 *     cpdef object add_qual_to_count_array(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *                                          numpy.ndarray count_array_):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.add_qual_to_count_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_count_array.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_count_array);
  __Pyx_XDECREF((PyObject *)__pyx_v_qual_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array(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_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array = {"add_qual_to_count_array", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array(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
) {
  PyArrayObject *__pyx_v_count_array_ = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_qual_to_count_array (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_count_array,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, 1383, __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, 1383, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_qual_to_count_array", 0) < (0)) __PYX_ERR(0, 1383, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_qual_to_count_array", 1, 1, 1, i); __PYX_ERR(0, 1383, __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, 1383, __pyx_L3_error)
    }
    __pyx_v_count_array_ = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_qual_to_count_array", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1383, __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("HTSeq._HTSeq.SequenceWithQualities.add_qual_to_count_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count_array_), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "count_array_", 0))) __PYX_ERR(0, 1384, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_12add_qual_to_count_array(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_count_array_);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_12add_qual_to_count_array(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, PyArrayObject *__pyx_v_count_array_) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_qual_to_count_array", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_add_qual_to_count_array(__pyx_v_self, __pyx_v_count_array_, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.add_qual_to_count_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1407
 *         return None
 * 
 *     cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *                                                          Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals(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 struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals *__pyx_optional_args) {
  int __pyx_v_max_mm_qual = ((int)5);
  int __pyx_v_seqlen;
  int __pyx_v_patlen;
  int __pyx_v_minlen;
  char *__pyx_v_seq_cstr;
  char *__pyx_v_pat_cstr;
  int __pyx_v_match;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_sum_mm_qual;
  PyArrayObject *__pyx_v_qual_array = 0;
  CYTHON_UNUSED long __pyx_v_num_mismatches;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_qual_array;
  __Pyx_Buffer __pyx_pybuffer_qual_array;
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__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;
  char *__pyx_t_9;
  long __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trim_left_end_with_quals", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_max_mm_qual = __pyx_optional_args->max_mm_qual;
    }
  }
  __pyx_pybuffer_qual_array.pybuffer.buf = NULL;
  __pyx_pybuffer_qual_array.refcount = 0;
  __pyx_pybuffernd_qual_array.data = NULL;
  __pyx_pybuffernd_qual_array.rcbuffer = &__pyx_pybuffer_qual_array;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_trim_left_end_with_quals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_max_mm_qual); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1407, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_pattern), __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 1407, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":1409
 *     cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,
 *                                                          Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)             # <<<<<<<<<<<<<<
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
*/
  __pyx_t_1 = __pyx_v_self->__pyx_base.seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1409, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seqlen = __pyx_t_7;

  /* "HTSeq/_HTSeq.pyx":1410
 *                                                          Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)             # <<<<<<<<<<<<<<
 *         cdef int minlen
 *         if seqlen < patlen:
*/
  __pyx_t_1 = __pyx_v_pattern->seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1410, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_patlen = __pyx_t_7;

  /* "HTSeq/_HTSeq.pyx":1412
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
*/
  __pyx_t_8 = (__pyx_v_seqlen < __pyx_v_patlen);
  if (__pyx_t_8) {

    /* "HTSeq/_HTSeq.pyx":1413
 *         cdef int minlen
 *         if seqlen < patlen:
 *             minlen = seqlen             # <<<<<<<<<<<<<<
 *         else:
 *             minlen = patlen
*/
    __pyx_v_minlen = __pyx_v_seqlen;

    /* "HTSeq/_HTSeq.pyx":1412
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1415
 *             minlen = seqlen
 *         else:
 *             minlen = patlen             # <<<<<<<<<<<<<<
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq
*/
  /*else*/ {
    __pyx_v_minlen = __pyx_v_patlen;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1416
 *         else:
 *             minlen = patlen
 *         cdef char * seq_cstr = self.seq             # <<<<<<<<<<<<<<
 *         cdef char * pat_cstr = pattern.seq
 *         cdef int match = 0
*/
  if (unlikely(__pyx_v_self->__pyx_base.seq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1416, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->__pyx_base.seq); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 1416, __pyx_L1_error)
  __pyx_v_seq_cstr = __pyx_t_9;

  /* "HTSeq/_HTSeq.pyx":1417
 *             minlen = patlen
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq             # <<<<<<<<<<<<<<
 *         cdef int match = 0
 *         cdef int i, j
*/
  if (unlikely(__pyx_v_pattern->seq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1417, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 1417, __pyx_L1_error)
  __pyx_v_pat_cstr = __pyx_t_9;

  /* "HTSeq/_HTSeq.pyx":1418
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq
 *         cdef int match = 0             # <<<<<<<<<<<<<<
 *         cdef int i, j
 *         cdef int sum_mm_qual
*/
  __pyx_v_match = 0;

  /* "HTSeq/_HTSeq.pyx":1421
 *         cdef int i, j
 *         cdef int sum_mm_qual
 *         if self._qualarr is None:             # <<<<<<<<<<<<<<
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
  __pyx_t_8 = (__pyx_v_self->_qualarr == Py_None);
  if (__pyx_t_8) {

    /* "HTSeq/_HTSeq.pyx":1422
 *         cdef int sum_mm_qual
 *         if self._qualarr is None:
 *             self._fill_qual_arr()             # <<<<<<<<<<<<<<
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
 *         for i in range(1, minlen + 1):
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1421
 *         cdef int i, j
 *         cdef int sum_mm_qual
 *         if self._qualarr is None:             # <<<<<<<<<<<<<<
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
  }

  /* "HTSeq/_HTSeq.pyx":1423
 *         if self._qualarr is None:
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr             # <<<<<<<<<<<<<<
 *         for i in range(1, minlen + 1):
 *             num_mismatches = 0
*/
  __pyx_t_1 = __pyx_v_self->_qualarr;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1423, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_qual_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 1423, __pyx_L1_error)
    } else {__pyx_pybuffernd_qual_array.diminfo[0].strides = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qual_array.diminfo[0].shape = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_qual_array = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1424
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
 *         for i in range(1, minlen + 1):             # <<<<<<<<<<<<<<
 *             num_mismatches = 0
 *             for j in range(i):
*/
  __pyx_t_10 = (__pyx_v_minlen + 1);
  __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;

    /* "HTSeq/_HTSeq.pyx":1425
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
 *         for i in range(1, minlen + 1):
 *             num_mismatches = 0             # <<<<<<<<<<<<<<
 *             for j in range(i):
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
*/
    __pyx_v_num_mismatches = 0;

    /* "HTSeq/_HTSeq.pyx":1426
 *         for i in range(1, minlen + 1):
 *             num_mismatches = 0
 *             for j in range(i):             # <<<<<<<<<<<<<<
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
 *                     sum_mm_qual += qual_array[j]
*/
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "HTSeq/_HTSeq.pyx":1427
 *             num_mismatches = 0
 *             for j in range(i):
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:             # <<<<<<<<<<<<<<
 *                     sum_mm_qual += qual_array[j]
 *                     if sum_mm_qual > max_mm_qual:
*/
      __pyx_t_8 = ((__pyx_v_seq_cstr[__pyx_v_j]) != (__pyx_v_pat_cstr[((__pyx_v_patlen - __pyx_v_i) + __pyx_v_j)]));
      if (__pyx_t_8) {

        /* "HTSeq/_HTSeq.pyx":1428
 *             for j in range(i):
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
 *                     sum_mm_qual += qual_array[j]             # <<<<<<<<<<<<<<
 *                     if sum_mm_qual > max_mm_qual:
 *                         break
*/
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_17 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_16 += __pyx_pybuffernd_qual_array.diminfo[0].shape;
          if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_qual_array.diminfo[0].shape)) __pyx_t_17 = 0;
        if (unlikely(__pyx_t_17 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_17);
          __PYX_ERR(0, 1428, __pyx_L1_error)
        }
        __pyx_v_sum_mm_qual = (__pyx_v_sum_mm_qual + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_qual_array.diminfo[0].strides)));

        /* "HTSeq/_HTSeq.pyx":1429
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
 *                     sum_mm_qual += qual_array[j]
 *                     if sum_mm_qual > max_mm_qual:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
*/
        __pyx_t_8 = (__pyx_v_sum_mm_qual > __pyx_v_max_mm_qual);
        if (__pyx_t_8) {

          /* "HTSeq/_HTSeq.pyx":1430
 *                     sum_mm_qual += qual_array[j]
 *                     if sum_mm_qual > max_mm_qual:
 *                         break             # <<<<<<<<<<<<<<
 *             else:
 *                 match = i
*/
          goto __pyx_L8_break;

          /* "HTSeq/_HTSeq.pyx":1429
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:
 *                     sum_mm_qual += qual_array[j]
 *                     if sum_mm_qual > max_mm_qual:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
*/
        }

        /* "HTSeq/_HTSeq.pyx":1427
 *             num_mismatches = 0
 *             for j in range(i):
 *                 if seq_cstr[j] != pat_cstr[patlen - i + j]:             # <<<<<<<<<<<<<<
 *                     sum_mm_qual += qual_array[j]
 *                     if sum_mm_qual > max_mm_qual:
*/
      }
    }
    /*else*/ {

      /* "HTSeq/_HTSeq.pyx":1432
 *                         break
 *             else:
 *                 match = i             # <<<<<<<<<<<<<<
 *         return self[match: seqlen]
 * 
*/
      __pyx_v_match = __pyx_v_i;
    }
    __pyx_L8_break:;
  }

  /* "HTSeq/_HTSeq.pyx":1433
 *             else:
 *                 match = i
 *         return self[match: seqlen]             # <<<<<<<<<<<<<<
 * 
 *     cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self,
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), __pyx_v_match, __pyx_v_seqlen, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 1433, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1407
 *         return None
 * 
 *     cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *                                                          Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.trim_left_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_qual_array);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals(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_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals = {"trim_left_end_with_quals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
  int __pyx_v_max_mm_qual;
  #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("trim_left_end_with_quals (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_pattern,&__pyx_mstate_global->__pyx_n_u_max_mm_qual,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, 1407, __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, 1407, __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, 1407, __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, "trim_left_end_with_quals", 0) < (0)) __PYX_ERR(0, 1407, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("trim_left_end_with_quals", 0, 1, 2, i); __PYX_ERR(0, 1407, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1407, __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, 1407, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pattern = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)values[0]);
    if (values[1]) {
      __pyx_v_max_mm_qual = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_max_mm_qual == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1408, __pyx_L3_error)
    } else {
      __pyx_v_max_mm_qual = ((int)5);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("trim_left_end_with_quals", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1407, __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("HTSeq._HTSeq.SequenceWithQualities.trim_left_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pattern), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 1408, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14trim_left_end_with_quals(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_pattern, __pyx_v_max_mm_qual);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14trim_left_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_v_max_mm_qual) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trim_left_end_with_quals", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.max_mm_qual = __pyx_v_max_mm_qual;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities->trim_left_end_with_quals(__pyx_v_self, __pyx_v_pattern, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.trim_left_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1435
 *         return self[match: seqlen]
 * 
 *     cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *                                                           Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals(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 struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals *__pyx_optional_args) {
  int __pyx_v_max_mm_qual = ((int)5);
  int __pyx_v_seqlen;
  int __pyx_v_patlen;
  int __pyx_v_minlen;
  char *__pyx_v_seq_cstr;
  char *__pyx_v_pat_cstr;
  int __pyx_v_match;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_sum_mm_qual;
  PyArrayObject *__pyx_v_qual_array = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_qual_array;
  __Pyx_Buffer __pyx_pybuffer_qual_array;
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__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;
  char *__pyx_t_9;
  long __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trim_right_end_with_quals", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_max_mm_qual = __pyx_optional_args->max_mm_qual;
    }
  }
  __pyx_pybuffer_qual_array.pybuffer.buf = NULL;
  __pyx_pybuffer_qual_array.refcount = 0;
  __pyx_pybuffernd_qual_array.data = NULL;
  __pyx_pybuffernd_qual_array.rcbuffer = &__pyx_pybuffer_qual_array;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_trim_right_end_with_quals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_max_mm_qual); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1435, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_pattern), __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 1435, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "HTSeq/_HTSeq.pyx":1437
 *     cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self,
 *                                                           Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)             # <<<<<<<<<<<<<<
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
*/
  __pyx_t_1 = __pyx_v_self->__pyx_base.seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1437, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seqlen = __pyx_t_7;

  /* "HTSeq/_HTSeq.pyx":1438
 *                                                           Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)             # <<<<<<<<<<<<<<
 *         cdef int minlen
 *         if seqlen < patlen:
*/
  __pyx_t_1 = __pyx_v_pattern->seq;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1438, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_patlen = __pyx_t_7;

  /* "HTSeq/_HTSeq.pyx":1440
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
*/
  __pyx_t_8 = (__pyx_v_seqlen < __pyx_v_patlen);
  if (__pyx_t_8) {

    /* "HTSeq/_HTSeq.pyx":1441
 *         cdef int minlen
 *         if seqlen < patlen:
 *             minlen = seqlen             # <<<<<<<<<<<<<<
 *         else:
 *             minlen = patlen
*/
    __pyx_v_minlen = __pyx_v_seqlen;

    /* "HTSeq/_HTSeq.pyx":1440
 *         cdef int patlen = len(pattern.seq)
 *         cdef int minlen
 *         if seqlen < patlen:             # <<<<<<<<<<<<<<
 *             minlen = seqlen
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1443
 *             minlen = seqlen
 *         else:
 *             minlen = patlen             # <<<<<<<<<<<<<<
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq
*/
  /*else*/ {
    __pyx_v_minlen = __pyx_v_patlen;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1444
 *         else:
 *             minlen = patlen
 *         cdef char * seq_cstr = self.seq             # <<<<<<<<<<<<<<
 *         cdef char * pat_cstr = pattern.seq
 *         cdef int match = 0
*/
  if (unlikely(__pyx_v_self->__pyx_base.seq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1444, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->__pyx_base.seq); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L1_error)
  __pyx_v_seq_cstr = __pyx_t_9;

  /* "HTSeq/_HTSeq.pyx":1445
 *             minlen = patlen
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq             # <<<<<<<<<<<<<<
 *         cdef int match = 0
 *         cdef int i, j
*/
  if (unlikely(__pyx_v_pattern->seq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 1445, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_PyBytes_AsWritableString(__pyx_v_pattern->seq); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 1445, __pyx_L1_error)
  __pyx_v_pat_cstr = __pyx_t_9;

  /* "HTSeq/_HTSeq.pyx":1446
 *         cdef char * seq_cstr = self.seq
 *         cdef char * pat_cstr = pattern.seq
 *         cdef int match = 0             # <<<<<<<<<<<<<<
 *         cdef int i, j
 *         cdef int sum_mm_qual
*/
  __pyx_v_match = 0;

  /* "HTSeq/_HTSeq.pyx":1449
 *         cdef int i, j
 *         cdef int sum_mm_qual
 *         if self._qualarr is None:             # <<<<<<<<<<<<<<
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
  __pyx_t_8 = (__pyx_v_self->_qualarr == Py_None);
  if (__pyx_t_8) {

    /* "HTSeq/_HTSeq.pyx":1450
 *         cdef int sum_mm_qual
 *         if self._qualarr is None:
 *             self._fill_qual_arr()             # <<<<<<<<<<<<<<
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
 *         for i in range(1, minlen + 1):
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->__pyx_base.__pyx_vtab)->_fill_qual_arr(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1449
 *         cdef int i, j
 *         cdef int sum_mm_qual
 *         if self._qualarr is None:             # <<<<<<<<<<<<<<
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
*/
  }

  /* "HTSeq/_HTSeq.pyx":1451
 *         if self._qualarr is None:
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr             # <<<<<<<<<<<<<<
 *         for i in range(1, minlen + 1):
 *             sum_mm_qual = 0
*/
  __pyx_t_1 = __pyx_v_self->_qualarr;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1451, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_qual_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 1451, __pyx_L1_error)
    } else {__pyx_pybuffernd_qual_array.diminfo[0].strides = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qual_array.diminfo[0].shape = __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_qual_array = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1452
 *             self._fill_qual_arr()
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
 *         for i in range(1, minlen + 1):             # <<<<<<<<<<<<<<
 *             sum_mm_qual = 0
 *             for j in range(i):
*/
  __pyx_t_10 = (__pyx_v_minlen + 1);
  __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;

    /* "HTSeq/_HTSeq.pyx":1453
 *         cdef numpy.ndarray[numpy.uint8_t, ndim = 1] qual_array = self._qualarr
 *         for i in range(1, minlen + 1):
 *             sum_mm_qual = 0             # <<<<<<<<<<<<<<
 *             for j in range(i):
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
*/
    __pyx_v_sum_mm_qual = 0;

    /* "HTSeq/_HTSeq.pyx":1454
 *         for i in range(1, minlen + 1):
 *             sum_mm_qual = 0
 *             for j in range(i):             # <<<<<<<<<<<<<<
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
 *                     sum_mm_qual += qual_array[seqlen - i + j]
*/
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "HTSeq/_HTSeq.pyx":1455
 *             sum_mm_qual = 0
 *             for j in range(i):
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:             # <<<<<<<<<<<<<<
 *                     sum_mm_qual += qual_array[seqlen - i + j]
 *                     if sum_mm_qual > max_mm_qual:
*/
      __pyx_t_8 = ((__pyx_v_seq_cstr[((__pyx_v_seqlen - __pyx_v_i) + __pyx_v_j)]) != (__pyx_v_pat_cstr[__pyx_v_j]));
      if (__pyx_t_8) {

        /* "HTSeq/_HTSeq.pyx":1456
 *             for j in range(i):
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
 *                     sum_mm_qual += qual_array[seqlen - i + j]             # <<<<<<<<<<<<<<
 *                     if sum_mm_qual > max_mm_qual:
 *                         break
*/
        __pyx_t_16 = ((__pyx_v_seqlen - __pyx_v_i) + __pyx_v_j);
        __pyx_t_17 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_16 += __pyx_pybuffernd_qual_array.diminfo[0].shape;
          if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_qual_array.diminfo[0].shape)) __pyx_t_17 = 0;
        if (unlikely(__pyx_t_17 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_17);
          __PYX_ERR(0, 1456, __pyx_L1_error)
        }
        __pyx_v_sum_mm_qual = (__pyx_v_sum_mm_qual + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_qual_array.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_qual_array.diminfo[0].strides)));

        /* "HTSeq/_HTSeq.pyx":1457
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
 *                     sum_mm_qual += qual_array[seqlen - i + j]
 *                     if sum_mm_qual > max_mm_qual:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
*/
        __pyx_t_8 = (__pyx_v_sum_mm_qual > __pyx_v_max_mm_qual);
        if (__pyx_t_8) {

          /* "HTSeq/_HTSeq.pyx":1458
 *                     sum_mm_qual += qual_array[seqlen - i + j]
 *                     if sum_mm_qual > max_mm_qual:
 *                         break             # <<<<<<<<<<<<<<
 *             else:
 *                 match = i
*/
          goto __pyx_L8_break;

          /* "HTSeq/_HTSeq.pyx":1457
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:
 *                     sum_mm_qual += qual_array[seqlen - i + j]
 *                     if sum_mm_qual > max_mm_qual:             # <<<<<<<<<<<<<<
 *                         break
 *             else:
*/
        }

        /* "HTSeq/_HTSeq.pyx":1455
 *             sum_mm_qual = 0
 *             for j in range(i):
 *                 if seq_cstr[seqlen - i + j] != pat_cstr[j]:             # <<<<<<<<<<<<<<
 *                     sum_mm_qual += qual_array[seqlen - i + j]
 *                     if sum_mm_qual > max_mm_qual:
*/
      }
    }
    /*else*/ {

      /* "HTSeq/_HTSeq.pyx":1460
 *                         break
 *             else:
 *                 match = i             # <<<<<<<<<<<<<<
 *         return self[0: seqlen - match]
 * 
*/
      __pyx_v_match = __pyx_v_i;
    }
    __pyx_L8_break:;
  }

  /* "HTSeq/_HTSeq.pyx":1461
 *             else:
 *                 match = i
 *         return self[0: seqlen - match]             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, (__pyx_v_seqlen - __pyx_v_match), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 1461, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1435
 *         return self[match: seqlen]
 * 
 *     cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *                                                           Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.trim_right_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qual_array.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_qual_array);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals(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_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals = {"trim_right_end_with_quals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern = 0;
  int __pyx_v_max_mm_qual;
  #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("trim_right_end_with_quals (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_pattern,&__pyx_mstate_global->__pyx_n_u_max_mm_qual,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, 1435, __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, 1435, __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, 1435, __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, "trim_right_end_with_quals", 0) < (0)) __PYX_ERR(0, 1435, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("trim_right_end_with_quals", 0, 1, 2, i); __PYX_ERR(0, 1435, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1435, __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, 1435, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pattern = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)values[0]);
    if (values[1]) {
      __pyx_v_max_mm_qual = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_max_mm_qual == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1436, __pyx_L3_error)
    } else {
      __pyx_v_max_mm_qual = ((int)5);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("trim_right_end_with_quals", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1435, __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("HTSeq._HTSeq.SequenceWithQualities.trim_right_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pattern), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, 1, "pattern", 0))) __PYX_ERR(0, 1436, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_16trim_right_end_with_quals(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self), __pyx_v_pattern, __pyx_v_max_mm_qual);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_16trim_right_end_with_quals(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *__pyx_v_pattern, int __pyx_v_max_mm_qual) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trim_right_end_with_quals", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.max_mm_qual = __pyx_v_max_mm_qual;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities->trim_right_end_with_quals(__pyx_v_self, __pyx_v_pattern, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SequenceWithQualities.trim_right_end_with_quals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":30
 * 
 * cdef class SequenceWithQualities(Sequence):
 *    cdef readonly bytes _qualstr             # <<<<<<<<<<<<<<
 *    cdef readonly bytes _qualstr_phred
 *    cdef readonly str _qualscale
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_qualstr);
  __pyx_r = __pyx_v_self->_qualstr;
  goto __pyx_L0;

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

/* "HTSeq/_HTSeq.pxd":31
 * cdef class SequenceWithQualities(Sequence):
 *    cdef readonly bytes _qualstr
 *    cdef readonly bytes _qualstr_phred             # <<<<<<<<<<<<<<
 *    cdef readonly str _qualscale
 *    cdef readonly object _qualarr
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_qualstr_phred);
  __pyx_r = __pyx_v_self->_qualstr_phred;
  goto __pyx_L0;

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

/* "HTSeq/_HTSeq.pxd":32
 *    cdef readonly bytes _qualstr
 *    cdef readonly bytes _qualstr_phred
 *    cdef readonly str _qualscale             # <<<<<<<<<<<<<<
 *    cdef readonly object _qualarr
 *    cdef _fill_qual_arr(SequenceWithQualities self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_qualscale);
  __pyx_r = __pyx_v_self->_qualscale;
  goto __pyx_L0;

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

/* "HTSeq/_HTSeq.pxd":33
 *    cdef readonly bytes _qualstr_phred
 *    cdef readonly str _qualscale
 *    cdef readonly object _qualarr             # <<<<<<<<<<<<<<
 *    cdef _fill_qual_arr(SequenceWithQualities self)
 *    cpdef object add_qual_to_count_array(SequenceWithQualities self, numpy.ndarray count_array_)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_qualarr);
  __pyx_r = __pyx_v_self->_qualarr;
  goto __pyx_L0;

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

/* "HTSeq/_HTSeq.pyx":1493
 *     cdef public int query_from, query_to
 * 
 *     def __init__(self, str type_, int size, int rfrom, int rto, int qfrom,             # <<<<<<<<<<<<<<
 *                  int qto, str chrom, str strand, bint check=True):
 *         self.type = type_
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_type_ = 0;
  int __pyx_v_size;
  int __pyx_v_rfrom;
  int __pyx_v_rto;
  int __pyx_v_qfrom;
  int __pyx_v_qto;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_strand = 0;
  int __pyx_v_check;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_type,&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_rfrom,&__pyx_mstate_global->__pyx_n_u_rto,&__pyx_mstate_global->__pyx_n_u_qfrom,&__pyx_mstate_global->__pyx_n_u_qto,&__pyx_mstate_global->__pyx_n_u_chrom,&__pyx_mstate_global->__pyx_n_u_strand,&__pyx_mstate_global->__pyx_n_u_check,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, 1493, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1493, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1493, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1493, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1493, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1493, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1493, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1493, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1493, __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, 1493, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1493, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, i); __PYX_ERR(0, 1493, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1493, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1493, __pyx_L3_error)
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1493, __pyx_L3_error)
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1493, __pyx_L3_error)
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1493, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1493, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1493, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1493, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1493, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_type_ = ((PyObject*)values[0]);
    __pyx_v_size = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1493, __pyx_L3_error)
    __pyx_v_rfrom = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_rfrom == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1493, __pyx_L3_error)
    __pyx_v_rto = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_rto == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1493, __pyx_L3_error)
    __pyx_v_qfrom = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_qfrom == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1493, __pyx_L3_error)
    __pyx_v_qto = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_qto == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1494, __pyx_L3_error)
    __pyx_v_chrom = ((PyObject*)values[6]);
    __pyx_v_strand = ((PyObject*)values[7]);
    if (values[8]) {
      __pyx_v_check = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_check == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1494, __pyx_L3_error)
    } else {

      /* "HTSeq/_HTSeq.pyx":1494
 * 
 *     def __init__(self, str type_, int size, int rfrom, int rto, int qfrom,
 *                  int qto, str chrom, str strand, bint check=True):             # <<<<<<<<<<<<<<
 *         self.type = type_
 *         self.size = size
*/
      __pyx_v_check = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, __pyx_nargs); __PYX_ERR(0, 1493, __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("HTSeq._HTSeq.CigarOperation.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type_), (&PyUnicode_Type), 1, "type_", 1))) __PYX_ERR(0, 1493, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 1494, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 1494, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), __pyx_v_type_, __pyx_v_size, __pyx_v_rfrom, __pyx_v_rto, __pyx_v_qfrom, __pyx_v_qto, __pyx_v_chrom, __pyx_v_strand, __pyx_v_check);

  /* "HTSeq/_HTSeq.pyx":1493
 *     cdef public int query_from, query_to
 * 
 *     def __init__(self, str type_, int size, int rfrom, int rto, int qfrom,             # <<<<<<<<<<<<<<
 *                  int qto, str chrom, str strand, bint check=True):
 *         self.type = type_
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation___init__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_type_, int __pyx_v_size, int __pyx_v_rfrom, int __pyx_v_rto, int __pyx_v_qfrom, int __pyx_v_qto, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand, int __pyx_v_check) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":1495
 *     def __init__(self, str type_, int size, int rfrom, int rto, int qfrom,
 *                  int qto, str chrom, str strand, bint check=True):
 *         self.type = type_             # <<<<<<<<<<<<<<
 *         self.size = size
 *         self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand)
*/
  __Pyx_INCREF(__pyx_v_type_);
  __Pyx_GIVEREF(__pyx_v_type_);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(__pyx_v_self->type);
  __pyx_v_self->type = __pyx_v_type_;

  /* "HTSeq/_HTSeq.pyx":1496
 *                  int qto, str chrom, str strand, bint check=True):
 *         self.type = type_
 *         self.size = size             # <<<<<<<<<<<<<<
 *         self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand)
 *         self.query_from = qfrom
*/
  __pyx_v_self->size = __pyx_v_size;

  /* "HTSeq/_HTSeq.pyx":1497
 *         self.type = type_
 *         self.size = size
 *         self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand)             # <<<<<<<<<<<<<<
 *         self.query_from = qfrom
 *         self.query_to = qto
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_rfrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_rto); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_chrom, __pyx_t_3, __pyx_t_4, __pyx_v_strand};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1497, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __Pyx_GIVEREF((PyObject *)__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->ref_iv);
  __Pyx_DECREF((PyObject *)__pyx_v_self->ref_iv);
  __pyx_v_self->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1498
 *         self.size = size
 *         self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand)
 *         self.query_from = qfrom             # <<<<<<<<<<<<<<
 *         self.query_to = qto
 *         if check and not self.check():
*/
  __pyx_v_self->query_from = __pyx_v_qfrom;

  /* "HTSeq/_HTSeq.pyx":1499
 *         self.ref_iv = GenomicInterval(chrom, rfrom, rto, strand)
 *         self.query_from = qfrom
 *         self.query_to = qto             # <<<<<<<<<<<<<<
 *         if check and not self.check():
 *             raise ValueError("Inconsistent CIGAR operation.")
*/
  __pyx_v_self->query_to = __pyx_v_qto;

  /* "HTSeq/_HTSeq.pyx":1500
 *         self.query_from = qfrom
 *         self.query_to = qto
 *         if check and not self.check():             # <<<<<<<<<<<<<<
 *             raise ValueError("Inconsistent CIGAR operation.")
 * 
*/
  if (__pyx_v_check) {
  } else {
    __pyx_t_6 = __pyx_v_check;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check, __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_1)) __PYX_ERR(0, 1500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = (!__pyx_t_7);
  __pyx_t_6 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":1501
 *         self.query_to = qto
 *         if check and not self.check():
 *             raise ValueError("Inconsistent CIGAR operation.")             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Inconsistent_CIGAR_operation};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1501, __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, 1501, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1500
 *         self.query_from = qfrom
 *         self.query_to = qto
 *         if check and not self.check():             # <<<<<<<<<<<<<<
 *             raise ValueError("Inconsistent CIGAR operation.")
 * 
*/
  }

  /* "HTSeq/_HTSeq.pyx":1493
 *     cdef public int query_from, query_to
 * 
 *     def __init__(self, str type_, int size, int rfrom, int rto, int qfrom,             # <<<<<<<<<<<<<<
 *                  int qto, str chrom, str strand, bint check=True):
 *         self.type = type_
*/

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

/* "HTSeq/_HTSeq.pyx":1503
 *             raise ValueError("Inconsistent CIGAR operation.")
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (
 *             self.__class__.__name__, self.size, cigar_operation_names[
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[13];
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":1504
 * 
 *     def __repr__(self):
 *         return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (             # <<<<<<<<<<<<<<
 *             self.__class__.__name__, self.size, cigar_operation_names[
 *                 self.type],
*/
  __Pyx_XDECREF(__pyx_r);

  /* "HTSeq/_HTSeq.pyx":1505
 *     def __repr__(self):
 *         return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (
 *             self.__class__.__name__, self.size, cigar_operation_names[             # <<<<<<<<<<<<<<
 *                 self.type],
 *             str(self.ref_iv), self.query_from, self.query_to)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_self->size, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cigar_operation_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "HTSeq/_HTSeq.pyx":1506
 *         return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (
 *             self.__class__.__name__, self.size, cigar_operation_names[
 *                 self.type],             # <<<<<<<<<<<<<<
 *             str(self.ref_iv), self.query_from, self.query_to)
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_v_self->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "HTSeq/_HTSeq.pyx":1505
 *     def __repr__(self):
 *         return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (
 *             self.__class__.__name__, self.size, cigar_operation_names[             # <<<<<<<<<<<<<<
 *                 self.type],
 *             str(self.ref_iv), self.query_from, self.query_to)
*/
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_4), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":1507
 *             self.__class__.__name__, self.size, cigar_operation_names[
 *                 self.type],
 *             str(self.ref_iv), self.query_from, self.query_to)             # <<<<<<<<<<<<<<
 * 
 *     def check(CigarOperation self):
*/
  __pyx_t_4 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self->ref_iv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_self->query_from, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_self->query_to, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u__26;
  __pyx_t_7[1] = __pyx_t_1;
  __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__27;
  __pyx_t_7[3] = __pyx_t_2;
  __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_base_s;
  __pyx_t_7[5] = __pyx_t_3;
  __pyx_t_7[6] = __pyx_mstate_global->__pyx_kp_u_on_ref_iv;
  __pyx_t_7[7] = __pyx_t_4;
  __pyx_t_7[8] = __pyx_mstate_global->__pyx_kp_u_query_iv;
  __pyx_t_7[9] = __pyx_t_5;
  __pyx_t_7[10] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_7[11] = __pyx_t_6;
  __pyx_t_7[12] = __pyx_mstate_global->__pyx_kp_u__28;

  /* "HTSeq/_HTSeq.pyx":1504
 * 
 *     def __repr__(self):
 *         return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (             # <<<<<<<<<<<<<<
 *             self.__class__.__name__, self.size, cigar_operation_names[
 *                 self.type],
*/
  __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 13, 2 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 3, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1503
 *             raise ValueError("Inconsistent CIGAR operation.")
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "< %s: %d base(s) %s on ref iv %s, query iv [%d,%d) >" % (
 *             self.__class__.__name__, self.size, cigar_operation_names[
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1509
 *             str(self.ref_iv), self.query_from, self.query_to)
 * 
 *     def check(CigarOperation self):             # <<<<<<<<<<<<<<
 *         cdef int qlen = self.query_to - self.query_from
 *         cdef int rlen = self.ref_iv.length
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_5check(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_5HTSeq_6_HTSeq_14CigarOperation_5check = {"check", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_5check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_5check(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("check (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("check", 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("check", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4check(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4check(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
  int __pyx_v_qlen;
  int __pyx_v_rlen;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check", 0);

  /* "HTSeq/_HTSeq.pyx":1510
 * 
 *     def check(CigarOperation self):
 *         cdef int qlen = self.query_to - self.query_from             # <<<<<<<<<<<<<<
 *         cdef int rlen = self.ref_iv.length
 *         if self.type == 'M' or self.type == '=' or self.type == 'X':
*/
  __pyx_v_qlen = (__pyx_v_self->query_to - __pyx_v_self->query_from);

  /* "HTSeq/_HTSeq.pyx":1511
 *     def check(CigarOperation self):
 *         cdef int qlen = self.query_to - self.query_from
 *         cdef int rlen = self.ref_iv.length             # <<<<<<<<<<<<<<
 *         if self.type == 'M' or self.type == '=' or self.type == 'X':
 *             if not (qlen == self.size and rlen == self.size):
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ref_iv), __pyx_mstate_global->__pyx_n_u_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1511, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rlen = __pyx_t_2;

  /* "HTSeq/_HTSeq.pyx":1512
 *         cdef int qlen = self.query_to - self.query_from
 *         cdef int rlen = self.ref_iv.length
 *         if self.type == 'M' or self.type == '=' or self.type == 'X':             # <<<<<<<<<<<<<<
 *             if not (qlen == self.size and rlen == self.size):
 *                 return False
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_mstate_global->__pyx_n_u_M, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1512, __pyx_L1_error)
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_mstate_global->__pyx_kp_u__29, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1512, __pyx_L1_error)
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_mstate_global->__pyx_n_u_X, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1512, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":1513
 *         cdef int rlen = self.ref_iv.length
 *         if self.type == 'M' or self.type == '=' or self.type == 'X':
 *             if not (qlen == self.size and rlen == self.size):             # <<<<<<<<<<<<<<
 *                 return False
 *         elif self.type == 'I' or self.type == 'S':
*/
    __pyx_t_4 = (__pyx_v_qlen == __pyx_v_self->size);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_rlen == __pyx_v_self->size);
    __pyx_t_3 = __pyx_t_4;
    __pyx_L8_bool_binop_done:;
    __pyx_t_4 = (!__pyx_t_3);
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1514
 *         if self.type == 'M' or self.type == '=' or self.type == 'X':
 *             if not (qlen == self.size and rlen == self.size):
 *                 return False             # <<<<<<<<<<<<<<
 *         elif self.type == 'I' or self.type == 'S':
 *             if not (qlen == self.size and rlen == 0):
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":1513
 *         cdef int rlen = self.ref_iv.length
 *         if self.type == 'M' or self.type == '=' or self.type == 'X':
 *             if not (qlen == self.size and rlen == self.size):             # <<<<<<<<<<<<<<
 *                 return False
 *         elif self.type == 'I' or self.type == 'S':
*/
    }

    /* "HTSeq/_HTSeq.pyx":1512
 *         cdef int qlen = self.query_to - self.query_from
 *         cdef int rlen = self.ref_iv.length
 *         if self.type == 'M' or self.type == '=' or self.type == 'X':             # <<<<<<<<<<<<<<
 *             if not (qlen == self.size and rlen == self.size):
 *                 return False
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1515
 *             if not (qlen == self.size and rlen == self.size):
 *                 return False
 *         elif self.type == 'I' or self.type == 'S':             # <<<<<<<<<<<<<<
 *             if not (qlen == self.size and rlen == 0):
 *                 return False
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_mstate_global->__pyx_n_u_I, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1515, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_4 = __pyx_t_3;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_mstate_global->__pyx_n_u_S, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1515, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_3;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1516
 *                 return False
 *         elif self.type == 'I' or self.type == 'S':
 *             if not (qlen == self.size and rlen == 0):             # <<<<<<<<<<<<<<
 *                 return False
 *         elif self.type == 'D' or self.type == 'N':
*/
    __pyx_t_3 = (__pyx_v_qlen == __pyx_v_self->size);
    if (__pyx_t_3) {
    } else {
      __pyx_t_4 = __pyx_t_3;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_rlen == 0);
    __pyx_t_4 = __pyx_t_3;
    __pyx_L13_bool_binop_done:;
    __pyx_t_3 = (!__pyx_t_4);
    if (__pyx_t_3) {

      /* "HTSeq/_HTSeq.pyx":1517
 *         elif self.type == 'I' or self.type == 'S':
 *             if not (qlen == self.size and rlen == 0):
 *                 return False             # <<<<<<<<<<<<<<
 *         elif self.type == 'D' or self.type == 'N':
 *             if not (qlen == 0 and rlen == self.size):
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":1516
 *                 return False
 *         elif self.type == 'I' or self.type == 'S':
 *             if not (qlen == self.size and rlen == 0):             # <<<<<<<<<<<<<<
 *                 return False
 *         elif self.type == 'D' or self.type == 'N':
*/
    }

    /* "HTSeq/_HTSeq.pyx":1515
 *             if not (qlen == self.size and rlen == self.size):
 *                 return False
 *         elif self.type == 'I' or self.type == 'S':             # <<<<<<<<<<<<<<
 *             if not (qlen == self.size and rlen == 0):
 *                 return False
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1518
 *             if not (qlen == self.size and rlen == 0):
 *                 return False
 *         elif self.type == 'D' or self.type == 'N':             # <<<<<<<<<<<<<<
 *             if not (qlen == 0 and rlen == self.size):
 *                 return False
*/
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_mstate_global->__pyx_n_u_D, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1518, __pyx_L1_error)
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_mstate_global->__pyx_n_u_N, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1518, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_4;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_3) {

    /* "HTSeq/_HTSeq.pyx":1519
 *                 return False
 *         elif self.type == 'D' or self.type == 'N':
 *             if not (qlen == 0 and rlen == self.size):             # <<<<<<<<<<<<<<
 *                 return False
 *         elif self.type == 'H' or self.type == 'P':
*/
    __pyx_t_4 = (__pyx_v_qlen == 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_rlen == __pyx_v_self->size);
    __pyx_t_3 = __pyx_t_4;
    __pyx_L18_bool_binop_done:;
    __pyx_t_4 = (!__pyx_t_3);
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1520
 *         elif self.type == 'D' or self.type == 'N':
 *             if not (qlen == 0 and rlen == self.size):
 *                 return False             # <<<<<<<<<<<<<<
 *         elif self.type == 'H' or self.type == 'P':
 *             if not (qlen == 0 and rlen == 0):
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":1519
 *                 return False
 *         elif self.type == 'D' or self.type == 'N':
 *             if not (qlen == 0 and rlen == self.size):             # <<<<<<<<<<<<<<
 *                 return False
 *         elif self.type == 'H' or self.type == 'P':
*/
    }

    /* "HTSeq/_HTSeq.pyx":1518
 *             if not (qlen == self.size and rlen == 0):
 *                 return False
 *         elif self.type == 'D' or self.type == 'N':             # <<<<<<<<<<<<<<
 *             if not (qlen == 0 and rlen == self.size):
 *                 return False
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1521
 *             if not (qlen == 0 and rlen == self.size):
 *                 return False
 *         elif self.type == 'H' or self.type == 'P':             # <<<<<<<<<<<<<<
 *             if not (qlen == 0 and rlen == 0):
 *                 return False
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_mstate_global->__pyx_n_u_H, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1521, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_4 = __pyx_t_3;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_self->type, __pyx_mstate_global->__pyx_n_u_P, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1521, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_3;
  __pyx_L20_bool_binop_done:;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1522
 *                 return False
 *         elif self.type == 'H' or self.type == 'P':
 *             if not (qlen == 0 and rlen == 0):             # <<<<<<<<<<<<<<
 *                 return False
 *         else:
*/
    __pyx_t_3 = (__pyx_v_qlen == 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_4 = __pyx_t_3;
      goto __pyx_L23_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_rlen == 0);
    __pyx_t_4 = __pyx_t_3;
    __pyx_L23_bool_binop_done:;
    __pyx_t_3 = (!__pyx_t_4);
    if (__pyx_t_3) {

      /* "HTSeq/_HTSeq.pyx":1523
 *         elif self.type == 'H' or self.type == 'P':
 *             if not (qlen == 0 and rlen == 0):
 *                 return False             # <<<<<<<<<<<<<<
 *         else:
 *             return False
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":1522
 *                 return False
 *         elif self.type == 'H' or self.type == 'P':
 *             if not (qlen == 0 and rlen == 0):             # <<<<<<<<<<<<<<
 *                 return False
 *         else:
*/
    }

    /* "HTSeq/_HTSeq.pyx":1521
 *             if not (qlen == 0 and rlen == self.size):
 *                 return False
 *         elif self.type == 'H' or self.type == 'P':             # <<<<<<<<<<<<<<
 *             if not (qlen == 0 and rlen == 0):
 *                 return False
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1525
 *                 return False
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 *         return True
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1526
 *         else:
 *             return False
 *         return True             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1509
 *             str(self.ref_iv), self.query_from, self.query_to)
 * 
 *     def check(CigarOperation self):             # <<<<<<<<<<<<<<
 *         cdef int qlen = self.query_to - self.query_from
 *         cdef int rlen = self.ref_iv.length
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1488
 * cdef class CigarOperation(object):
 * 
 *     cdef public str type             # <<<<<<<<<<<<<<
 *     cdef public int size
 *     cdef public GenomicInterval ref_iv
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->type);
  __pyx_r = __pyx_v_self->type;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1488, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(__pyx_v_self->type);
  __pyx_v_self->type = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4type_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(__pyx_v_self->type);
  __pyx_v_self->type = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pyx":1489
 * 
 *     cdef public str type
 *     cdef public int size             # <<<<<<<<<<<<<<
 *     cdef public GenomicInterval ref_iv
 *     cdef public int query_from, query_to
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_4size_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1489, __pyx_L1_error)
  __pyx_v_self->size = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1490
 *     cdef public str type
 *     cdef public int size
 *     cdef public GenomicInterval ref_iv             # <<<<<<<<<<<<<<
 *     cdef public int query_from, query_to
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->ref_iv);
  __pyx_r = ((PyObject *)__pyx_v_self->ref_iv);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->ref_iv);
  __Pyx_DECREF((PyObject *)__pyx_v_self->ref_iv);
  __pyx_v_self->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.ref_iv.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->ref_iv);
  __Pyx_DECREF((PyObject *)__pyx_v_self->ref_iv);
  __pyx_v_self->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);

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

/* "HTSeq/_HTSeq.pyx":1491
 *     cdef public int size
 *     cdef public GenomicInterval ref_iv
 *     cdef public int query_from, query_to             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, str type_, int size, int rfrom, int rto, int qfrom,
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->query_from); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.query_from.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_10query_from_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1491, __pyx_L1_error)
  __pyx_v_self->query_from = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.query_from.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to___get__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->query_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.query_to.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8query_to_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1491, __pyx_L1_error)
  __pyx_v_self->query_to = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.query_to.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_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_5HTSeq_6_HTSeq_14CigarOperation_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_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_5HTSeq_6_HTSeq_14CigarOperation_6__reduce_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_6__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.query_from, self.query_to, self.ref_iv, self.size, self.type)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->query_from); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->query_to); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->ref_iv);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->ref_iv);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->ref_iv)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->type);
  __Pyx_GIVEREF(__pyx_v_self->type);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_self->type) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.query_from, self.query_to, self.ref_iv, self.size, self.type)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v__dict = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "(tree fragment)":7
 *     state = (self.query_from, self.query_to, self.ref_iv, self.size, self.type)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_6 = (__pyx_v__dict != Py_None);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 7, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict) != (0)) __PYX_ERR(3, 8, __pyx_L1_error);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.ref_iv is not None or self.type is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.query_from, self.query_to, self.ref_iv, self.size, self.type)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.ref_iv is not None or self.type is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, None), state
*/
  /*else*/ {
    __pyx_t_6 = (((PyObject *)__pyx_v_self->ref_iv) != Py_None);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->type != ((PyObject*)Py_None));
    __pyx_t_5 = __pyx_t_6;
    __pyx_L6_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_5;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.ref_iv is not None or self.type is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.ref_iv is not None or self.type is not None
 *     if use_setstate:
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CigarOperation); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_260241271);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_260241271);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_int_260241271) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.ref_iv is not None or self.type is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, None), state
 *     else:
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CigarOperation__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CigarOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_260241271);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_260241271);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_int_260241271) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CigarOperation__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_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_5HTSeq_6_HTSeq_14CigarOperation_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_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
) {
  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(3, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(3, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(3, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14CigarOperation_8__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__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_5HTSeq_6_HTSeq_14CigarOperation_8__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CigarOperation__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(3, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(3, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_CigarOperation__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CigarOperation__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.CigarOperation.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1529
 * 
 * 
 * cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."):             # <<<<<<<<<<<<<<
 *     cdef list split_cigar, cl
 *     cdef int size
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11parse_cigar(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 PyObject *__pyx_f_5HTSeq_6_HTSeq_parse_cigar(PyObject *__pyx_v_cigar_string, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar *__pyx_optional_args) {
  int __pyx_v_ref_left = ((int)0);
  PyObject *__pyx_v_chrom = ((PyObject*)__pyx_mstate_global->__pyx_kp_u__12);
  PyObject *__pyx_v_strand = ((PyObject*)__pyx_mstate_global->__pyx_kp_u__8);
  PyObject *__pyx_v_split_cigar = 0;
  PyObject *__pyx_v_cl = 0;
  int __pyx_v_size;
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_cigar", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ref_left = __pyx_optional_args->ref_left;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_chrom = __pyx_optional_args->chrom;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_strand = __pyx_optional_args->strand;
        }
      }
    }
  }

  /* "HTSeq/_HTSeq.pyx":1533
 *     cdef int size
 *     cdef str code
 *     split_cigar = _re_cigar_codes.split(cigar_string)             # <<<<<<<<<<<<<<
 *     if split_cigar[-1] != '' or len(split_cigar) % 2 != 1:
 *         raise ValueError("Illegal CIGAR string '%s'" % cigar_string)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_re_cigar_codes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_cigar_string};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 1533, __pyx_L1_error)
  __pyx_v_split_cigar = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1534
 *     cdef str code
 *     split_cigar = _re_cigar_codes.split(cigar_string)
 *     if split_cigar[-1] != '' or len(split_cigar) % 2 != 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("Illegal CIGAR string '%s'" % cigar_string)
 *     cl = []
*/
  if (unlikely(__pyx_v_split_cigar == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1534, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_split_cigar, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__12, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  if (unlikely(__pyx_v_split_cigar == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1534, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_PyList_GET_SIZE(__pyx_v_split_cigar); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1534, __pyx_L1_error)
  __pyx_t_7 = (__Pyx_mod_Py_ssize_t(__pyx_t_8, 2, 1) != 1);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_6)) {

    /* "HTSeq/_HTSeq.pyx":1535
 *     split_cigar = _re_cigar_codes.split(cigar_string)
 *     if split_cigar[-1] != '' or len(split_cigar) % 2 != 1:
 *         raise ValueError("Illegal CIGAR string '%s'" % cigar_string)             # <<<<<<<<<<<<<<
 *     cl = []
 *     for i in range(len(split_cigar) // 2):
*/
    __pyx_t_4 = NULL;
    __pyx_t_2 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Illegal_CIGAR_string_s, __pyx_v_cigar_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __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, 1535, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1534
 *     cdef str code
 *     split_cigar = _re_cigar_codes.split(cigar_string)
 *     if split_cigar[-1] != '' or len(split_cigar) % 2 != 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("Illegal CIGAR string '%s'" % cigar_string)
 *     cl = []
*/
  }

  /* "HTSeq/_HTSeq.pyx":1536
 *     if split_cigar[-1] != '' or len(split_cigar) % 2 != 1:
 *         raise ValueError("Illegal CIGAR string '%s'" % cigar_string)
 *     cl = []             # <<<<<<<<<<<<<<
 *     for i in range(len(split_cigar) // 2):
 *         try:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cl = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1537
 *         raise ValueError("Illegal CIGAR string '%s'" % cigar_string)
 *     cl = []
 *     for i in range(len(split_cigar) // 2):             # <<<<<<<<<<<<<<
 *         try:
 *             size = int(split_cigar[2 * i])
*/
  __pyx_t_2 = NULL;
  if (unlikely(__pyx_v_split_cigar == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1537, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_PyList_GET_SIZE(__pyx_v_split_cigar); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1537, __pyx_L1_error)
  __pyx_t_4 = PyLong_FromSsize_t(__Pyx_div_Py_ssize_t(__pyx_t_8, 2, 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    {
      __pyx_t_1 = __pyx_t_9(__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, 1537, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1538
 *     cl = []
 *     for i in range(len(split_cigar) // 2):
 *         try:             # <<<<<<<<<<<<<<
 *             size = int(split_cigar[2 * i])
 *         except ValueError:
*/
    {
      __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:*/ {

        /* "HTSeq/_HTSeq.pyx":1539
 *     for i in range(len(split_cigar) // 2):
 *         try:
 *             size = int(split_cigar[2 * i])             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             raise ValueError("Illegal CIGAR string '%s'" % cigar_string)
*/
        if (unlikely(__pyx_v_split_cigar == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 1539, __pyx_L8_error)
        }
        __pyx_t_1 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_v_i, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_split_cigar, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1539, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_13 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1539, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_size = __pyx_t_13;

        /* "HTSeq/_HTSeq.pyx":1538
 *     cl = []
 *     for i in range(len(split_cigar) // 2):
 *         try:             # <<<<<<<<<<<<<<
 *             size = int(split_cigar[2 * i])
 *         except ValueError:
*/
      }
      __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_L15_try_end;
      __pyx_L8_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;

      /* "HTSeq/_HTSeq.pyx":1540
 *         try:
 *             size = int(split_cigar[2 * i])
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             raise ValueError("Illegal CIGAR string '%s'" % cigar_string)
 *         code = split_cigar[2 * i + 1]
*/
      __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ValueError))));
      if (__pyx_t_13) {
        __Pyx_AddTraceback("HTSeq._HTSeq.parse_cigar", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 1540, __pyx_L10_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_3);

        /* "HTSeq/_HTSeq.pyx":1541
 *             size = int(split_cigar[2 * i])
 *         except ValueError:
 *             raise ValueError("Illegal CIGAR string '%s'" % cigar_string)             # <<<<<<<<<<<<<<
 *         code = split_cigar[2 * i + 1]
 *         cl.append((code, size))
*/
        __pyx_t_15 = NULL;
        __pyx_t_16 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Illegal_CIGAR_string_s, __pyx_v_cigar_string); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1541, __pyx_L10_except_error)
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_16};
          __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1541, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_14);
        }
        __Pyx_Raise(__pyx_t_14, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __PYX_ERR(0, 1541, __pyx_L10_except_error)
      }
      goto __pyx_L10_except_error;

      /* "HTSeq/_HTSeq.pyx":1538
 *     cl = []
 *     for i in range(len(split_cigar) // 2):
 *         try:             # <<<<<<<<<<<<<<
 *             size = int(split_cigar[2 * i])
 *         except ValueError:
*/
      __pyx_L10_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_L15_try_end:;
    }

    /* "HTSeq/_HTSeq.pyx":1542
 *         except ValueError:
 *             raise ValueError("Illegal CIGAR string '%s'" % cigar_string)
 *         code = split_cigar[2 * i + 1]             # <<<<<<<<<<<<<<
 *         cl.append((code, size))
 *     return build_cigar_list(cl, ref_left, chrom, strand)
*/
    if (unlikely(__pyx_v_split_cigar == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1542, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_v_i, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_split_cigar, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_code, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":1543
 *             raise ValueError("Illegal CIGAR string '%s'" % cigar_string)
 *         code = split_cigar[2 * i + 1]
 *         cl.append((code, size))             # <<<<<<<<<<<<<<
 *     return build_cigar_list(cl, ref_left, chrom, strand)
 * 
*/
    __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_code);
    __Pyx_GIVEREF(__pyx_v_code);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_code) != (0)) __PYX_ERR(0, 1543, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1543, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_cl, __pyx_t_2); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "HTSeq/_HTSeq.pyx":1537
 *         raise ValueError("Illegal CIGAR string '%s'" % cigar_string)
 *     cl = []
 *     for i in range(len(split_cigar) // 2):             # <<<<<<<<<<<<<<
 *         try:
 *             size = int(split_cigar[2 * i])
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "HTSeq/_HTSeq.pyx":1544
 *         code = split_cigar[2 * i + 1]
 *         cl.append((code, size))
 *     return build_cigar_list(cl, ref_left, chrom, strand)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_18.__pyx_n = 3;
  __pyx_t_18.ref_left = __pyx_v_ref_left;
  __pyx_t_18.chrom = __pyx_v_chrom;
  __pyx_t_18.strand = __pyx_v_strand;
  __pyx_t_4 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(__pyx_v_cl, 0, &__pyx_t_18); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1529
 * 
 * 
 * cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."):             # <<<<<<<<<<<<<<
 *     cdef list split_cigar, cl
 *     cdef int size
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("HTSeq._HTSeq.parse_cigar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_split_cigar);
  __Pyx_XDECREF(__pyx_v_cl);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11parse_cigar(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_5HTSeq_6_HTSeq_11parse_cigar = {"parse_cigar", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11parse_cigar, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_11parse_cigar(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_cigar_string = 0;
  int __pyx_v_ref_left;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_strand = 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("parse_cigar (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_cigar_string,&__pyx_mstate_global->__pyx_n_u_ref_left,&__pyx_mstate_global->__pyx_n_u_chrom,&__pyx_mstate_global->__pyx_n_u_strand,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, 1529, __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, 1529, __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, 1529, __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, 1529, __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, 1529, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "parse_cigar", 0) < (0)) __PYX_ERR(0, 1529, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__8));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parse_cigar", 0, 1, 4, i); __PYX_ERR(0, 1529, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1529, __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, 1529, __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, 1529, __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, 1529, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__8));
    }
    __pyx_v_cigar_string = ((PyObject*)values[0]);
    if (values[1]) {
      __pyx_v_ref_left = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_ref_left == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1529, __pyx_L3_error)
    } else {
      __pyx_v_ref_left = ((int)0);
    }
    __pyx_v_chrom = ((PyObject*)values[2]);
    __pyx_v_strand = ((PyObject*)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parse_cigar", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 1529, __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("HTSeq._HTSeq.parse_cigar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cigar_string), (&PyUnicode_Type), 1, "cigar_string", 1))) __PYX_ERR(0, 1529, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 1529, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 1529, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_10parse_cigar(__pyx_self, __pyx_v_cigar_string, __pyx_v_ref_left, __pyx_v_chrom, __pyx_v_strand);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_10parse_cigar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cigar_string, int __pyx_v_ref_left, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_cigar", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.ref_left = __pyx_v_ref_left;
  __pyx_t_2.chrom = __pyx_v_chrom;
  __pyx_t_2.strand = __pyx_v_strand;
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_parse_cigar(__pyx_v_cigar_string, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.parse_cigar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1547
 * 
 * 
 * cpdef list build_cigar_list(list cigar_pairs, int ref_left=0, str chrom="", str strand="."):             # <<<<<<<<<<<<<<
 *     cdef list split_cigar, res
 *     cdef int rpos, qpos, size
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13build_cigar_list(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 PyObject *__pyx_f_5HTSeq_6_HTSeq_build_cigar_list(PyObject *__pyx_v_cigar_pairs, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list *__pyx_optional_args) {
  int __pyx_v_ref_left = ((int)0);
  PyObject *__pyx_v_chrom = ((PyObject*)__pyx_mstate_global->__pyx_kp_u__12);
  PyObject *__pyx_v_strand = ((PyObject*)__pyx_mstate_global->__pyx_kp_u__8);
  PyObject *__pyx_v_res = 0;
  int __pyx_v_rpos;
  int __pyx_v_qpos;
  int __pyx_v_size;
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  size_t __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_cigar_list", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ref_left = __pyx_optional_args->ref_left;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_chrom = __pyx_optional_args->chrom;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_strand = __pyx_optional_args->strand;
        }
      }
    }
  }

  /* "HTSeq/_HTSeq.pyx":1551
 *     cdef int rpos, qpos, size
 *     cdef str code
 *     rpos = ref_left             # <<<<<<<<<<<<<<
 *     qpos = 0
 *     res = []
*/
  __pyx_v_rpos = __pyx_v_ref_left;

  /* "HTSeq/_HTSeq.pyx":1552
 *     cdef str code
 *     rpos = ref_left
 *     qpos = 0             # <<<<<<<<<<<<<<
 *     res = []
 *     for code, size in cigar_pairs:
*/
  __pyx_v_qpos = 0;

  /* "HTSeq/_HTSeq.pyx":1553
 *     rpos = ref_left
 *     qpos = 0
 *     res = []             # <<<<<<<<<<<<<<
 *     for code, size in cigar_pairs:
 *         if code == 'M' or code == '=' or code == 'X':
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1554
 *     qpos = 0
 *     res = []
 *     for code, size in cigar_pairs:             # <<<<<<<<<<<<<<
 *         if code == 'M' or code == '=' or code == 'X':
 *             res.append(CigarOperation(
*/
  if (unlikely(__pyx_v_cigar_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1554, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_cigar_pairs; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1554, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1554, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1554, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1554, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1554, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1554, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1554, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 1554, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1554, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 1554, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_code, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_v_size = __pyx_t_8;

    /* "HTSeq/_HTSeq.pyx":1555
 *     res = []
 *     for code, size in cigar_pairs:
 *         if code == 'M' or code == '=' or code == 'X':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
*/
    __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_mstate_global->__pyx_n_u_M, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1555, __pyx_L1_error)
    if (!__pyx_t_10) {
    } else {
      __pyx_t_9 = __pyx_t_10;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_mstate_global->__pyx_kp_u__29, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1555, __pyx_L1_error)
    if (!__pyx_t_10) {
    } else {
      __pyx_t_9 = __pyx_t_10;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_mstate_global->__pyx_n_u_X, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1555, __pyx_L1_error)
    __pyx_t_9 = __pyx_t_10;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_9) {

      /* "HTSeq/_HTSeq.pyx":1556
 *     for code, size in cigar_pairs:
 *         if code == 'M' or code == '=' or code == 'X':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
 *             rpos += size
*/
      __pyx_t_5 = NULL;

      /* "HTSeq/_HTSeq.pyx":1557
 *         if code == 'M' or code == '=' or code == 'X':
 *             res.append(CigarOperation(
 *                 code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))             # <<<<<<<<<<<<<<
 *             rpos += size
 *             qpos += size
*/
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = __Pyx_PyLong_From_int((__pyx_v_rpos + __pyx_v_size)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyLong_From_int((__pyx_v_qpos + __pyx_v_size)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = 1;
      {
        PyObject *__pyx_callargs[9] = {__pyx_t_5, __pyx_v_code, __pyx_t_4, __pyx_t_6, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_v_chrom, __pyx_v_strand};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation, __pyx_callargs+__pyx_t_14, (9-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1556, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_3);
      }

      /* "HTSeq/_HTSeq.pyx":1556
 *     for code, size in cigar_pairs:
 *         if code == 'M' or code == '=' or code == 'X':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
 *             rpos += size
*/
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_res, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1556, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1558
 *             res.append(CigarOperation(
 *                 code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
 *             rpos += size             # <<<<<<<<<<<<<<
 *             qpos += size
 *         elif code == 'I':
*/
      __pyx_v_rpos = (__pyx_v_rpos + __pyx_v_size);

      /* "HTSeq/_HTSeq.pyx":1559
 *                 code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
 *             rpos += size
 *             qpos += size             # <<<<<<<<<<<<<<
 *         elif code == 'I':
 *             res.append(CigarOperation(
*/
      __pyx_v_qpos = (__pyx_v_qpos + __pyx_v_size);

      /* "HTSeq/_HTSeq.pyx":1555
 *     res = []
 *     for code, size in cigar_pairs:
 *         if code == 'M' or code == '=' or code == 'X':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 code, size, rpos, rpos + size, qpos, qpos + size, chrom, strand))
*/
      goto __pyx_L7;
    }

    /* "HTSeq/_HTSeq.pyx":1560
 *             rpos += size
 *             qpos += size
 *         elif code == 'I':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
*/
    __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_mstate_global->__pyx_n_u_I, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1560, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "HTSeq/_HTSeq.pyx":1561
 *             qpos += size
 *         elif code == 'I':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size
*/
      __pyx_t_13 = NULL;

      /* "HTSeq/_HTSeq.pyx":1562
 *         elif code == 'I':
 *             res.append(CigarOperation(
 *                 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))             # <<<<<<<<<<<<<<
 *             qpos += size
 *         elif code == 'D':
*/
      __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyLong_From_int((__pyx_v_qpos + __pyx_v_size)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_14 = 1;
      {
        PyObject *__pyx_callargs[9] = {__pyx_t_13, __pyx_mstate_global->__pyx_n_u_I, __pyx_t_12, __pyx_t_11, __pyx_t_6, __pyx_t_4, __pyx_t_5, __pyx_v_chrom, __pyx_v_strand};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation, __pyx_callargs+__pyx_t_14, (9-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_3);
      }

      /* "HTSeq/_HTSeq.pyx":1561
 *             qpos += size
 *         elif code == 'I':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size
*/
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_res, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1561, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1563
 *             res.append(CigarOperation(
 *                 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size             # <<<<<<<<<<<<<<
 *         elif code == 'D':
 *             res.append(CigarOperation(
*/
      __pyx_v_qpos = (__pyx_v_qpos + __pyx_v_size);

      /* "HTSeq/_HTSeq.pyx":1560
 *             rpos += size
 *             qpos += size
 *         elif code == 'I':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
*/
      goto __pyx_L7;
    }

    /* "HTSeq/_HTSeq.pyx":1564
 *                 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size
 *         elif code == 'D':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
*/
    __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_mstate_global->__pyx_n_u_D, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1564, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "HTSeq/_HTSeq.pyx":1565
 *             qpos += size
 *         elif code == 'D':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size
*/
      __pyx_t_5 = NULL;

      /* "HTSeq/_HTSeq.pyx":1566
 *         elif code == 'D':
 *             res.append(CigarOperation(
 *                 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))             # <<<<<<<<<<<<<<
 *             rpos += size
 *         elif code == 'N':
*/
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1566, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = __Pyx_PyLong_From_int((__pyx_v_rpos + __pyx_v_size)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1566, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1566, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1566, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = 1;
      {
        PyObject *__pyx_callargs[9] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_D, __pyx_t_4, __pyx_t_6, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_v_chrom, __pyx_v_strand};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation, __pyx_callargs+__pyx_t_14, (9-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1565, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_3);
      }

      /* "HTSeq/_HTSeq.pyx":1565
 *             qpos += size
 *         elif code == 'D':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size
*/
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_res, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1565, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1567
 *             res.append(CigarOperation(
 *                 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size             # <<<<<<<<<<<<<<
 *         elif code == 'N':
 *             res.append(CigarOperation(
*/
      __pyx_v_rpos = (__pyx_v_rpos + __pyx_v_size);

      /* "HTSeq/_HTSeq.pyx":1564
 *                 'I', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size
 *         elif code == 'D':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
*/
      goto __pyx_L7;
    }

    /* "HTSeq/_HTSeq.pyx":1568
 *                 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size
 *         elif code == 'N':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
*/
    __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_mstate_global->__pyx_n_u_N, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1568, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "HTSeq/_HTSeq.pyx":1569
 *             rpos += size
 *         elif code == 'N':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size
*/
      __pyx_t_13 = NULL;

      /* "HTSeq/_HTSeq.pyx":1570
 *         elif code == 'N':
 *             res.append(CigarOperation(
 *                 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))             # <<<<<<<<<<<<<<
 *             rpos += size
 *         elif code == 'S':
*/
      __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = __Pyx_PyLong_From_int((__pyx_v_rpos + __pyx_v_size)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_14 = 1;
      {
        PyObject *__pyx_callargs[9] = {__pyx_t_13, __pyx_mstate_global->__pyx_n_u_N, __pyx_t_12, __pyx_t_11, __pyx_t_6, __pyx_t_4, __pyx_t_5, __pyx_v_chrom, __pyx_v_strand};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation, __pyx_callargs+__pyx_t_14, (9-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1569, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_3);
      }

      /* "HTSeq/_HTSeq.pyx":1569
 *             rpos += size
 *         elif code == 'N':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size
*/
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_res, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1569, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1571
 *             res.append(CigarOperation(
 *                 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size             # <<<<<<<<<<<<<<
 *         elif code == 'S':
 *             res.append(CigarOperation(
*/
      __pyx_v_rpos = (__pyx_v_rpos + __pyx_v_size);

      /* "HTSeq/_HTSeq.pyx":1568
 *                 'D', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size
 *         elif code == 'N':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
*/
      goto __pyx_L7;
    }

    /* "HTSeq/_HTSeq.pyx":1572
 *                 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size
 *         elif code == 'S':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
*/
    __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_mstate_global->__pyx_n_u_S, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1572, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "HTSeq/_HTSeq.pyx":1573
 *             rpos += size
 *         elif code == 'S':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size
*/
      __pyx_t_5 = NULL;

      /* "HTSeq/_HTSeq.pyx":1574
 *         elif code == 'S':
 *             res.append(CigarOperation(
 *                 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))             # <<<<<<<<<<<<<<
 *             qpos += size
 *         elif code == 'H':
*/
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyLong_From_int((__pyx_v_qpos + __pyx_v_size)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = 1;
      {
        PyObject *__pyx_callargs[9] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_S, __pyx_t_4, __pyx_t_6, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_v_chrom, __pyx_v_strand};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation, __pyx_callargs+__pyx_t_14, (9-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1573, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_3);
      }

      /* "HTSeq/_HTSeq.pyx":1573
 *             rpos += size
 *         elif code == 'S':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size
*/
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_res, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1573, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1575
 *             res.append(CigarOperation(
 *                 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size             # <<<<<<<<<<<<<<
 *         elif code == 'H':
 *             res.append(CigarOperation(
*/
      __pyx_v_qpos = (__pyx_v_qpos + __pyx_v_size);

      /* "HTSeq/_HTSeq.pyx":1572
 *                 'N', size, rpos, rpos + size, qpos, qpos, chrom, strand))
 *             rpos += size
 *         elif code == 'S':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
*/
      goto __pyx_L7;
    }

    /* "HTSeq/_HTSeq.pyx":1576
 *                 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size
 *         elif code == 'H':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
*/
    __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_mstate_global->__pyx_n_u_H, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1576, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "HTSeq/_HTSeq.pyx":1577
 *             qpos += size
 *         elif code == 'H':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         elif code == 'P':
*/
      __pyx_t_13 = NULL;

      /* "HTSeq/_HTSeq.pyx":1578
 *         elif code == 'H':
 *             res.append(CigarOperation(
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))             # <<<<<<<<<<<<<<
 *         elif code == 'P':
 *             res.append(CigarOperation(
*/
      __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_14 = 1;
      {
        PyObject *__pyx_callargs[9] = {__pyx_t_13, __pyx_mstate_global->__pyx_n_u_H, __pyx_t_12, __pyx_t_11, __pyx_t_6, __pyx_t_4, __pyx_t_5, __pyx_v_chrom, __pyx_v_strand};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation, __pyx_callargs+__pyx_t_14, (9-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1577, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_3);
      }

      /* "HTSeq/_HTSeq.pyx":1577
 *             qpos += size
 *         elif code == 'H':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         elif code == 'P':
*/
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_res, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1577, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1576
 *                 'S', size, rpos, rpos, qpos, qpos + size, chrom, strand))
 *             qpos += size
 *         elif code == 'H':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
*/
      goto __pyx_L7;
    }

    /* "HTSeq/_HTSeq.pyx":1579
 *             res.append(CigarOperation(
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         elif code == 'P':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'P', size, rpos, rpos, qpos, qpos, chrom, strand))
*/
    __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_code, __pyx_mstate_global->__pyx_n_u_P, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1579, __pyx_L1_error)
    if (likely(__pyx_t_9)) {

      /* "HTSeq/_HTSeq.pyx":1580
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         elif code == 'P':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'P', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         else:
*/
      __pyx_t_5 = NULL;

      /* "HTSeq/_HTSeq.pyx":1581
 *         elif code == 'P':
 *             res.append(CigarOperation(
 *                 'P', size, rpos, rpos, qpos, qpos, chrom, strand))             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Unknown CIGAR code '%s' encountered." % code)
*/
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_rpos); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_qpos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = 1;
      {
        PyObject *__pyx_callargs[9] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_P, __pyx_t_4, __pyx_t_6, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_v_chrom, __pyx_v_strand};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation, __pyx_callargs+__pyx_t_14, (9-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1580, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_3);
      }

      /* "HTSeq/_HTSeq.pyx":1580
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         elif code == 'P':
 *             res.append(CigarOperation(             # <<<<<<<<<<<<<<
 *                 'P', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         else:
*/
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_res, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1580, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;

      /* "HTSeq/_HTSeq.pyx":1579
 *             res.append(CigarOperation(
 *                 'H', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         elif code == 'P':             # <<<<<<<<<<<<<<
 *             res.append(CigarOperation(
 *                 'P', size, rpos, rpos, qpos, qpos, chrom, strand))
*/
      goto __pyx_L7;
    }

    /* "HTSeq/_HTSeq.pyx":1583
 *                 'P', size, rpos, rpos, qpos, qpos, chrom, strand))
 *         else:
 *             raise ValueError("Unknown CIGAR code '%s' encountered." % code)             # <<<<<<<<<<<<<<
 *     return res
 * 
*/
    /*else*/ {
      __pyx_t_13 = NULL;
      __pyx_t_12 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Unknown_CIGAR_code_s_encountered, __pyx_v_code); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1583, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_14 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__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_3)) __PYX_ERR(0, 1583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1583, __pyx_L1_error)
    }
    __pyx_L7:;

    /* "HTSeq/_HTSeq.pyx":1554
 *     qpos = 0
 *     res = []
 *     for code, size in cigar_pairs:             # <<<<<<<<<<<<<<
 *         if code == 'M' or code == '=' or code == 'X':
 *             res.append(CigarOperation(
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1584
 *         else:
 *             raise ValueError("Unknown CIGAR code '%s' encountered." % code)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1547
 * 
 * 
 * cpdef list build_cigar_list(list cigar_pairs, int ref_left=0, str chrom="", str strand="."):             # <<<<<<<<<<<<<<
 *     cdef list split_cigar, res
 *     cdef int rpos, qpos, size
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("HTSeq._HTSeq.build_cigar_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13build_cigar_list(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_5HTSeq_6_HTSeq_13build_cigar_list = {"build_cigar_list", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13build_cigar_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13build_cigar_list(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_cigar_pairs = 0;
  int __pyx_v_ref_left;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_strand = 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("build_cigar_list (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_cigar_pairs,&__pyx_mstate_global->__pyx_n_u_ref_left,&__pyx_mstate_global->__pyx_n_u_chrom,&__pyx_mstate_global->__pyx_n_u_strand,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, 1547, __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, 1547, __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, 1547, __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, 1547, __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, 1547, __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, "build_cigar_list", 0) < (0)) __PYX_ERR(0, 1547, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__8));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("build_cigar_list", 0, 1, 4, i); __PYX_ERR(0, 1547, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1547, __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, 1547, __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, 1547, __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, 1547, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__8));
    }
    __pyx_v_cigar_pairs = ((PyObject*)values[0]);
    if (values[1]) {
      __pyx_v_ref_left = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_ref_left == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1547, __pyx_L3_error)
    } else {
      __pyx_v_ref_left = ((int)0);
    }
    __pyx_v_chrom = ((PyObject*)values[2]);
    __pyx_v_strand = ((PyObject*)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_cigar_list", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 1547, __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("HTSeq._HTSeq.build_cigar_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cigar_pairs), (&PyList_Type), 1, "cigar_pairs", 1))) __PYX_ERR(0, 1547, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyUnicode_Type), 1, "chrom", 1))) __PYX_ERR(0, 1547, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strand), (&PyUnicode_Type), 1, "strand", 1))) __PYX_ERR(0, 1547, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_12build_cigar_list(__pyx_self, __pyx_v_cigar_pairs, __pyx_v_ref_left, __pyx_v_chrom, __pyx_v_strand);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_12build_cigar_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cigar_pairs, int __pyx_v_ref_left, PyObject *__pyx_v_chrom, PyObject *__pyx_v_strand) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_cigar_list", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.ref_left = __pyx_v_ref_left;
  __pyx_t_2.chrom = __pyx_v_chrom;
  __pyx_t_2.strand = __pyx_v_strand;
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(__pyx_v_cigar_pairs, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.build_cigar_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1600
 *     """
 * 
 *     def __init__(self, read, iv):             # <<<<<<<<<<<<<<
 *         self._read = read
 *         self.iv = iv
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_read = 0;
  PyObject *__pyx_v_iv = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_read,&__pyx_mstate_global->__pyx_n_u_iv,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, 1600, __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, 1600, __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, 1600, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1600, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1600, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1600, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1600, __pyx_L3_error)
    }
    __pyx_v_read = values[0];
    __pyx_v_iv = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1600, __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("HTSeq._HTSeq.Alignment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self), __pyx_v_read, __pyx_v_iv);

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

static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment___init__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_read, PyObject *__pyx_v_iv) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":1601
 * 
 *     def __init__(self, read, iv):
 *         self._read = read             # <<<<<<<<<<<<<<
 *         self.iv = iv
 * 
*/
  __pyx_t_1 = __pyx_v_read;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_read);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_read);
  __pyx_v_self->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1602
 *     def __init__(self, read, iv):
 *         self._read = read
 *         self.iv = iv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_v_iv;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->iv);
  __Pyx_DECREF((PyObject *)__pyx_v_self->iv);
  __pyx_v_self->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1600
 *     """
 * 
 *     def __init__(self, read, iv):             # <<<<<<<<<<<<<<
 *         self._read = read
 *         self.iv = iv
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Alignment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1604
 *         self.iv = iv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def read(self):
 *         return self._read
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_4read_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_4read_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_4read___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_4read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1606
 *     @property
 *     def read(self):
 *         return self._read             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->_read);
  __pyx_r = ((PyObject *)__pyx_v_self->_read);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1604
 *         self.iv = iv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def read(self):
 *         return self._read
*/

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

/* "HTSeq/_HTSeq.pyx":1608
 *         return self._read
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         cdef str s
 *         if self.paired_end:
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_2__repr__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
  PyObject *__pyx_v_s = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[9];
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[7];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "HTSeq/_HTSeq.pyx":1610
 *     def __repr__(self):
 *         cdef str s
 *         if self.paired_end:             # <<<<<<<<<<<<<<
 *             s = "Paired-end read"
 *         else:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_paired_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":1611
 *         cdef str s
 *         if self.paired_end:
 *             s = "Paired-end read"             # <<<<<<<<<<<<<<
 *         else:
 *             s = "Read"
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Paired_end_read);
    __pyx_v_s = __pyx_mstate_global->__pyx_kp_u_Paired_end_read;

    /* "HTSeq/_HTSeq.pyx":1610
 *     def __repr__(self):
 *         cdef str s
 *         if self.paired_end:             # <<<<<<<<<<<<<<
 *             s = "Paired-end read"
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1613
 *             s = "Paired-end read"
 *         else:
 *             s = "Read"             # <<<<<<<<<<<<<<
 *         if self.aligned:
 *             return "<%s object: %s '%s' aligned to %s>" % (
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Read);
    __pyx_v_s = __pyx_mstate_global->__pyx_n_u_Read;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1614
 *         else:
 *             s = "Read"
 *         if self.aligned:             # <<<<<<<<<<<<<<
 *             return "<%s object: %s '%s' aligned to %s>" % (
 *                 self.__class__.__name__, s, self.read.name, str(self.iv))
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_aligned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":1615
 *             s = "Read"
 *         if self.aligned:
 *             return "<%s object: %s '%s' aligned to %s>" % (             # <<<<<<<<<<<<<<
 *                 self.__class__.__name__, s, self.read.name, str(self.iv))
 *         else:
*/
    __Pyx_XDECREF(__pyx_r);

    /* "HTSeq/_HTSeq.pyx":1616
 *         if self.aligned:
 *             return "<%s object: %s '%s' aligned to %s>" % (
 *                 self.__class__.__name__, s, self.read.name, str(self.iv))             # <<<<<<<<<<<<<<
 *         else:
 *             return "<%s object: %s '%s', not aligned>" % (
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_4), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self->iv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u__2;
    __pyx_t_5[1] = __pyx_t_1;
    __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_object_3;
    __pyx_t_5[3] = __pyx_v_s;
    __pyx_t_5[4] = __pyx_mstate_global->__pyx_kp_u__30;
    __pyx_t_5[5] = __pyx_t_3;
    __pyx_t_5[6] = __pyx_mstate_global->__pyx_kp_u_aligned_to;
    __pyx_t_5[7] = __pyx_t_4;
    __pyx_t_5[8] = __pyx_mstate_global->__pyx_kp_u__15;

    /* "HTSeq/_HTSeq.pyx":1615
 *             s = "Read"
 *         if self.aligned:
 *             return "<%s object: %s '%s' aligned to %s>" % (             # <<<<<<<<<<<<<<
 *                 self.__class__.__name__, s, self.read.name, str(self.iv))
 *         else:
*/
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 9, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_s) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_s) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1614
 *         else:
 *             s = "Read"
 *         if self.aligned:             # <<<<<<<<<<<<<<
 *             return "<%s object: %s '%s' aligned to %s>" % (
 *                 self.__class__.__name__, s, self.read.name, str(self.iv))
*/
  }

  /* "HTSeq/_HTSeq.pyx":1618
 *                 self.__class__.__name__, s, self.read.name, str(self.iv))
 *         else:
 *             return "<%s object: %s '%s', not aligned>" % (             # <<<<<<<<<<<<<<
 *                 self.__class__.__name__, s, self.read.name)
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);

    /* "HTSeq/_HTSeq.pyx":1619
 *         else:
 *             return "<%s object: %s '%s', not aligned>" % (
 *                 self.__class__.__name__, s, self.read.name)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_4), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u__2;
    __pyx_t_7[1] = __pyx_t_6;
    __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_object_3;
    __pyx_t_7[3] = __pyx_v_s;
    __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u__30;
    __pyx_t_7[5] = __pyx_t_4;
    __pyx_t_7[6] = __pyx_mstate_global->__pyx_kp_u_not_aligned;

    /* "HTSeq/_HTSeq.pyx":1618
 *                 self.__class__.__name__, s, self.read.name, str(self.iv))
 *         else:
 *             return "<%s object: %s '%s', not aligned>" % (             # <<<<<<<<<<<<<<
 *                 self.__class__.__name__, s, self.read.name)
 * 
*/
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_7, 7, 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_s) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 15, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_s) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "HTSeq/_HTSeq.pyx":1608
 *         return self._read
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         cdef str s
 *         if self.paired_end:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("HTSeq._HTSeq.Alignment.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1621
 *                 self.__class__.__name__, s, self.read.name)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def paired_end(self):
 *         return False
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_10paired_end_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_10paired_end_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_10paired_end___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_10paired_end___get__(CYTHON_UNUSED struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1623
 *     @property
 *     def paired_end(self):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1621
 *                 self.__class__.__name__, s, self.read.name)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def paired_end(self):
 *         return False
*/

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

/* "HTSeq/_HTSeq.pyx":1625
 *         return False
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def aligned(self):
 *         """Returns True unless self.iv is None. The latter indicates that
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_7aligned_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_7aligned_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_7aligned___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_7aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1630
 *         this record decribes a read for which no alignment was found.
 *         """
 *         return self.iv is not None             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (((PyObject *)__pyx_v_self->iv) != Py_None);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1625
 *         return False
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def aligned(self):
 *         """Returns True unless self.iv is None. The latter indicates that
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.Alignment.aligned.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":43
 * 
 * cdef class Alignment(object):
 *    cdef public SequenceWithQualities _read             # <<<<<<<<<<<<<<
 *    cdef public GenomicInterval iv
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->_read);
  __pyx_r = ((PyObject *)__pyx_v_self->_read);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 43, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_read);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_read);
  __pyx_v_self->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Alignment._read.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_5_read_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_read);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_read);
  __pyx_v_self->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None);

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

/* "HTSeq/_HTSeq.pxd":44
 * cdef class Alignment(object):
 *    cdef public SequenceWithQualities _read
 *    cdef public GenomicInterval iv             # <<<<<<<<<<<<<<
 * 
 * cdef class AlignmentWithSequenceReversal(Alignment):
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv___get__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->iv);
  __pyx_r = ((PyObject *)__pyx_v_self->iv);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(2, 44, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->iv);
  __Pyx_DECREF((PyObject *)__pyx_v_self->iv);
  __pyx_v_self->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.Alignment.iv.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_9Alignment_2iv_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->iv);
  __Pyx_DECREF((PyObject *)__pyx_v_self->iv);
  __pyx_v_self->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_9Alignment_4__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._read, self.iv)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self->_read);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->_read);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->_read)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->iv);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->iv);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->iv)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._read, self.iv)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self._read, self.iv)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(3, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(3, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._read is not None or self.iv is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._read, self.iv)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._read is not None or self.iv is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, None), state
*/
  /*else*/ {
    __pyx_t_3 = (((PyObject *)__pyx_v_self->_read) != Py_None);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (((PyObject *)__pyx_v_self->iv) != Py_None);
    __pyx_t_2 = __pyx_t_3;
    __pyx_L6_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._read is not None or self.iv is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._read is not None or self.iv is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Alignment); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1450081);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1450081);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_1450081) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._read is not None or self.iv is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, None), state
 *     else:
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Alignment__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Alignment); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1450081);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1450081);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_1450081) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.Alignment.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Alignment__set_state(self, __pyx_state)
*/

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

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Alignment__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(3, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(3, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_Alignment__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Alignment__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.Alignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1643
 *     """
 * 
 *     def __init__(self, SequenceWithQualities read_as_aligned, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         self.read_as_aligned = read_as_aligned
 *         self._read_as_sequenced = None
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_read_as_aligned = 0;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_read_as_aligned,&__pyx_mstate_global->__pyx_n_u_iv,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, 1643, __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, 1643, __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, 1643, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1643, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1643, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1643, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1643, __pyx_L3_error)
    }
    __pyx_v_read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)values[0]);
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1643, __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("HTSeq._HTSeq.AlignmentWithSequenceReversal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read_as_aligned), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, 1, "read_as_aligned", 0))) __PYX_ERR(0, 1643, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iv), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, 1, "iv", 0))) __PYX_ERR(0, 1643, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self), __pyx_v_read_as_aligned, __pyx_v_iv);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal___init__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_read_as_aligned, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":1644
 * 
 *     def __init__(self, SequenceWithQualities read_as_aligned, GenomicInterval iv):
 *         self.read_as_aligned = read_as_aligned             # <<<<<<<<<<<<<<
 *         self._read_as_sequenced = None
 *         self.iv = iv
*/
  __Pyx_INCREF((PyObject *)__pyx_v_read_as_aligned);
  __Pyx_GIVEREF((PyObject *)__pyx_v_read_as_aligned);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->read_as_aligned);
  __Pyx_DECREF((PyObject *)__pyx_v_self->read_as_aligned);
  __pyx_v_self->read_as_aligned = __pyx_v_read_as_aligned;

  /* "HTSeq/_HTSeq.pyx":1645
 *     def __init__(self, SequenceWithQualities read_as_aligned, GenomicInterval iv):
 *         self.read_as_aligned = read_as_aligned
 *         self._read_as_sequenced = None             # <<<<<<<<<<<<<<
 *         self.iv = iv
 * 
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_as_sequenced);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_read_as_sequenced);
  __pyx_v_self->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None);

  /* "HTSeq/_HTSeq.pyx":1646
 *         self.read_as_aligned = read_as_aligned
 *         self._read_as_sequenced = None
 *         self.iv = iv             # <<<<<<<<<<<<<<
 * 
 *     property read:
*/
  __Pyx_INCREF((PyObject *)__pyx_v_iv);
  __Pyx_GIVEREF((PyObject *)__pyx_v_iv);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.iv);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.iv);
  __pyx_v_self->__pyx_base.iv = __pyx_v_iv;

  /* "HTSeq/_HTSeq.pyx":1643
 *     """
 * 
 *     def __init__(self, SequenceWithQualities read_as_aligned, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         self.read_as_aligned = read_as_aligned
 *         self._read_as_sequenced = None
*/

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

/* "HTSeq/_HTSeq.pyx":1649
 * 
 *     property read:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._read_as_sequenced is None:
 *                 if (not self.aligned) or self.iv.strand != "-":
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1650
 *     property read:
 *         def __get__(self):
 *             if self._read_as_sequenced is None:             # <<<<<<<<<<<<<<
 *                 if (not self.aligned) or self.iv.strand != "-":
 *                     self._read_as_sequenced = self.read_as_aligned
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_read_as_sequenced) == Py_None);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1651
 *         def __get__(self):
 *             if self._read_as_sequenced is None:
 *                 if (not self.aligned) or self.iv.strand != "-":             # <<<<<<<<<<<<<<
 *                     self._read_as_sequenced = self.read_as_aligned
 *                 else:
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_aligned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (!__pyx_t_3);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_1 = __pyx_t_4;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__18, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":1652
 *             if self._read_as_sequenced is None:
 *                 if (not self.aligned) or self.iv.strand != "-":
 *                     self._read_as_sequenced = self.read_as_aligned             # <<<<<<<<<<<<<<
 *                 else:
 *                     self._read_as_sequenced = self.read_as_aligned.get_reverse_complement()
*/
      __pyx_t_2 = ((PyObject *)__pyx_v_self->read_as_aligned);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_as_sequenced);
      __Pyx_DECREF((PyObject *)__pyx_v_self->_read_as_sequenced);
      __pyx_v_self->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "HTSeq/_HTSeq.pyx":1651
 *         def __get__(self):
 *             if self._read_as_sequenced is None:
 *                 if (not self.aligned) or self.iv.strand != "-":             # <<<<<<<<<<<<<<
 *                     self._read_as_sequenced = self.read_as_aligned
 *                 else:
*/
      goto __pyx_L4;
    }

    /* "HTSeq/_HTSeq.pyx":1654
 *                     self._read_as_sequenced = self.read_as_aligned
 *                 else:
 *                     self._read_as_sequenced = self.read_as_aligned.get_reverse_complement()             # <<<<<<<<<<<<<<
 *                     self._read_as_sequenced.name = self.read_as_aligned.name
 *             return self._read_as_sequenced
*/
    /*else*/ {
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_v_self->read_as_aligned->__pyx_base.__pyx_vtab)->get_reverse_complement(__pyx_v_self->read_as_aligned, 0, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_as_sequenced);
      __Pyx_DECREF((PyObject *)__pyx_v_self->_read_as_sequenced);
      __pyx_v_self->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "HTSeq/_HTSeq.pyx":1655
 *                 else:
 *                     self._read_as_sequenced = self.read_as_aligned.get_reverse_complement()
 *                     self._read_as_sequenced.name = self.read_as_aligned.name             # <<<<<<<<<<<<<<
 *             return self._read_as_sequenced
 *         # def __set__( self, read ):
*/
      __pyx_t_2 = __pyx_v_self->read_as_aligned->__pyx_base.name;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->_read_as_sequenced->__pyx_base.name);
      __Pyx_DECREF(__pyx_v_self->_read_as_sequenced->__pyx_base.name);
      __pyx_v_self->_read_as_sequenced->__pyx_base.name = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L4:;

    /* "HTSeq/_HTSeq.pyx":1650
 *     property read:
 *         def __get__(self):
 *             if self._read_as_sequenced is None:             # <<<<<<<<<<<<<<
 *                 if (not self.aligned) or self.iv.strand != "-":
 *                     self._read_as_sequenced = self.read_as_aligned
*/
  }

  /* "HTSeq/_HTSeq.pyx":1656
 *                     self._read_as_sequenced = self.read_as_aligned.get_reverse_complement()
 *                     self._read_as_sequenced.name = self.read_as_aligned.name
 *             return self._read_as_sequenced             # <<<<<<<<<<<<<<
 *         # def __set__( self, read ):
 *         #   self.read_as_aligned = read
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->_read_as_sequenced);
  __pyx_r = ((PyObject *)__pyx_v_self->_read_as_sequenced);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1649
 * 
 *     property read:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._read_as_sequenced is None:
 *                 if (not self.aligned) or self.iv.strand != "-":
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal.read.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":47
 * 
 * cdef class AlignmentWithSequenceReversal(Alignment):
 *    cdef public SequenceWithQualities read_as_aligned             # <<<<<<<<<<<<<<
 *    cdef public SequenceWithQualities _read_as_sequenced
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->read_as_aligned);
  __pyx_r = ((PyObject *)__pyx_v_self->read_as_aligned);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 47, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->read_as_aligned);
  __Pyx_DECREF((PyObject *)__pyx_v_self->read_as_aligned);
  __pyx_v_self->read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal.read_as_aligned.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->read_as_aligned);
  __Pyx_DECREF((PyObject *)__pyx_v_self->read_as_aligned);
  __pyx_v_self->read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None);

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

/* "HTSeq/_HTSeq.pxd":48
 * cdef class AlignmentWithSequenceReversal(Alignment):
 *    cdef public SequenceWithQualities read_as_aligned
 *    cdef public SequenceWithQualities _read_as_sequenced             # <<<<<<<<<<<<<<
 * 
 * cdef class SAM_Alignment(AlignmentWithSequenceReversal):
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced___get__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->_read_as_sequenced);
  __pyx_r = ((PyObject *)__pyx_v_self->_read_as_sequenced);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_as_sequenced);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_read_as_sequenced);
  __pyx_v_self->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal._read_as_sequenced.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_as_sequenced);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_read_as_sequenced);
  __pyx_v_self->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None);

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_2__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base._read);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base._read);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->__pyx_base._read)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->_read_as_sequenced);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->_read_as_sequenced);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->_read_as_sequenced)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.iv);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.iv);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->__pyx_base.iv)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->read_as_aligned);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->read_as_aligned);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_self->read_as_aligned)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(3, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(3, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, None), state
*/
  /*else*/ {
    __pyx_t_3 = (((PyObject *)__pyx_v_self->__pyx_base._read) != Py_None);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (((PyObject *)__pyx_v_self->_read_as_sequenced) != Py_None);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (((PyObject *)__pyx_v_self->__pyx_base.iv) != Py_None);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (((PyObject *)__pyx_v_self->read_as_aligned) != Py_None);
    __pyx_t_2 = __pyx_t_3;
    __pyx_L6_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None
 *     if use_setstate:
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_AlignmentWithSequ); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_246267685);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_246267685);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_246267685) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, None), state
 *     else:
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_AlignmentWithSequ); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_246267685);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_246267685);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_246267685) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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(3, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(3, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(3, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__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_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(3, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(3, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_AlignmentWithSequenceReversal__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.AlignmentWithSequenceReversal.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1674
 *     cdef public str substitutions
 * 
 *     def __init__(self, bowtie_line):             # <<<<<<<<<<<<<<
 *         cdef str readId, strand, chrom, position, read, qual
 *         cdef int positionint
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bowtie_line = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bowtie_line,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, 1674, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1674, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 1674, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1674, __pyx_L3_error)
    }
    __pyx_v_bowtie_line = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1674, __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("HTSeq._HTSeq.BowtieAlignment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment___init__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self), __pyx_v_bowtie_line);

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

static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment___init__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_bowtie_line) {
  PyObject *__pyx_v_readId = 0;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_position = 0;
  PyObject *__pyx_v_read = 0;
  PyObject *__pyx_v_qual = 0;
  int __pyx_v_positionint;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "HTSeq/_HTSeq.pyx":1678
 *         cdef int positionint
 *         (readId, strand, chrom, position, read, qual,
 *          self.reserved, self.substitutions) = bowtie_line.split('\t')             # <<<<<<<<<<<<<<
 *         positionint = int(position)
 *         AlignmentWithSequenceReversal.__init__(self,
*/
  __pyx_t_2 = __pyx_v_bowtie_line;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__19};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __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 != 8)) {
      if (size > 8) __Pyx_RaiseTooManyValuesError(8);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1677, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 7);
      __Pyx_INCREF(__pyx_t_10);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1677, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1677, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1677, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 4, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1677, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 5, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1677, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 6, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1677, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 7, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1677, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_10);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[8] = {&__pyx_t_2,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
      for (i=0; i < 8; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1677, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[8] = {&__pyx_t_2,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
    __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
    for (index=0; index < 8; index++) {
      PyObject* item = __pyx_t_12(__pyx_t_11); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 8) < (0)) __PYX_ERR(0, 1677, __pyx_L1_error)
    __pyx_t_12 = NULL;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_12 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1677, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }

  /* "HTSeq/_HTSeq.pyx":1677
 *         cdef str readId, strand, chrom, position, read, qual
 *         cdef int positionint
 *         (readId, strand, chrom, position, read, qual,             # <<<<<<<<<<<<<<
 *          self.reserved, self.substitutions) = bowtie_line.split('\t')
 *         positionint = int(position)
*/
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1677, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 1677, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 1677, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(0, 1677, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_7))) __PYX_ERR(0, 1677, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1677, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 1677, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_10))) __PYX_ERR(0, 1677, __pyx_L1_error)
  __pyx_v_readId = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_v_strand = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_v_chrom = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_v_position = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_v_read = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_v_qual = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1678
 *         cdef int positionint
 *         (readId, strand, chrom, position, read, qual,
 *          self.reserved, self.substitutions) = bowtie_line.split('\t')             # <<<<<<<<<<<<<<
 *         positionint = int(position)
 *         AlignmentWithSequenceReversal.__init__(self,
*/
  __Pyx_GIVEREF(__pyx_t_9);
  __Pyx_GOTREF(__pyx_v_self->reserved);
  __Pyx_DECREF(__pyx_v_self->reserved);
  __pyx_v_self->reserved = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  __Pyx_GIVEREF(__pyx_t_10);
  __Pyx_GOTREF(__pyx_v_self->substitutions);
  __Pyx_DECREF(__pyx_v_self->substitutions);
  __pyx_v_self->substitutions = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "HTSeq/_HTSeq.pyx":1679
 *         (readId, strand, chrom, position, read, qual,
 *          self.reserved, self.substitutions) = bowtie_line.split('\t')
 *         positionint = int(position)             # <<<<<<<<<<<<<<
 *         AlignmentWithSequenceReversal.__init__(self,
 *                                                SequenceWithQualities(
*/
  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_13 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_positionint = __pyx_t_13;

  /* "HTSeq/_HTSeq.pyx":1680
 *          self.reserved, self.substitutions) = bowtie_line.split('\t')
 *         positionint = int(position)
 *         AlignmentWithSequenceReversal.__init__(self,             # <<<<<<<<<<<<<<
 *                                                SequenceWithQualities(
 *                                                    read, readId, qual),
*/
  __pyx_t_10 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal);
  __Pyx_INCREF(__pyx_t_10);

  /* "HTSeq/_HTSeq.pyx":1681
 *         positionint = int(position)
 *         AlignmentWithSequenceReversal.__init__(self,
 *                                                SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                                                    read, readId, qual),
 *                                                GenomicInterval(chrom, positionint, positionint + len(read), strand))
*/
  __pyx_t_8 = NULL;

  /* "HTSeq/_HTSeq.pyx":1682
 *         AlignmentWithSequenceReversal.__init__(self,
 *                                                SequenceWithQualities(
 *                                                    read, readId, qual),             # <<<<<<<<<<<<<<
 *                                                GenomicInterval(chrom, positionint, positionint + len(read), strand))
 * 
*/
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_v_read, __pyx_v_readId, __pyx_v_qual};
    __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_9);
  }

  /* "HTSeq/_HTSeq.pyx":1683
 *                                                SequenceWithQualities(
 *                                                    read, readId, qual),
 *                                                GenomicInterval(chrom, positionint, positionint + len(read), strand))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_7 = NULL;
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_positionint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(__pyx_v_read == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1683, __pyx_L1_error)
  }
  __pyx_t_14 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_read); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1683, __pyx_L1_error)
  __pyx_t_5 = PyLong_FromSsize_t((__pyx_v_positionint + __pyx_t_14)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_chrom, __pyx_t_6, __pyx_t_5, __pyx_v_strand};
    __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_8);
  }
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_10, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_t_9), ((PyObject *)__pyx_t_8)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1674
 *     cdef public str substitutions
 * 
 *     def __init__(self, bowtie_line):             # <<<<<<<<<<<<<<
 *         cdef str readId, strand, chrom, position, read, qual
 *         cdef int positionint
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_readId);
  __Pyx_XDECREF(__pyx_v_strand);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_position);
  __Pyx_XDECREF(__pyx_v_read);
  __Pyx_XDECREF(__pyx_v_qual);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1671
 *     """
 * 
 *     cdef public str reserved             # <<<<<<<<<<<<<<
 *     cdef public str substitutions
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved___get__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->reserved);
  __pyx_r = __pyx_v_self->reserved;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1671, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->reserved);
  __Pyx_DECREF(__pyx_v_self->reserved);
  __pyx_v_self->reserved = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.reserved.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->reserved);
  __Pyx_DECREF(__pyx_v_self->reserved);
  __pyx_v_self->reserved = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pyx":1672
 * 
 *     cdef public str reserved
 *     cdef public str substitutions             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, bowtie_line):
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions___get__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->substitutions);
  __pyx_r = __pyx_v_self->substitutions;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1672, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->substitutions);
  __Pyx_DECREF(__pyx_v_self->substitutions);
  __pyx_v_self->substitutions = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.substitutions.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->substitutions);
  __Pyx_DECREF(__pyx_v_self->substitutions);
  __pyx_v_self->substitutions = ((PyObject*)Py_None);

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_2__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned, self.reserved, self.substitutions)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->reserved);
  __Pyx_GIVEREF(__pyx_v_self->reserved);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_self->reserved) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->substitutions);
  __Pyx_GIVEREF(__pyx_v_self->substitutions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_self->substitutions) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned, self.reserved, self.substitutions)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned, self.reserved, self.substitutions)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(3, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(3, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None or self.reserved is not None or self.substitutions is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._read, self._read_as_sequenced, self.iv, self.read_as_aligned, self.reserved, self.substitutions)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None or self.reserved is not None or self.substitutions is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, None), state
*/
  /*else*/ {
    __pyx_t_3 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read) != Py_None);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced) != Py_None);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv) != Py_None);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned) != Py_None);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_self->reserved != ((PyObject*)Py_None));
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_self->substitutions != ((PyObject*)Py_None));
    __pyx_t_2 = __pyx_t_3;
    __pyx_L6_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None or self.reserved is not None or self.substitutions is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None or self.reserved is not None or self.substitutions is not None
 *     if use_setstate:
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_BowtieAlignment); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_240641895);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_240641895);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_240641895) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.iv is not None or self.read_as_aligned is not None or self.reserved is not None or self.substitutions is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, None), state
 *     else:
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_BowtieAlignment); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_240641895);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_240641895);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_240641895) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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(3, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(3, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(3, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_15BowtieAlignment_4__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__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_5HTSeq_6_HTSeq_15BowtieAlignment_4__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(3, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(3, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_BowtieAlignment__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.BowtieAlignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1686
 * 
 * 
 * cdef _parse_SAM_optional_field_value(str field):             # <<<<<<<<<<<<<<
 *     if len(field) < 5 or field[2] != ':' or field[4] != ':':
 *         raise ValueError("Malformatted SAM optional field '%'" % field)
*/

static PyObject *__pyx_f_5HTSeq_6_HTSeq__parse_SAM_optional_field_value(PyObject *__pyx_v_field) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  double __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_SAM_optional_field_value", 0);

  /* "HTSeq/_HTSeq.pyx":1687
 * 
 * cdef _parse_SAM_optional_field_value(str field):
 *     if len(field) < 5 or field[2] != ':' or field[4] != ':':             # <<<<<<<<<<<<<<
 *         raise ValueError("Malformatted SAM optional field '%'" % field)
 *     if field[3] == 'A':
*/
  if (unlikely(__pyx_v_field == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1687, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_field); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1687, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 < 5);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1687, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 58);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1687, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 58);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":1688
 * cdef _parse_SAM_optional_field_value(str field):
 *     if len(field) < 5 or field[2] != ':' or field[4] != ':':
 *         raise ValueError("Malformatted SAM optional field '%'" % field)             # <<<<<<<<<<<<<<
 *     if field[3] == 'A':
 *         return field[5]
*/
    __pyx_t_6 = NULL;
    __pyx_t_7 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Malformatted_SAM_optional_field, __pyx_v_field); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1688, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1687
 * 
 * cdef _parse_SAM_optional_field_value(str field):
 *     if len(field) < 5 or field[2] != ':' or field[4] != ':':             # <<<<<<<<<<<<<<
 *         raise ValueError("Malformatted SAM optional field '%'" % field)
 *     if field[3] == 'A':
*/
  }

  /* "HTSeq/_HTSeq.pyx":1689
 *     if len(field) < 5 or field[2] != ':' or field[4] != ':':
 *         raise ValueError("Malformatted SAM optional field '%'" % field)
 *     if field[3] == 'A':             # <<<<<<<<<<<<<<
 *         return field[5]
 *     elif field[3] == 'i':
*/
  __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1689, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_4 == 65);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1690
 *         raise ValueError("Malformatted SAM optional field '%'" % field)
 *     if field[3] == 'A':
 *         return field[5]             # <<<<<<<<<<<<<<
 *     elif field[3] == 'i':
 *         return int(field[5:])
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1690, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1689
 *     if len(field) < 5 or field[2] != ':' or field[4] != ':':
 *         raise ValueError("Malformatted SAM optional field '%'" % field)
 *     if field[3] == 'A':             # <<<<<<<<<<<<<<
 *         return field[5]
 *     elif field[3] == 'i':
*/
  }

  /* "HTSeq/_HTSeq.pyx":1691
 *     if field[3] == 'A':
 *         return field[5]
 *     elif field[3] == 'i':             # <<<<<<<<<<<<<<
 *         return int(field[5:])
 *     elif field[3] == 'f':
*/
  __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_4 == 0x69);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1692
 *         return field[5]
 *     elif field[3] == 'i':
 *         return int(field[5:])             # <<<<<<<<<<<<<<
 *     elif field[3] == 'f':
 *         return float(field[5:])
*/
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_field == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1692, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_field, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1691
 *     if field[3] == 'A':
 *         return field[5]
 *     elif field[3] == 'i':             # <<<<<<<<<<<<<<
 *         return int(field[5:])
 *     elif field[3] == 'f':
*/
  }

  /* "HTSeq/_HTSeq.pyx":1693
 *     elif field[3] == 'i':
 *         return int(field[5:])
 *     elif field[3] == 'f':             # <<<<<<<<<<<<<<
 *         return float(field[5:])
 *     elif field[3] == 'Z':
*/
  __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1693, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_4 == 0x66);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1694
 *         return int(field[5:])
 *     elif field[3] == 'f':
 *         return float(field[5:])             # <<<<<<<<<<<<<<
 *     elif field[3] == 'Z':
 *         return field[5:]
*/
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_field == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1694, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyUnicode_Substring(__pyx_v_field, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyUnicode_AsDouble(__pyx_t_7); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_9, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyFloat_FromDouble(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1693
 *     elif field[3] == 'i':
 *         return int(field[5:])
 *     elif field[3] == 'f':             # <<<<<<<<<<<<<<
 *         return float(field[5:])
 *     elif field[3] == 'Z':
*/
  }

  /* "HTSeq/_HTSeq.pyx":1695
 *     elif field[3] == 'f':
 *         return float(field[5:])
 *     elif field[3] == 'Z':             # <<<<<<<<<<<<<<
 *         return field[5:]
 *     elif field[3] == 'H':
*/
  __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1695, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_4 == 90);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1696
 *         return float(field[5:])
 *     elif field[3] == 'Z':
 *         return field[5:]             # <<<<<<<<<<<<<<
 *     elif field[3] == 'H':
 *         return int(field[5:], 16)
*/
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_field == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1696, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyUnicode_Substring(__pyx_v_field, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1695
 *     elif field[3] == 'f':
 *         return float(field[5:])
 *     elif field[3] == 'Z':             # <<<<<<<<<<<<<<
 *         return field[5:]
 *     elif field[3] == 'H':
*/
  }

  /* "HTSeq/_HTSeq.pyx":1697
 *     elif field[3] == 'Z':
 *         return field[5:]
 *     elif field[3] == 'H':             # <<<<<<<<<<<<<<
 *         return int(field[5:], 16)
 *     elif field[3] == 'B':
*/
  __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1697, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_4 == 72);
  if (__pyx_t_1) {

    /* "HTSeq/_HTSeq.pyx":1698
 *         return field[5:]
 *     elif field[3] == 'H':
 *         return int(field[5:], 16)             # <<<<<<<<<<<<<<
 *     elif field[3] == 'B':
 *         if field[5] == 'f':
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = NULL;
    if (unlikely(__pyx_v_field == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1698, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_field, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_mstate_global->__pyx_int_16};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(&PyLong_Type), __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__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_7)) __PYX_ERR(0, 1698, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":1697
 *     elif field[3] == 'Z':
 *         return field[5:]
 *     elif field[3] == 'H':             # <<<<<<<<<<<<<<
 *         return int(field[5:], 16)
 *     elif field[3] == 'B':
*/
  }

  /* "HTSeq/_HTSeq.pyx":1699
 *     elif field[3] == 'H':
 *         return int(field[5:], 16)
 *     elif field[3] == 'B':             # <<<<<<<<<<<<<<
 *         if field[5] == 'f':
 *             return numpy.array(field[7:].split(','), float)
*/
  __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1699, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_4 == 66);
  if (likely(__pyx_t_1)) {

    /* "HTSeq/_HTSeq.pyx":1700
 *         return int(field[5:], 16)
 *     elif field[3] == 'B':
 *         if field[5] == 'f':             # <<<<<<<<<<<<<<
 *             return numpy.array(field[7:].split(','), float)
 *         else:
*/
    __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1700, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_4 == 0x66);
    if (__pyx_t_1) {

      /* "HTSeq/_HTSeq.pyx":1701
 *     elif field[3] == 'B':
 *         if field[5] == 'f':
 *             return numpy.array(field[7:].split(','), float)             # <<<<<<<<<<<<<<
 *         else:
 *             return numpy.array(field[7:].split(','), int)
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__pyx_v_field == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 1701, __pyx_L1_error)
      }
      __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_field, 7, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = PyUnicode_Split(((PyObject*)__pyx_t_5), __pyx_mstate_global->__pyx_kp_u__4, -1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_11, ((PyObject *)(&PyFloat_Type))};
        __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1701, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":1700
 *         return int(field[5:], 16)
 *     elif field[3] == 'B':
 *         if field[5] == 'f':             # <<<<<<<<<<<<<<
 *             return numpy.array(field[7:].split(','), float)
 *         else:
*/
    }

    /* "HTSeq/_HTSeq.pyx":1703
 *             return numpy.array(field[7:].split(','), float)
 *         else:
 *             return numpy.array(field[7:].split(','), int)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError("SAM optional field with illegal type letter '%s'" % field[2])
*/
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(__pyx_v_field == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 1703, __pyx_L1_error)
      }
      __pyx_t_11 = __Pyx_PyUnicode_Substring(__pyx_v_field, 7, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = PyUnicode_Split(((PyObject*)__pyx_t_11), __pyx_mstate_global->__pyx_kp_u__4, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_5, ((PyObject *)(&PyLong_Type))};
        __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1703, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;
    }

    /* "HTSeq/_HTSeq.pyx":1699
 *     elif field[3] == 'H':
 *         return int(field[5:], 16)
 *     elif field[3] == 'B':             # <<<<<<<<<<<<<<
 *         if field[5] == 'f':
 *             return numpy.array(field[7:].split(','), float)
*/
  }

  /* "HTSeq/_HTSeq.pyx":1705
 *             return numpy.array(field[7:].split(','), int)
 *     else:
 *         raise ValueError("SAM optional field with illegal type letter '%s'" % field[2])             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __pyx_t_6 = NULL;
    __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_field, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 1705, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_SAM_optional_field_with_illegal, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_10};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(0, 1705, __pyx_L1_error)
  }

  /* "HTSeq/_HTSeq.pyx":1686
 * 
 * 
 * cdef _parse_SAM_optional_field_value(str field):             # <<<<<<<<<<<<<<
 *     if len(field) < 5 or field[2] != ':' or field[4] != ':':
 *         raise ValueError("Malformatted SAM optional field '%'" % field)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("HTSeq._HTSeq._parse_SAM_optional_field_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1717
 *     """
 * 
 *     def to_pysam_AlignedSegment(self, sf):             # <<<<<<<<<<<<<<
 *         try:
 *             import pysam
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment(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_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment = {"to_pysam_AlignedSegment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sf = 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("to_pysam_AlignedSegment (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_sf,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, 1717, __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, 1717, __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, "to_pysam_AlignedSegment", 0) < (0)) __PYX_ERR(0, 1717, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_pysam_AlignedSegment", 1, 1, 1, i); __PYX_ERR(0, 1717, __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, 1717, __pyx_L3_error)
    }
    __pyx_v_sf = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pysam_AlignedSegment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1717, __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("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_to_pysam_AlignedSegment(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), __pyx_v_sf);

  /* 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_5HTSeq_6_HTSeq_13SAM_Alignment_to_pysam_AlignedSegment(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_sf) {
  PyObject *__pyx_v_pysam = NULL;
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_pysam_AlignedSegment", 0);

  /* "HTSeq/_HTSeq.pyx":1718
 * 
 *     def to_pysam_AlignedSegment(self, sf):
 *         try:             # <<<<<<<<<<<<<<
 *             import pysam
 *         except ImportError:
*/
  {
    __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:*/ {

      /* "HTSeq/_HTSeq.pyx":1719
 *     def to_pysam_AlignedSegment(self, sf):
 *         try:
 *             import pysam             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             sys.stderr.write(
*/
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pysam, 0, 0, NULL, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1719, __pyx_L3_error)
      __pyx_t_4 = __pyx_t_5;
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pysam = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":1718
 * 
 *     def to_pysam_AlignedSegment(self, sf):
 *         try:             # <<<<<<<<<<<<<<
 *             import pysam
 *         except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":1720
 *         try:
 *             import pysam
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             sys.stderr.write(
 *                 "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 1720, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "HTSeq/_HTSeq.pyx":1721
 *             import pysam
 *         except ImportError:
 *             sys.stderr.write(             # <<<<<<<<<<<<<<
 *                 "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
 *             raise
*/
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1721, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1721, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_10 = __pyx_t_12;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_13 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_Please_Install_PySam_to_use_this};
        __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1721, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "HTSeq/_HTSeq.pyx":1723
 *             sys.stderr.write(
 *                 "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
 *             raise             # <<<<<<<<<<<<<<
 * 
 *         a = pysam.AlignedSegment()
*/
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_8);
      __pyx_t_4 = 0;  __pyx_t_7 = 0;  __pyx_t_8 = 0; 
      __PYX_ERR(0, 1723, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "HTSeq/_HTSeq.pyx":1718
 * 
 *     def to_pysam_AlignedSegment(self, sf):
 *         try:             # <<<<<<<<<<<<<<
 *             import pysam
 *         except ImportError:
*/
    __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:;
  }

  /* "HTSeq/_HTSeq.pyx":1725
 *             raise
 * 
 *         a = pysam.AlignedSegment()             # <<<<<<<<<<<<<<
 *         a.query_sequence = self.read.seq if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().seq
 *         a.query_qualities = self.read.qual if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().qual
*/
  __pyx_t_7 = __pyx_v_pysam;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_AlignedSegment, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_v_a = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1726
 * 
 *         a = pysam.AlignedSegment()
 *         a.query_sequence = self.read.seq if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().seq             # <<<<<<<<<<<<<<
 *         a.query_qualities = self.read.qual if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().qual
 *         a.query_name = self.read.name
*/
  __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_15) {
  } else {
    __pyx_t_14 = __pyx_t_15;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_15 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_14 = __pyx_t_15;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_14) {
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_seq); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = __pyx_t_9;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_13 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_reverse_complement, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1726, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_seq); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __pyx_t_9;
    __pyx_t_9 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_query_sequence, __pyx_t_8) < (0)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1727
 *         a = pysam.AlignedSegment()
 *         a.query_sequence = self.read.seq if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().seq
 *         a.query_qualities = self.read.qual if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().qual             # <<<<<<<<<<<<<<
 *         a.query_name = self.read.name
 *         a.flag = self.flag
*/
  __pyx_t_9 = PyObject_RichCompare(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (!__pyx_t_15) {
  } else {
    __pyx_t_14 = __pyx_t_15;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv), __pyx_mstate_global->__pyx_n_u_strand); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_15 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_mstate_global->__pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_14 = __pyx_t_15;
  __pyx_L13_bool_binop_done:;
  if (__pyx_t_14) {
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_qual); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_8 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __pyx_t_7;
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_13 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_reverse_complement, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_qual); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __pyx_t_7;
    __pyx_t_7 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_query_qualities, __pyx_t_8) < (0)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1728
 *         a.query_sequence = self.read.seq if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().seq
 *         a.query_qualities = self.read.qual if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().qual
 *         a.query_name = self.read.name             # <<<<<<<<<<<<<<
 *         a.flag = self.flag
 *         a.tags = self.optional_fields
*/
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_query_name, __pyx_t_7) < (0)) __PYX_ERR(0, 1728, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1729
 *         a.query_qualities = self.read.qual if self.iv == None or self.iv.strand == '+' else self.read.get_reverse_complement().qual
 *         a.query_name = self.read.name
 *         a.flag = self.flag             # <<<<<<<<<<<<<<
 *         a.tags = self.optional_fields
 *         if self.aligned:
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_flag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_flag, __pyx_t_7) < (0)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1730
 *         a.query_name = self.read.name
 *         a.flag = self.flag
 *         a.tags = self.optional_fields             # <<<<<<<<<<<<<<
 *         if self.aligned:
 *             a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
*/
  __pyx_t_7 = __pyx_v_self->optional_fields;
  __Pyx_INCREF(__pyx_t_7);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_tags, __pyx_t_7) < (0)) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1731
 *         a.flag = self.flag
 *         a.tags = self.optional_fields
 *         if self.aligned:             # <<<<<<<<<<<<<<
 *             a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
 *                              for c in self.cigar]
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_aligned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1731, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_14) {

    /* "HTSeq/_HTSeq.pyx":1732
 *         a.tags = self.optional_fields
 *         if self.aligned:
 *             a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)             # <<<<<<<<<<<<<<
 *                              for c in self.cigar]
 *             a.reference_start = self.iv.start
*/
    { /* enter inner scope */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1732, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "HTSeq/_HTSeq.pyx":1733
 *         if self.aligned:
 *             a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
 *                              for c in self.cigar]             # <<<<<<<<<<<<<<
 *             a.reference_start = self.iv.start
 *             a.reference_id = sf.gettid(self.iv.chrom)
*/
      if (unlikely(__pyx_v_self->cigar == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 1733, __pyx_L18_error)
      }
      __pyx_t_8 = __pyx_v_self->cigar; __Pyx_INCREF(__pyx_t_8);
      __pyx_t_16 = 0;
      for (;;) {
        {
          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, 1733, __pyx_L18_error)
          #endif
          if (__pyx_t_16 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_16;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1733, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_c, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "HTSeq/_HTSeq.pyx":1732
 *         a.tags = self.optional_fields
 *         if self.aligned:
 *             a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)             # <<<<<<<<<<<<<<
 *                              for c in self.cigar]
 *             a.reference_start = self.iv.start
*/
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cigar_operation_code_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1732, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr2__pyx_v_c, __pyx_mstate_global->__pyx_n_u_type_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1732, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1732, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr2__pyx_v_c, __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1732, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1732, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_12);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 1732, __pyx_L18_error);
        __Pyx_GIVEREF(__pyx_t_9);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 1732, __pyx_L18_error);
        __pyx_t_12 = 0;
        __pyx_t_9 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1732, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "HTSeq/_HTSeq.pyx":1733
 *         if self.aligned:
 *             a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
 *                              for c in self.cigar]             # <<<<<<<<<<<<<<
 *             a.reference_start = self.iv.start
 *             a.reference_id = sf.gettid(self.iv.chrom)
*/
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_c); __pyx_8genexpr2__pyx_v_c = 0;
      goto __pyx_L22_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_c); __pyx_8genexpr2__pyx_v_c = 0;
      goto __pyx_L1_error;
      __pyx_L22_exit_scope:;
    } /* exit inner scope */

    /* "HTSeq/_HTSeq.pyx":1732
 *         a.tags = self.optional_fields
 *         if self.aligned:
 *             a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)             # <<<<<<<<<<<<<<
 *                              for c in self.cigar]
 *             a.reference_start = self.iv.start
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_cigartuples, __pyx_t_7) < (0)) __PYX_ERR(0, 1732, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1734
 *             a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
 *                              for c in self.cigar]
 *             a.reference_start = self.iv.start             # <<<<<<<<<<<<<<
 *             a.reference_id = sf.gettid(self.iv.chrom)
 *             a.template_length = self.inferred_insert_size
*/
    __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_self->__pyx_base.__pyx_base.iv->start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_reference_start, __pyx_t_7) < (0)) __PYX_ERR(0, 1734, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1735
 *                              for c in self.cigar]
 *             a.reference_start = self.iv.start
 *             a.reference_id = sf.gettid(self.iv.chrom)             # <<<<<<<<<<<<<<
 *             a.template_length = self.inferred_insert_size
 *             a.mapping_quality = self.aQual
*/
    __pyx_t_8 = __pyx_v_sf;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_13 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_self->__pyx_base.__pyx_base.iv->chrom};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_gettid, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_reference_id, __pyx_t_7) < (0)) __PYX_ERR(0, 1735, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1736
 *             a.reference_start = self.iv.start
 *             a.reference_id = sf.gettid(self.iv.chrom)
 *             a.template_length = self.inferred_insert_size             # <<<<<<<<<<<<<<
 *             a.mapping_quality = self.aQual
 *         else:
*/
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_template_length, __pyx_t_7) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1737
 *             a.reference_id = sf.gettid(self.iv.chrom)
 *             a.template_length = self.inferred_insert_size
 *             a.mapping_quality = self.aQual             # <<<<<<<<<<<<<<
 *         else:
 *             a.reference_start = -1
*/
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_mapping_quality, __pyx_t_7) < (0)) __PYX_ERR(0, 1737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1731
 *         a.flag = self.flag
 *         a.tags = self.optional_fields
 *         if self.aligned:             # <<<<<<<<<<<<<<
 *             a.cigartuples = [(cigar_operation_code_dict[c.type], c.size)
 *                              for c in self.cigar]
*/
    goto __pyx_L15;
  }

  /* "HTSeq/_HTSeq.pyx":1739
 *             a.mapping_quality = self.aQual
 *         else:
 *             a.reference_start = -1             # <<<<<<<<<<<<<<
 *             a.reference_id = -1
 *         if self.mate_aligned:
*/
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_reference_start, __pyx_mstate_global->__pyx_int_neg_1) < (0)) __PYX_ERR(0, 1739, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1740
 *         else:
 *             a.reference_start = -1
 *             a.reference_id = -1             # <<<<<<<<<<<<<<
 *         if self.mate_aligned:
 *             a.next_reference_id = sf.gettid(self.mate_start.chrom)
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_reference_id, __pyx_mstate_global->__pyx_int_neg_1) < (0)) __PYX_ERR(0, 1740, __pyx_L1_error)
  }
  __pyx_L15:;

  /* "HTSeq/_HTSeq.pyx":1741
 *             a.reference_start = -1
 *             a.reference_id = -1
 *         if self.mate_aligned:             # <<<<<<<<<<<<<<
 *             a.next_reference_id = sf.gettid(self.mate_start.chrom)
 *             a.next_reference_start = self.mate_start.start
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_mate_aligned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1741, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_14) {

    /* "HTSeq/_HTSeq.pyx":1742
 *             a.reference_id = -1
 *         if self.mate_aligned:
 *             a.next_reference_id = sf.gettid(self.mate_start.chrom)             # <<<<<<<<<<<<<<
 *             a.next_reference_start = self.mate_start.start
 *         else:
*/
    __pyx_t_8 = __pyx_v_sf;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_13 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_self->mate_start->__pyx_base.chrom};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_gettid, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1742, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_next_reference_id, __pyx_t_7) < (0)) __PYX_ERR(0, 1742, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1743
 *         if self.mate_aligned:
 *             a.next_reference_id = sf.gettid(self.mate_start.chrom)
 *             a.next_reference_start = self.mate_start.start             # <<<<<<<<<<<<<<
 *         else:
 *             a.next_reference_id = -1
*/
    __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_self->mate_start->__pyx_base.start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_next_reference_start, __pyx_t_7) < (0)) __PYX_ERR(0, 1743, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1741
 *             a.reference_start = -1
 *             a.reference_id = -1
 *         if self.mate_aligned:             # <<<<<<<<<<<<<<
 *             a.next_reference_id = sf.gettid(self.mate_start.chrom)
 *             a.next_reference_start = self.mate_start.start
*/
    goto __pyx_L23;
  }

  /* "HTSeq/_HTSeq.pyx":1745
 *             a.next_reference_start = self.mate_start.start
 *         else:
 *             a.next_reference_id = -1             # <<<<<<<<<<<<<<
 *             a.next_reference_start = -1
 *         return a
*/
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_next_reference_id, __pyx_mstate_global->__pyx_int_neg_1) < (0)) __PYX_ERR(0, 1745, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1746
 *         else:
 *             a.next_reference_id = -1
 *             a.next_reference_start = -1             # <<<<<<<<<<<<<<
 *         return a
 * 
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_next_reference_start, __pyx_mstate_global->__pyx_int_neg_1) < (0)) __PYX_ERR(0, 1746, __pyx_L1_error)
  }
  __pyx_L23:;

  /* "HTSeq/_HTSeq.pyx":1747
 *             a.next_reference_id = -1
 *             a.next_reference_start = -1
 *         return a             # <<<<<<<<<<<<<<
 * 
 *     def to_pysam_AlignedRead(self, sf):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_a);
  __pyx_r = __pyx_v_a;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1717
 *     """
 * 
 *     def to_pysam_AlignedSegment(self, sf):             # <<<<<<<<<<<<<<
 *         try:
 *             import pysam
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pysam);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1749
 *         return a
 * 
 *     def to_pysam_AlignedRead(self, sf):             # <<<<<<<<<<<<<<
 *         try:
 *             import pysam
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead(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_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead = {"to_pysam_AlignedRead", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sf = 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("to_pysam_AlignedRead (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_sf,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, 1749, __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, 1749, __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, "to_pysam_AlignedRead", 0) < (0)) __PYX_ERR(0, 1749, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_pysam_AlignedRead", 1, 1, 1, i); __PYX_ERR(0, 1749, __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, 1749, __pyx_L3_error)
    }
    __pyx_v_sf = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pysam_AlignedRead", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1749, __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("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_2to_pysam_AlignedRead(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), __pyx_v_sf);

  /* 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_5HTSeq_6_HTSeq_13SAM_Alignment_2to_pysam_AlignedRead(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_sf) {
  PyObject *__pyx_v_pysam = NULL;
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_pysam_AlignedRead", 0);

  /* "HTSeq/_HTSeq.pyx":1750
 * 
 *     def to_pysam_AlignedRead(self, sf):
 *         try:             # <<<<<<<<<<<<<<
 *             import pysam
 *         except ImportError:
*/
  {
    __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:*/ {

      /* "HTSeq/_HTSeq.pyx":1751
 *     def to_pysam_AlignedRead(self, sf):
 *         try:
 *             import pysam             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             sys.stderr.write(
*/
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pysam, 0, 0, NULL, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1751, __pyx_L3_error)
      __pyx_t_4 = __pyx_t_5;
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pysam = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":1750
 * 
 *     def to_pysam_AlignedRead(self, sf):
 *         try:             # <<<<<<<<<<<<<<
 *             import pysam
 *         except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "HTSeq/_HTSeq.pyx":1752
 *         try:
 *             import pysam
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             sys.stderr.write(
 *                 "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 1752, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "HTSeq/_HTSeq.pyx":1753
 *             import pysam
 *         except ImportError:
 *             sys.stderr.write(             # <<<<<<<<<<<<<<
 *                 "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
 *             raise
*/
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1753, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1753, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_10 = __pyx_t_12;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_13 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_Please_Install_PySam_to_use_this};
        __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1753, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "HTSeq/_HTSeq.pyx":1755
 *             sys.stderr.write(
 *                 "Please Install PySam to use this functionality (http://code.google.com/p/pysam/)")
 *             raise             # <<<<<<<<<<<<<<
 * 
 *         a = pysam.AlignedRead()
*/
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_8);
      __pyx_t_4 = 0;  __pyx_t_7 = 0;  __pyx_t_8 = 0; 
      __PYX_ERR(0, 1755, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "HTSeq/_HTSeq.pyx":1750
 * 
 *     def to_pysam_AlignedRead(self, sf):
 *         try:             # <<<<<<<<<<<<<<
 *             import pysam
 *         except ImportError:
*/
    __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:;
  }

  /* "HTSeq/_HTSeq.pyx":1757
 *             raise
 * 
 *         a = pysam.AlignedRead()             # <<<<<<<<<<<<<<
 *         a.seq = self.read.seq
 *         a.qual = self.read.qualstr
*/
  __pyx_t_7 = __pyx_v_pysam;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_AlignedRead, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_v_a = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1758
 * 
 *         a = pysam.AlignedRead()
 *         a.seq = self.read.seq             # <<<<<<<<<<<<<<
 *         a.qual = self.read.qualstr
 *         a.qname = self.read.name
*/
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_seq); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_seq, __pyx_t_7) < (0)) __PYX_ERR(0, 1758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1759
 *         a = pysam.AlignedRead()
 *         a.seq = self.read.seq
 *         a.qual = self.read.qualstr             # <<<<<<<<<<<<<<
 *         a.qname = self.read.name
 *         a.flag = self.flag
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_qualstr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_qual, __pyx_t_8) < (0)) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1760
 *         a.seq = self.read.seq
 *         a.qual = self.read.qualstr
 *         a.qname = self.read.name             # <<<<<<<<<<<<<<
 *         a.flag = self.flag
 *         a.tags = self.optional_fields
*/
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_qname, __pyx_t_7) < (0)) __PYX_ERR(0, 1760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1761
 *         a.qual = self.read.qualstr
 *         a.qname = self.read.name
 *         a.flag = self.flag             # <<<<<<<<<<<<<<
 *         a.tags = self.optional_fields
 *         if self.aligned:
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_flag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_flag, __pyx_t_7) < (0)) __PYX_ERR(0, 1761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1762
 *         a.qname = self.read.name
 *         a.flag = self.flag
 *         a.tags = self.optional_fields             # <<<<<<<<<<<<<<
 *         if self.aligned:
 *             a.cigar = [(cigar_operation_code_dict[c.type], c.size)
*/
  __pyx_t_7 = __pyx_v_self->optional_fields;
  __Pyx_INCREF(__pyx_t_7);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_tags, __pyx_t_7) < (0)) __PYX_ERR(0, 1762, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1763
 *         a.flag = self.flag
 *         a.tags = self.optional_fields
 *         if self.aligned:             # <<<<<<<<<<<<<<
 *             a.cigar = [(cigar_operation_code_dict[c.type], c.size)
 *                        for c in self.cigar]
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_aligned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1763, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_14) {

    /* "HTSeq/_HTSeq.pyx":1764
 *         a.tags = self.optional_fields
 *         if self.aligned:
 *             a.cigar = [(cigar_operation_code_dict[c.type], c.size)             # <<<<<<<<<<<<<<
 *                        for c in self.cigar]
 *             a.pos = self.iv.start
*/
    { /* enter inner scope */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1764, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "HTSeq/_HTSeq.pyx":1765
 *         if self.aligned:
 *             a.cigar = [(cigar_operation_code_dict[c.type], c.size)
 *                        for c in self.cigar]             # <<<<<<<<<<<<<<
 *             a.pos = self.iv.start
 *             a.tid = sf.gettid(self.iv.chrom)
*/
      if (unlikely(__pyx_v_self->cigar == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 1765, __pyx_L14_error)
      }
      __pyx_t_8 = __pyx_v_self->cigar; __Pyx_INCREF(__pyx_t_8);
      __pyx_t_15 = 0;
      for (;;) {
        {
          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, 1765, __pyx_L14_error)
          #endif
          if (__pyx_t_15 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_15;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1765, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_c, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "HTSeq/_HTSeq.pyx":1764
 *         a.tags = self.optional_fields
 *         if self.aligned:
 *             a.cigar = [(cigar_operation_code_dict[c.type], c.size)             # <<<<<<<<<<<<<<
 *                        for c in self.cigar]
 *             a.pos = self.iv.start
*/
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cigar_operation_code_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1764, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr3__pyx_v_c, __pyx_mstate_global->__pyx_n_u_type_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1764, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1764, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr3__pyx_v_c, __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1764, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1764, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_12);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 1764, __pyx_L14_error);
        __Pyx_GIVEREF(__pyx_t_9);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 1764, __pyx_L14_error);
        __pyx_t_12 = 0;
        __pyx_t_9 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1764, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "HTSeq/_HTSeq.pyx":1765
 *         if self.aligned:
 *             a.cigar = [(cigar_operation_code_dict[c.type], c.size)
 *                        for c in self.cigar]             # <<<<<<<<<<<<<<
 *             a.pos = self.iv.start
 *             a.tid = sf.gettid(self.iv.chrom)
*/
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c); __pyx_8genexpr3__pyx_v_c = 0;
      goto __pyx_L18_exit_scope;
      __pyx_L14_error:;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c); __pyx_8genexpr3__pyx_v_c = 0;
      goto __pyx_L1_error;
      __pyx_L18_exit_scope:;
    } /* exit inner scope */

    /* "HTSeq/_HTSeq.pyx":1764
 *         a.tags = self.optional_fields
 *         if self.aligned:
 *             a.cigar = [(cigar_operation_code_dict[c.type], c.size)             # <<<<<<<<<<<<<<
 *                        for c in self.cigar]
 *             a.pos = self.iv.start
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_cigar, __pyx_t_7) < (0)) __PYX_ERR(0, 1764, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1766
 *             a.cigar = [(cigar_operation_code_dict[c.type], c.size)
 *                        for c in self.cigar]
 *             a.pos = self.iv.start             # <<<<<<<<<<<<<<
 *             a.tid = sf.gettid(self.iv.chrom)
 *             a.isize = self.inferred_insert_size
*/
    __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_self->__pyx_base.__pyx_base.iv->start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_pos, __pyx_t_7) < (0)) __PYX_ERR(0, 1766, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1767
 *                        for c in self.cigar]
 *             a.pos = self.iv.start
 *             a.tid = sf.gettid(self.iv.chrom)             # <<<<<<<<<<<<<<
 *             a.isize = self.inferred_insert_size
 *             a.mapq = self.aQual
*/
    __pyx_t_8 = __pyx_v_sf;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_13 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_self->__pyx_base.__pyx_base.iv->chrom};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_gettid, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1767, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_tid, __pyx_t_7) < (0)) __PYX_ERR(0, 1767, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1768
 *             a.pos = self.iv.start
 *             a.tid = sf.gettid(self.iv.chrom)
 *             a.isize = self.inferred_insert_size             # <<<<<<<<<<<<<<
 *             a.mapq = self.aQual
 *         else:
*/
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_isize, __pyx_t_7) < (0)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1769
 *             a.tid = sf.gettid(self.iv.chrom)
 *             a.isize = self.inferred_insert_size
 *             a.mapq = self.aQual             # <<<<<<<<<<<<<<
 *         else:
 *             a.pos = -1
*/
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1769, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_mapq, __pyx_t_7) < (0)) __PYX_ERR(0, 1769, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1763
 *         a.flag = self.flag
 *         a.tags = self.optional_fields
 *         if self.aligned:             # <<<<<<<<<<<<<<
 *             a.cigar = [(cigar_operation_code_dict[c.type], c.size)
 *                        for c in self.cigar]
*/
    goto __pyx_L11;
  }

  /* "HTSeq/_HTSeq.pyx":1771
 *             a.mapq = self.aQual
 *         else:
 *             a.pos = -1             # <<<<<<<<<<<<<<
 *             a.tid = -1
 *         if self.mate_aligned:
*/
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_pos, __pyx_mstate_global->__pyx_int_neg_1) < (0)) __PYX_ERR(0, 1771, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1772
 *         else:
 *             a.pos = -1
 *             a.tid = -1             # <<<<<<<<<<<<<<
 *         if self.mate_aligned:
 *             a.mrnm = sf.gettid(self.mate_start.chrom)
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_tid, __pyx_mstate_global->__pyx_int_neg_1) < (0)) __PYX_ERR(0, 1772, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "HTSeq/_HTSeq.pyx":1773
 *             a.pos = -1
 *             a.tid = -1
 *         if self.mate_aligned:             # <<<<<<<<<<<<<<
 *             a.mrnm = sf.gettid(self.mate_start.chrom)
 *             a.mpos = self.mate_start.start
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_mate_aligned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_14) {

    /* "HTSeq/_HTSeq.pyx":1774
 *             a.tid = -1
 *         if self.mate_aligned:
 *             a.mrnm = sf.gettid(self.mate_start.chrom)             # <<<<<<<<<<<<<<
 *             a.mpos = self.mate_start.start
 *         else:
*/
    __pyx_t_8 = __pyx_v_sf;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_13 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_self->mate_start->__pyx_base.chrom};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_gettid, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1774, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_mrnm, __pyx_t_7) < (0)) __PYX_ERR(0, 1774, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1775
 *         if self.mate_aligned:
 *             a.mrnm = sf.gettid(self.mate_start.chrom)
 *             a.mpos = self.mate_start.start             # <<<<<<<<<<<<<<
 *         else:
 *             a.mrnm = -1
*/
    __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_self->mate_start->__pyx_base.start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_mpos, __pyx_t_7) < (0)) __PYX_ERR(0, 1775, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":1773
 *             a.pos = -1
 *             a.tid = -1
 *         if self.mate_aligned:             # <<<<<<<<<<<<<<
 *             a.mrnm = sf.gettid(self.mate_start.chrom)
 *             a.mpos = self.mate_start.start
*/
    goto __pyx_L19;
  }

  /* "HTSeq/_HTSeq.pyx":1777
 *             a.mpos = self.mate_start.start
 *         else:
 *             a.mrnm = -1             # <<<<<<<<<<<<<<
 *             a.mpos = -1
 *         return a
*/
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_mrnm, __pyx_mstate_global->__pyx_int_neg_1) < (0)) __PYX_ERR(0, 1777, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1778
 *         else:
 *             a.mrnm = -1
 *             a.mpos = -1             # <<<<<<<<<<<<<<
 *         return a
 * 
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_mstate_global->__pyx_n_u_mpos, __pyx_mstate_global->__pyx_int_neg_1) < (0)) __PYX_ERR(0, 1778, __pyx_L1_error)
  }
  __pyx_L19:;

  /* "HTSeq/_HTSeq.pyx":1779
 *             a.mrnm = -1
 *             a.mpos = -1
 *         return a             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_a);
  __pyx_r = __pyx_v_a;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1749
 *         return a
 * 
 *     def to_pysam_AlignedRead(self, sf):             # <<<<<<<<<<<<<<
 *         try:
 *             import pysam
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.to_pysam_AlignedRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pysam);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1781
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pysam_AlignedRead(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead(PyObject *__pyx_v_cls, 
#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_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead = {"from_pysam_AlignedRead", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead(PyObject *__pyx_v_cls, 
#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_read = 0;
  PyObject *__pyx_v_samfile = 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("from_pysam_AlignedRead (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_read,&__pyx_mstate_global->__pyx_n_u_samfile,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, 1781, __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, 1781, __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, 1781, __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, "from_pysam_AlignedRead", 0) < (0)) __PYX_ERR(0, 1781, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("from_pysam_AlignedRead", 1, 2, 2, i); __PYX_ERR(0, 1781, __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, 1781, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1781, __pyx_L3_error)
    }
    __pyx_v_read = values[0];
    __pyx_v_samfile = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pysam_AlignedRead", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1781, __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("HTSeq._HTSeq.SAM_Alignment.from_pysam_AlignedRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4from_pysam_AlignedRead(((PyTypeObject*)__pyx_v_cls), __pyx_v_read, __pyx_v_samfile);

  /* 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_5HTSeq_6_HTSeq_13SAM_Alignment_4from_pysam_AlignedRead(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_read, PyObject *__pyx_v_samfile) {
  PyObject *__pyx_v_strand = NULL;
  PyObject *__pyx_v_chrom = NULL;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = NULL;
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_seq = NULL;
  struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_a = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_code = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_pysam_AlignedRead", 0);

  /* "HTSeq/_HTSeq.pyx":1783
 *     @classmethod
 *     def from_pysam_AlignedRead(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"             # <<<<<<<<<<<<<<
 *         if not read.is_unmapped:
 *             chrom = samfile.getrname(read.tid)
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_reverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1783, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__18);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__18;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__17);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__17;
  }
  __pyx_v_strand = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1784
 *     def from_pysam_AlignedRead(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:             # <<<<<<<<<<<<<<
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.pos, read.aend, strand)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_unmapped); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1784, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1785
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:
 *             chrom = samfile.getrname(read.tid)             # <<<<<<<<<<<<<<
 *             iv = GenomicInterval(chrom, read.pos, read.aend, strand)
 *         else:
*/
    __pyx_t_2 = __pyx_v_samfile;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_tid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getrname, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1785, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_chrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1786
 *         if not read.is_unmapped:
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.pos, read.aend, strand)             # <<<<<<<<<<<<<<
 *         else:
 *             iv = None
*/
    __pyx_t_5 = NULL;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_aend); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_chrom, __pyx_t_2, __pyx_t_7, __pyx_v_strand};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1784
 *     def from_pysam_AlignedRead(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:             # <<<<<<<<<<<<<<
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.pos, read.aend, strand)
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1788
 *             iv = GenomicInterval(chrom, read.pos, read.aend, strand)
 *         else:
 *             iv = None             # <<<<<<<<<<<<<<
 *         if (read.qual is None) or (read.qual == "*"):
 *             seq = SequenceWithQualities(
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1789
 *         else:
 *             iv = None
 *         if (read.qual is None) or (read.qual == "*"):             # <<<<<<<<<<<<<<
 *             seq = SequenceWithQualities(
 *                 read.query_sequence.encode(), read.qname, b'',
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_qual); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_4 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_qual); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__31, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1789, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1790
 *             iv = None
 *         if (read.qual is None) or (read.qual == "*"):
 *             seq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 read.query_sequence.encode(), read.qname, b'',
 *                 "noquals")
*/
    __pyx_t_7 = NULL;

    /* "HTSeq/_HTSeq.pyx":1791
 *         if (read.qual is None) or (read.qual == "*"):
 *             seq = SequenceWithQualities(
 *                 read.query_sequence.encode(), read.qname, b'',             # <<<<<<<<<<<<<<
 *                 "noquals")
 *         else:
*/
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_query_sequence); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __pyx_t_8;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1791, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_qname); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_t_2, __pyx_t_8, __pyx_mstate_global->__pyx_kp_b__12, __pyx_mstate_global->__pyx_n_u_noquals};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1790, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_seq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1789
 *         else:
 *             iv = None
 *         if (read.qual is None) or (read.qual == "*"):             # <<<<<<<<<<<<<<
 *             seq = SequenceWithQualities(
 *                 read.query_sequence.encode(), read.qname, b'',
*/
    goto __pyx_L4;
  }

  /* "HTSeq/_HTSeq.pyx":1794
 *                 "noquals")
 *         else:
 *             seq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 read.query_sequence.encode(), read.qname, read.qual.encode(),
 *                 )
*/
  /*else*/ {
    __pyx_t_8 = NULL;

    /* "HTSeq/_HTSeq.pyx":1795
 *         else:
 *             seq = SequenceWithQualities(
 *                 read.query_sequence.encode(), read.qname, read.qual.encode(),             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_query_sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1795, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_qname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_qual); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = __pyx_t_10;
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1795, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_2, __pyx_t_5, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_seq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "HTSeq/_HTSeq.pyx":1798
 *                 )
 * 
 *         a = SAM_Alignment(seq, iv)             # <<<<<<<<<<<<<<
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
*/
  __pyx_t_7 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, ((PyObject *)__pyx_v_seq), ((PyObject *)__pyx_v_iv)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1798, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_a = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1800
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []             # <<<<<<<<<<<<<<
 *         a.inferred_insert_size = read.isize
 *         a.aQual = read.mapq
*/
  __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_iv), Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1800, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1800, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1799
 * 
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (             # <<<<<<<<<<<<<<
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.isize
*/
    { /* enter inner scope */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1799, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "HTSeq/_HTSeq.pyx":1800
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []             # <<<<<<<<<<<<<<
 *         a.inferred_insert_size = read.isize
 *         a.aQual = read.mapq
*/
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_cigar); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1800, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2);
        __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1800, __pyx_L9_error)
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_12)) {
          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, 1800, __pyx_L9_error)
              #endif
              if (__pyx_t_11 >= __pyx_temp) break;
            }
            __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_11;
          } 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, 1800, __pyx_L9_error)
              #endif
              if (__pyx_t_11 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11));
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11);
            #endif
            ++__pyx_t_11;
          }
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1800, __pyx_L9_error)
        } else {
          __pyx_t_5 = __pyx_t_12(__pyx_t_2);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1800, __pyx_L9_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_5);
        if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
          PyObject* sequence = __pyx_t_5;
          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, 1800, __pyx_L9_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_10);
          } else {
            __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1800, __pyx_L9_error)
            __Pyx_XGOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1800, __pyx_L9_error)
            __Pyx_XGOTREF(__pyx_t_10);
          }
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1800, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1800, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1800, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
          index = 0; __pyx_t_8 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L12_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_8);
          index = 1; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 1800, __pyx_L9_error)
          __pyx_t_13 = NULL;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L13_unpacking_done;
          __pyx_L12_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_13 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 1800, __pyx_L9_error)
          __pyx_L13_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_code, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_length, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "HTSeq/_HTSeq.pyx":1799
 * 
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (             # <<<<<<<<<<<<<<
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.isize
*/
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cigar_operation_codes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1799, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_8genexpr4__pyx_v_code); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1799, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1799, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_10);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 1799, __pyx_L9_error);
        __Pyx_INCREF(__pyx_8genexpr4__pyx_v_length);
        __Pyx_GIVEREF(__pyx_8genexpr4__pyx_v_length);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_8genexpr4__pyx_v_length) != (0)) __PYX_ERR(0, 1799, __pyx_L9_error);
        __pyx_t_10 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1799, __pyx_L9_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_code); __pyx_8genexpr4__pyx_v_code = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_length); __pyx_8genexpr4__pyx_v_length = 0;
      goto __pyx_L15_exit_scope;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_code); __pyx_8genexpr4__pyx_v_code = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_length); __pyx_8genexpr4__pyx_v_length = 0;
      goto __pyx_L1_error;
      __pyx_L15_exit_scope:;
    } /* exit inner scope */

    /* "HTSeq/_HTSeq.pyx":1800
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []             # <<<<<<<<<<<<<<
 *         a.inferred_insert_size = read.isize
 *         a.aQual = read.mapq
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1800, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_v_chrom)) { __Pyx_RaiseUnboundLocalError("chrom"); __PYX_ERR(0, 1800, __pyx_L1_error) }
    __pyx_t_2 = __pyx_v_chrom;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1800, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1799
 * 
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (             # <<<<<<<<<<<<<<
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.isize
*/
    __pyx_t_15.__pyx_n = 3;
    __pyx_t_15.ref_left = __pyx_t_14;
    __pyx_t_15.chrom = ((PyObject*)__pyx_t_2);
    __pyx_t_15.strand = __pyx_v_strand;
    __pyx_t_5 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(((PyObject*)__pyx_t_7), 0, &__pyx_t_15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {

    /* "HTSeq/_HTSeq.pyx":1800
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []             # <<<<<<<<<<<<<<
 *         a.inferred_insert_size = read.isize
 *         a.aQual = read.mapq
*/
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
  }

  /* "HTSeq/_HTSeq.pyx":1799
 * 
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (             # <<<<<<<<<<<<<<
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.isize
*/
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_a->cigar);
  __Pyx_DECREF(__pyx_v_a->cigar);
  __pyx_v_a->cigar = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1801
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.isize             # <<<<<<<<<<<<<<
 *         a.aQual = read.mapq
 *         a.flag = read.flag
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_isize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1801, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->inferred_insert_size = __pyx_t_14;

  /* "HTSeq/_HTSeq.pyx":1802
 *             code, length) in read.cigar], read.pos, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.isize
 *         a.aQual = read.mapq             # <<<<<<<<<<<<<<
 *         a.flag = read.flag
 *         a.proper_pair = read.is_proper_pair
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mapq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->aQual = __pyx_t_14;

  /* "HTSeq/_HTSeq.pyx":1803
 *         a.inferred_insert_size = read.isize
 *         a.aQual = read.mapq
 *         a.flag = read.flag             # <<<<<<<<<<<<<<
 *         a.proper_pair = read.is_proper_pair
 *         a.not_primary_alignment = read.is_secondary
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_a), __pyx_mstate_global->__pyx_n_u_flag, __pyx_t_1) < (0)) __PYX_ERR(0, 1803, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1804
 *         a.aQual = read.mapq
 *         a.flag = read.flag
 *         a.proper_pair = read.is_proper_pair             # <<<<<<<<<<<<<<
 *         a.not_primary_alignment = read.is_secondary
 *         a.failed_platform_qc = read.is_qcfail
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_proper_pair); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->proper_pair = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1805
 *         a.flag = read.flag
 *         a.proper_pair = read.is_proper_pair
 *         a.not_primary_alignment = read.is_secondary             # <<<<<<<<<<<<<<
 *         a.failed_platform_qc = read.is_qcfail
 *         a.pcr_or_optical_duplicate = read.is_duplicate
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_secondary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1805, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->not_primary_alignment = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1806
 *         a.proper_pair = read.is_proper_pair
 *         a.not_primary_alignment = read.is_secondary
 *         a.failed_platform_qc = read.is_qcfail             # <<<<<<<<<<<<<<
 *         a.pcr_or_optical_duplicate = read.is_duplicate
 *         a.supplementary = read.is_supplementary
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_qcfail); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->failed_platform_qc = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1807
 *         a.not_primary_alignment = read.is_secondary
 *         a.failed_platform_qc = read.is_qcfail
 *         a.pcr_or_optical_duplicate = read.is_duplicate             # <<<<<<<<<<<<<<
 *         a.supplementary = read.is_supplementary
 *         a.original_sam_line = ""
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_duplicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->pcr_or_optical_duplicate = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1808
 *         a.failed_platform_qc = read.is_qcfail
 *         a.pcr_or_optical_duplicate = read.is_duplicate
 *         a.supplementary = read.is_supplementary             # <<<<<<<<<<<<<<
 *         a.original_sam_line = ""
 *         a.optional_fields = read.tags
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_supplementary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->supplementary = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1809
 *         a.pcr_or_optical_duplicate = read.is_duplicate
 *         a.supplementary = read.is_supplementary
 *         a.original_sam_line = ""             # <<<<<<<<<<<<<<
 *         a.optional_fields = read.tags
 *         if read.is_paired:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__12);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__12);
  __Pyx_GOTREF(__pyx_v_a->original_sam_line);
  __Pyx_DECREF(__pyx_v_a->original_sam_line);
  __pyx_v_a->original_sam_line = __pyx_mstate_global->__pyx_kp_u__12;

  /* "HTSeq/_HTSeq.pyx":1810
 *         a.supplementary = read.is_supplementary
 *         a.original_sam_line = ""
 *         a.optional_fields = read.tags             # <<<<<<<<<<<<<<
 *         if read.is_paired:
 *             # These two should be but are not always consistent
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_tags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 1810, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_a->optional_fields);
  __Pyx_DECREF(__pyx_v_a->optional_fields);
  __pyx_v_a->optional_fields = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1811
 *         a.original_sam_line = ""
 *         a.optional_fields = read.tags
 *         if read.is_paired:             # <<<<<<<<<<<<<<
 *             # These two should be but are not always consistent
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_paired); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1811, __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, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1813
 *         if read.is_paired:
 *             # These two should be but are not always consistent
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):             # <<<<<<<<<<<<<<
 *                 strand = "-" if read.mate_is_reverse else "+"
 *                 a.mate_start = GenomicPosition(
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mate_is_unmapped); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1813, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_16 = (!__pyx_t_3);
    if (__pyx_t_16) {
    } else {
      __pyx_t_4 = __pyx_t_16;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mrnm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_16 = (__Pyx_PyLong_BoolNeObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1813, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_16;
    __pyx_L18_bool_binop_done:;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1814
 *             # These two should be but are not always consistent
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):
 *                 strand = "-" if read.mate_is_reverse else "+"             # <<<<<<<<<<<<<<
 *                 a.mate_start = GenomicPosition(
 *                     samfile.getrname(read.mrnm), read.mpos, strand)
*/
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mate_is_reverse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1814, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1814, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__18);
        __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__18;
      } else {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__17);
        __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__17;
      }
      __Pyx_DECREF_SET(__pyx_v_strand, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":1815
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):
 *                 strand = "-" if read.mate_is_reverse else "+"
 *                 a.mate_start = GenomicPosition(             # <<<<<<<<<<<<<<
 *                     samfile.getrname(read.mrnm), read.mpos, strand)
 *             else:
*/
      __pyx_t_5 = NULL;

      /* "HTSeq/_HTSeq.pyx":1816
 *                 strand = "-" if read.mate_is_reverse else "+"
 *                 a.mate_start = GenomicPosition(
 *                     samfile.getrname(read.mrnm), read.mpos, strand)             # <<<<<<<<<<<<<<
 *             else:
 *                 a.mate_start = None
*/
      __pyx_t_7 = __pyx_v_samfile;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mrnm); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1816, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getrname, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1816, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mpos); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1816, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_t_2, __pyx_t_10, __pyx_v_strand};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1815, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_1);
      }

      /* "HTSeq/_HTSeq.pyx":1815
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):
 *                 strand = "-" if read.mate_is_reverse else "+"
 *                 a.mate_start = GenomicPosition(             # <<<<<<<<<<<<<<
 *                     samfile.getrname(read.mrnm), read.mpos, strand)
 *             else:
*/
      __Pyx_GIVEREF((PyObject *)__pyx_t_1);
      __Pyx_GOTREF((PyObject *)__pyx_v_a->mate_start);
      __Pyx_DECREF((PyObject *)__pyx_v_a->mate_start);
      __pyx_v_a->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":1813
 *         if read.is_paired:
 *             # These two should be but are not always consistent
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):             # <<<<<<<<<<<<<<
 *                 strand = "-" if read.mate_is_reverse else "+"
 *                 a.mate_start = GenomicPosition(
*/
      goto __pyx_L17;
    }

    /* "HTSeq/_HTSeq.pyx":1818
 *                     samfile.getrname(read.mrnm), read.mpos, strand)
 *             else:
 *                 a.mate_start = None             # <<<<<<<<<<<<<<
 *             if read.is_read1:
 *                 a.pe_which = intern("first")
*/
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF((PyObject *)__pyx_v_a->mate_start);
      __Pyx_DECREF((PyObject *)__pyx_v_a->mate_start);
      __pyx_v_a->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None);
    }
    __pyx_L17:;

    /* "HTSeq/_HTSeq.pyx":1819
 *             else:
 *                 a.mate_start = None
 *             if read.is_read1:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_read1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1819, __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, 1819, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1820
 *                 a.mate_start = None
 *             if read.is_read1:
 *                 a.pe_which = intern("first")             # <<<<<<<<<<<<<<
 *             elif read.is_read2:
 *                 a.pe_which = intern("second")
*/
      __pyx_t_1 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_first); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1820, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":1819
 *             else:
 *                 a.mate_start = None
 *             if read.is_read1:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
*/
      goto __pyx_L20;
    }

    /* "HTSeq/_HTSeq.pyx":1821
 *             if read.is_read1:
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("second")
 *             else:
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_read2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1821, __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, 1821, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1822
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
 *                 a.pe_which = intern("second")             # <<<<<<<<<<<<<<
 *             else:
 *                 a.pe_which = intern("unknown")
*/
      __pyx_t_1 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1822, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":1821
 *             if read.is_read1:
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("second")
 *             else:
*/
      goto __pyx_L20;
    }

    /* "HTSeq/_HTSeq.pyx":1824
 *                 a.pe_which = intern("second")
 *             else:
 *                 a.pe_which = intern("unknown")             # <<<<<<<<<<<<<<
 *         else:
 *             a.pe_which = intern("not_paired_end")
*/
    /*else*/ {
      __pyx_t_1 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_unknown); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1824, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L20:;

    /* "HTSeq/_HTSeq.pyx":1811
 *         a.original_sam_line = ""
 *         a.optional_fields = read.tags
 *         if read.is_paired:             # <<<<<<<<<<<<<<
 *             # These two should be but are not always consistent
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):
*/
    goto __pyx_L16;
  }

  /* "HTSeq/_HTSeq.pyx":1826
 *                 a.pe_which = intern("unknown")
 *         else:
 *             a.pe_which = intern("not_paired_end")             # <<<<<<<<<<<<<<
 *         return a
 * 
*/
  /*else*/ {
    __pyx_t_1 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_not_paired_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_a->pe_which);
    __Pyx_DECREF(__pyx_v_a->pe_which);
    __pyx_v_a->pe_which = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L16:;

  /* "HTSeq/_HTSeq.pyx":1827
 *         else:
 *             a.pe_which = intern("not_paired_end")
 *         return a             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_a);
  __pyx_r = ((PyObject *)__pyx_v_a);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1781
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pysam_AlignedRead(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.from_pysam_AlignedRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_strand);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_iv);
  __Pyx_XDECREF((PyObject *)__pyx_v_seq);
  __Pyx_XDECREF((PyObject *)__pyx_v_a);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_code);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1829
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pysam_AlignedSegment(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment(PyObject *__pyx_v_cls, 
#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_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment = {"from_pysam_AlignedSegment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment(PyObject *__pyx_v_cls, 
#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_read = 0;
  PyObject *__pyx_v_samfile = 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("from_pysam_AlignedSegment (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_read,&__pyx_mstate_global->__pyx_n_u_samfile,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, 1829, __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, 1829, __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, 1829, __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, "from_pysam_AlignedSegment", 0) < (0)) __PYX_ERR(0, 1829, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("from_pysam_AlignedSegment", 1, 2, 2, i); __PYX_ERR(0, 1829, __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, 1829, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1829, __pyx_L3_error)
    }
    __pyx_v_read = values[0];
    __pyx_v_samfile = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pysam_AlignedSegment", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1829, __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("HTSeq._HTSeq.SAM_Alignment.from_pysam_AlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_6from_pysam_AlignedSegment(((PyTypeObject*)__pyx_v_cls), __pyx_v_read, __pyx_v_samfile);

  /* 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_5HTSeq_6_HTSeq_13SAM_Alignment_6from_pysam_AlignedSegment(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_read, PyObject *__pyx_v_samfile) {
  PyObject *__pyx_v_strand = NULL;
  PyObject *__pyx_v_chrom = NULL;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = NULL;
  PyObject *__pyx_v_query_sequence = NULL;
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_seq = NULL;
  struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_a = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_code = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_build_cigar_list __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_pysam_AlignedSegment", 0);

  /* "HTSeq/_HTSeq.pyx":1831
 *     @classmethod
 *     def from_pysam_AlignedSegment(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"             # <<<<<<<<<<<<<<
 *         if not read.is_unmapped:
 *             chrom = samfile.getrname(read.tid)
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_reverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1831, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__18);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__18;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__17);
    __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__17;
  }
  __pyx_v_strand = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1832
 *     def from_pysam_AlignedSegment(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:             # <<<<<<<<<<<<<<
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.reference_start,
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_unmapped); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1833
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:
 *             chrom = samfile.getrname(read.tid)             # <<<<<<<<<<<<<<
 *             iv = GenomicInterval(chrom, read.reference_start,
 *                                  read.reference_end, strand)
*/
    __pyx_t_2 = __pyx_v_samfile;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_tid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getrname, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_chrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1834
 *         if not read.is_unmapped:
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.reference_start,             # <<<<<<<<<<<<<<
 *                                  read.reference_end, strand)
 *         else:
*/
    __pyx_t_5 = NULL;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_reference_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "HTSeq/_HTSeq.pyx":1835
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.reference_start,
 *                                  read.reference_end, strand)             # <<<<<<<<<<<<<<
 *         else:
 *             iv = None
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_reference_end); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_chrom, __pyx_t_2, __pyx_t_7, __pyx_v_strand};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1834, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1832
 *     def from_pysam_AlignedSegment(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
 *         if not read.is_unmapped:             # <<<<<<<<<<<<<<
 *             chrom = samfile.getrname(read.tid)
 *             iv = GenomicInterval(chrom, read.reference_start,
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":1837
 *                                  read.reference_end, strand)
 *         else:
 *             iv = None             # <<<<<<<<<<<<<<
 * 
 *         # read.query_sequence can be empty (e.g. nanopore runs), then pysam
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":1842
 *         # casts it as None or *. We recast it as an empty string to preserve
 *         #types. It is then converted to ASCII
 *         query_sequence = read.query_sequence             # <<<<<<<<<<<<<<
 *         if (query_sequence is None) or (query_sequence == '*'):
 *             query_sequence = ''
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_query_sequence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_query_sequence = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1843
 *         #types. It is then converted to ASCII
 *         query_sequence = read.query_sequence
 *         if (query_sequence is None) or (query_sequence == '*'):             # <<<<<<<<<<<<<<
 *             query_sequence = ''
 *         query_sequence = query_sequence.encode()
*/
  __pyx_t_3 = (__pyx_v_query_sequence == Py_None);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_4 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_query_sequence, __pyx_mstate_global->__pyx_kp_u__31, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1843, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1844
 *         query_sequence = read.query_sequence
 *         if (query_sequence is None) or (query_sequence == '*'):
 *             query_sequence = ''             # <<<<<<<<<<<<<<
 *         query_sequence = query_sequence.encode()
 * 
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__12);
    __Pyx_DECREF_SET(__pyx_v_query_sequence, __pyx_mstate_global->__pyx_kp_u__12);

    /* "HTSeq/_HTSeq.pyx":1843
 *         #types. It is then converted to ASCII
 *         query_sequence = read.query_sequence
 *         if (query_sequence is None) or (query_sequence == '*'):             # <<<<<<<<<<<<<<
 *             query_sequence = ''
 *         query_sequence = query_sequence.encode()
*/
  }

  /* "HTSeq/_HTSeq.pyx":1845
 *         if (query_sequence is None) or (query_sequence == '*'):
 *             query_sequence = ''
 *         query_sequence = query_sequence.encode()             # <<<<<<<<<<<<<<
 * 
 *         # read.qual can be empty (e.g. special filtering, artificial), then
*/
  __pyx_t_7 = __pyx_v_query_sequence;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_query_sequence, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1851
 *         # case, we cast it as an empty ASCII _and_ we have to tell the
 *         # class about the issue.
 *         if (read.qual is None) or (read.qual == "*"):             # <<<<<<<<<<<<<<
 *             seq = SequenceWithQualities(
 *                 query_sequence, read.query_name, b'',
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_qual); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_4 = __pyx_t_3;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_qual); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__31, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1851, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __pyx_t_3;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1852
 *         # class about the issue.
 *         if (read.qual is None) or (read.qual == "*"):
 *             seq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 query_sequence, read.query_name, b'',
 *                 'noquals')
*/
    __pyx_t_7 = NULL;

    /* "HTSeq/_HTSeq.pyx":1853
 *         if (read.qual is None) or (read.qual == "*"):
 *             seq = SequenceWithQualities(
 *                 query_sequence, read.query_name, b'',             # <<<<<<<<<<<<<<
 *                 'noquals')
 *         else:
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_query_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_query_sequence, __pyx_t_2, __pyx_mstate_global->__pyx_kp_b__12, __pyx_mstate_global->__pyx_n_u_noquals};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1852, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_seq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1851
 *         # case, we cast it as an empty ASCII _and_ we have to tell the
 *         # class about the issue.
 *         if (read.qual is None) or (read.qual == "*"):             # <<<<<<<<<<<<<<
 *             seq = SequenceWithQualities(
 *                 query_sequence, read.query_name, b'',
*/
    goto __pyx_L7;
  }

  /* "HTSeq/_HTSeq.pyx":1856
 *                 'noquals')
 *         else:
 *             seq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 query_sequence, read.qname, read.qual.encode(),
 *                 )
*/
  /*else*/ {
    __pyx_t_2 = NULL;

    /* "HTSeq/_HTSeq.pyx":1857
 *         else:
 *             seq = SequenceWithQualities(
 *                 query_sequence, read.qname, read.qual.encode(),             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_qname); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_qual); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __pyx_t_9;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1857, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_query_sequence, __pyx_t_7, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_seq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L7:;

  /* "HTSeq/_HTSeq.pyx":1860
 *                 )
 * 
 *         a = SAM_Alignment(seq, iv)             # <<<<<<<<<<<<<<
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, ((PyObject *)__pyx_v_seq), ((PyObject *)__pyx_v_iv)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __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, 1860, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_a = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1862
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []             # <<<<<<<<<<<<<<
 *         a.inferred_insert_size = read.template_length
 *         a.aQual = read.mapping_quality
*/
  __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_v_iv), Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1862, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1861
 * 
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (             # <<<<<<<<<<<<<<
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.template_length
*/
    { /* enter inner scope */
      __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1861, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "HTSeq/_HTSeq.pyx":1862
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []             # <<<<<<<<<<<<<<
 *         a.inferred_insert_size = read.template_length
 *         a.aQual = read.mapping_quality
*/
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_cigartuples); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1862, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2);
        __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1862, __pyx_L12_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          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, 1862, __pyx_L12_error)
              #endif
              if (__pyx_t_10 >= __pyx_temp) break;
            }
            __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_10;
          } 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, 1862, __pyx_L12_error)
              #endif
              if (__pyx_t_10 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10));
            #else
            __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10);
            #endif
            ++__pyx_t_10;
          }
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1862, __pyx_L12_error)
        } else {
          __pyx_t_7 = __pyx_t_11(__pyx_t_2);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1862, __pyx_L12_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_7);
        if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
          PyObject* sequence = __pyx_t_7;
          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, 1862, __pyx_L12_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_8);
          } else {
            __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1862, __pyx_L12_error)
            __Pyx_XGOTREF(__pyx_t_9);
            __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1862, __pyx_L12_error)
            __Pyx_XGOTREF(__pyx_t_8);
          }
          #else
          __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1862, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1862, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_12 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1862, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
          index = 0; __pyx_t_9 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          index = 1; __pyx_t_8 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_8)) goto __pyx_L15_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_8);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < (0)) __PYX_ERR(0, 1862, __pyx_L12_error)
          __pyx_t_13 = NULL;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L16_unpacking_done;
          __pyx_L15_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_13 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 1862, __pyx_L12_error)
          __pyx_L16_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_code, __pyx_t_9);
        __pyx_t_9 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_length, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "HTSeq/_HTSeq.pyx":1861
 * 
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (             # <<<<<<<<<<<<<<
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.template_length
*/
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_cigar_operation_codes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1861, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_8genexpr5__pyx_v_code); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1861, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1861, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_8);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 1861, __pyx_L12_error);
        __Pyx_INCREF(__pyx_8genexpr5__pyx_v_length);
        __Pyx_GIVEREF(__pyx_8genexpr5__pyx_v_length);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_8genexpr5__pyx_v_length) != (0)) __PYX_ERR(0, 1861, __pyx_L12_error);
        __pyx_t_8 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1861, __pyx_L12_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_code); __pyx_8genexpr5__pyx_v_code = 0;
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_length); __pyx_8genexpr5__pyx_v_length = 0;
      goto __pyx_L18_exit_scope;
      __pyx_L12_error:;
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_code); __pyx_8genexpr5__pyx_v_code = 0;
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_length); __pyx_8genexpr5__pyx_v_length = 0;
      goto __pyx_L1_error;
      __pyx_L18_exit_scope:;
    } /* exit inner scope */

    /* "HTSeq/_HTSeq.pyx":1862
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []             # <<<<<<<<<<<<<<
 *         a.inferred_insert_size = read.template_length
 *         a.aQual = read.mapping_quality
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_reference_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1862, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_v_chrom)) { __Pyx_RaiseUnboundLocalError("chrom"); __PYX_ERR(0, 1862, __pyx_L1_error) }
    __pyx_t_2 = __pyx_v_chrom;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1862, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1861
 * 
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (             # <<<<<<<<<<<<<<
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.template_length
*/
    __pyx_t_15.__pyx_n = 3;
    __pyx_t_15.ref_left = __pyx_t_14;
    __pyx_t_15.chrom = ((PyObject*)__pyx_t_2);
    __pyx_t_15.strand = __pyx_v_strand;
    __pyx_t_7 = __pyx_f_5HTSeq_6_HTSeq_build_cigar_list(((PyObject*)__pyx_t_5), 0, &__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;
  } else {

    /* "HTSeq/_HTSeq.pyx":1862
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []             # <<<<<<<<<<<<<<
 *         a.inferred_insert_size = read.template_length
 *         a.aQual = read.mapping_quality
*/
    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;
  }

  /* "HTSeq/_HTSeq.pyx":1861
 * 
 *         a = SAM_Alignment(seq, iv)
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (             # <<<<<<<<<<<<<<
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.template_length
*/
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_a->cigar);
  __Pyx_DECREF(__pyx_v_a->cigar);
  __pyx_v_a->cigar = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1863
 *         a.cigar = build_cigar_list([(cigar_operation_codes[code], length) for (
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.template_length             # <<<<<<<<<<<<<<
 *         a.aQual = read.mapping_quality
 *         a.flag = read.flag
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_template_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->inferred_insert_size = __pyx_t_14;

  /* "HTSeq/_HTSeq.pyx":1864
 *             code, length) in read.cigartuples], read.reference_start, chrom, strand) if iv != None else []
 *         a.inferred_insert_size = read.template_length
 *         a.aQual = read.mapping_quality             # <<<<<<<<<<<<<<
 *         a.flag = read.flag
 *         a.proper_pair = read.is_proper_pair
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mapping_quality); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_14 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1864, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->aQual = __pyx_t_14;

  /* "HTSeq/_HTSeq.pyx":1865
 *         a.inferred_insert_size = read.template_length
 *         a.aQual = read.mapping_quality
 *         a.flag = read.flag             # <<<<<<<<<<<<<<
 *         a.proper_pair = read.is_proper_pair
 *         a.not_primary_alignment = read.is_secondary
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_a), __pyx_mstate_global->__pyx_n_u_flag, __pyx_t_1) < (0)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1866
 *         a.aQual = read.mapping_quality
 *         a.flag = read.flag
 *         a.proper_pair = read.is_proper_pair             # <<<<<<<<<<<<<<
 *         a.not_primary_alignment = read.is_secondary
 *         a.failed_platform_qc = read.is_qcfail
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_proper_pair); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->proper_pair = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1867
 *         a.flag = read.flag
 *         a.proper_pair = read.is_proper_pair
 *         a.not_primary_alignment = read.is_secondary             # <<<<<<<<<<<<<<
 *         a.failed_platform_qc = read.is_qcfail
 *         a.pcr_or_optical_duplicate = read.is_duplicate
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_secondary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1867, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->not_primary_alignment = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1868
 *         a.proper_pair = read.is_proper_pair
 *         a.not_primary_alignment = read.is_secondary
 *         a.failed_platform_qc = read.is_qcfail             # <<<<<<<<<<<<<<
 *         a.pcr_or_optical_duplicate = read.is_duplicate
 *         a.supplementary = read.is_supplementary
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_qcfail); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->failed_platform_qc = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1869
 *         a.not_primary_alignment = read.is_secondary
 *         a.failed_platform_qc = read.is_qcfail
 *         a.pcr_or_optical_duplicate = read.is_duplicate             # <<<<<<<<<<<<<<
 *         a.supplementary = read.is_supplementary
 *         a.original_sam_line = ""
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_duplicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1869, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->pcr_or_optical_duplicate = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1870
 *         a.failed_platform_qc = read.is_qcfail
 *         a.pcr_or_optical_duplicate = read.is_duplicate
 *         a.supplementary = read.is_supplementary             # <<<<<<<<<<<<<<
 *         a.original_sam_line = ""
 *         a.optional_fields = read.tags
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_supplementary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1870, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_a->supplementary = __pyx_t_4;

  /* "HTSeq/_HTSeq.pyx":1871
 *         a.pcr_or_optical_duplicate = read.is_duplicate
 *         a.supplementary = read.is_supplementary
 *         a.original_sam_line = ""             # <<<<<<<<<<<<<<
 *         a.optional_fields = read.tags
 *         if read.is_paired:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__12);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__12);
  __Pyx_GOTREF(__pyx_v_a->original_sam_line);
  __Pyx_DECREF(__pyx_v_a->original_sam_line);
  __pyx_v_a->original_sam_line = __pyx_mstate_global->__pyx_kp_u__12;

  /* "HTSeq/_HTSeq.pyx":1872
 *         a.supplementary = read.is_supplementary
 *         a.original_sam_line = ""
 *         a.optional_fields = read.tags             # <<<<<<<<<<<<<<
 *         if read.is_paired:
 *             # These two should be but are not always consistent
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_tags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 1872, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_a->optional_fields);
  __Pyx_DECREF(__pyx_v_a->optional_fields);
  __pyx_v_a->optional_fields = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1873
 *         a.original_sam_line = ""
 *         a.optional_fields = read.tags
 *         if read.is_paired:             # <<<<<<<<<<<<<<
 *             # These two should be but are not always consistent
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_paired); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1873, __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, 1873, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "HTSeq/_HTSeq.pyx":1875
 *         if read.is_paired:
 *             # These two should be but are not always consistent
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):             # <<<<<<<<<<<<<<
 *                 strand = "-" if read.mate_is_reverse else "+"
 *                 a.mate_start = GenomicPosition(samfile.getrname(
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mate_is_unmapped); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1875, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_16 = (!__pyx_t_3);
    if (__pyx_t_16) {
    } else {
      __pyx_t_4 = __pyx_t_16;
      goto __pyx_L21_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mrnm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_16 = (__Pyx_PyLong_BoolNeObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1875, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_16;
    __pyx_L21_bool_binop_done:;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1876
 *             # These two should be but are not always consistent
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):
 *                 strand = "-" if read.mate_is_reverse else "+"             # <<<<<<<<<<<<<<
 *                 a.mate_start = GenomicPosition(samfile.getrname(
 *                     read.mrnm), read.next_reference_start, strand)
*/
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mate_is_reverse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1876, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1876, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__18);
        __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__18;
      } else {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__17);
        __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__17;
      }
      __Pyx_DECREF_SET(__pyx_v_strand, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":1877
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):
 *                 strand = "-" if read.mate_is_reverse else "+"
 *                 a.mate_start = GenomicPosition(samfile.getrname(             # <<<<<<<<<<<<<<
 *                     read.mrnm), read.next_reference_start, strand)
 *             else:
*/
      __pyx_t_7 = NULL;
      __pyx_t_5 = __pyx_v_samfile;
      __Pyx_INCREF(__pyx_t_5);

      /* "HTSeq/_HTSeq.pyx":1878
 *                 strand = "-" if read.mate_is_reverse else "+"
 *                 a.mate_start = GenomicPosition(samfile.getrname(
 *                     read.mrnm), read.next_reference_start, strand)             # <<<<<<<<<<<<<<
 *             else:
 *                 a.mate_start = None
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_mrnm); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1878, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getrname, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1877, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_next_reference_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1878, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_2, __pyx_t_8, __pyx_v_strand};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_1);
      }

      /* "HTSeq/_HTSeq.pyx":1877
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):
 *                 strand = "-" if read.mate_is_reverse else "+"
 *                 a.mate_start = GenomicPosition(samfile.getrname(             # <<<<<<<<<<<<<<
 *                     read.mrnm), read.next_reference_start, strand)
 *             else:
*/
      __Pyx_GIVEREF((PyObject *)__pyx_t_1);
      __Pyx_GOTREF((PyObject *)__pyx_v_a->mate_start);
      __Pyx_DECREF((PyObject *)__pyx_v_a->mate_start);
      __pyx_v_a->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":1875
 *         if read.is_paired:
 *             # These two should be but are not always consistent
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):             # <<<<<<<<<<<<<<
 *                 strand = "-" if read.mate_is_reverse else "+"
 *                 a.mate_start = GenomicPosition(samfile.getrname(
*/
      goto __pyx_L20;
    }

    /* "HTSeq/_HTSeq.pyx":1880
 *                     read.mrnm), read.next_reference_start, strand)
 *             else:
 *                 a.mate_start = None             # <<<<<<<<<<<<<<
 *             if read.is_read1:
 *                 a.pe_which = intern("first")
*/
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF((PyObject *)__pyx_v_a->mate_start);
      __Pyx_DECREF((PyObject *)__pyx_v_a->mate_start);
      __pyx_v_a->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None);
    }
    __pyx_L20:;

    /* "HTSeq/_HTSeq.pyx":1881
 *             else:
 *                 a.mate_start = None
 *             if read.is_read1:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_read1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __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, 1881, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1882
 *                 a.mate_start = None
 *             if read.is_read1:
 *                 a.pe_which = intern("first")             # <<<<<<<<<<<<<<
 *             elif read.is_read2:
 *                 a.pe_which = intern("second")
*/
      __pyx_t_1 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_first); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1882, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":1881
 *             else:
 *                 a.mate_start = None
 *             if read.is_read1:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
*/
      goto __pyx_L23;
    }

    /* "HTSeq/_HTSeq.pyx":1883
 *             if read.is_read1:
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("second")
 *             else:
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_read, __pyx_mstate_global->__pyx_n_u_is_read2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1883, __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, 1883, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":1884
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:
 *                 a.pe_which = intern("second")             # <<<<<<<<<<<<<<
 *             else:
 *                 a.pe_which = intern("unknown")
*/
      __pyx_t_1 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1884, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":1883
 *             if read.is_read1:
 *                 a.pe_which = intern("first")
 *             elif read.is_read2:             # <<<<<<<<<<<<<<
 *                 a.pe_which = intern("second")
 *             else:
*/
      goto __pyx_L23;
    }

    /* "HTSeq/_HTSeq.pyx":1886
 *                 a.pe_which = intern("second")
 *             else:
 *                 a.pe_which = intern("unknown")             # <<<<<<<<<<<<<<
 *         else:
 *             a.pe_which = intern("not_paired_end")
*/
    /*else*/ {
      __pyx_t_1 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_unknown); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1886, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_a->pe_which);
      __Pyx_DECREF(__pyx_v_a->pe_which);
      __pyx_v_a->pe_which = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L23:;

    /* "HTSeq/_HTSeq.pyx":1873
 *         a.original_sam_line = ""
 *         a.optional_fields = read.tags
 *         if read.is_paired:             # <<<<<<<<<<<<<<
 *             # These two should be but are not always consistent
 *             if (not read.mate_is_unmapped) and (read.mrnm != -1):
*/
    goto __pyx_L19;
  }

  /* "HTSeq/_HTSeq.pyx":1888
 *                 a.pe_which = intern("unknown")
 *         else:
 *             a.pe_which = intern("not_paired_end")             # <<<<<<<<<<<<<<
 *         return a
 * 
*/
  /*else*/ {
    __pyx_t_1 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_not_paired_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1888, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_a->pe_which);
    __Pyx_DECREF(__pyx_v_a->pe_which);
    __pyx_v_a->pe_which = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L19:;

  /* "HTSeq/_HTSeq.pyx":1889
 *         else:
 *             a.pe_which = intern("not_paired_end")
 *         return a             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_a);
  __pyx_r = ((PyObject *)__pyx_v_a);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1829
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pysam_AlignedSegment(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.from_pysam_AlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_strand);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_iv);
  __Pyx_XDECREF(__pyx_v_query_sequence);
  __Pyx_XDECREF((PyObject *)__pyx_v_seq);
  __Pyx_XDECREF((PyObject *)__pyx_v_a);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_code);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1891
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_SAM_line(cls, line):
 *         cdef str qname, flag, rname, pos, mapq, cigar,
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line(PyObject *__pyx_v_cls, 
#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_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line = {"from_SAM_line", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line(PyObject *__pyx_v_cls, 
#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_line = 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("from_SAM_line (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_line,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, 1891, __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, 1891, __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, "from_SAM_line", 0) < (0)) __PYX_ERR(0, 1891, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("from_SAM_line", 1, 1, 1, i); __PYX_ERR(0, 1891, __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, 1891, __pyx_L3_error)
    }
    __pyx_v_line = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_SAM_line", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1891, __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("HTSeq._HTSeq.SAM_Alignment.from_SAM_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8from_SAM_line(((PyTypeObject*)__pyx_v_cls), __pyx_v_line);

  /* 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_5HTSeq_6_HTSeq_13SAM_Alignment_8from_SAM_line(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_line) {
  PyObject *__pyx_v_qname = 0;
  PyObject *__pyx_v_flag = 0;
  PyObject *__pyx_v_rname = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_mapq = 0;
  PyObject *__pyx_v_cigar = 0;
  PyObject *__pyx_v_mrnm = 0;
  PyObject *__pyx_v_mpos = 0;
  PyObject *__pyx_v_isize = 0;
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_qual = 0;
  PyObject *__pyx_v_optional_fields = 0;
  int __pyx_v_posint;
  int __pyx_v_flagint;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_v_cigarlist = 0;
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *__pyx_v_swq = 0;
  PyObject *__pyx_v_fields = NULL;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_iv = NULL;
  struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_alnmt = NULL;
  PyObject *__pyx_8genexpr6__pyx_v_field = 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;
  Py_ssize_t __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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *(*__pyx_t_17)(PyObject *);
  int __pyx_t_18;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_parse_cigar __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_SAM_line", 0);

  /* "HTSeq/_HTSeq.pyx":1901
 *         cdef SequenceWithQualities swq
 * 
 *         fields = line.rstrip().split("\t")             # <<<<<<<<<<<<<<
 *         if len(fields) < 10:
 *             raise ValueError("SAM line does not contain at least 11 tab-delimited fields.")
*/
  __pyx_t_4 = __pyx_v_line;
  __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_rstrip, __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, 1901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__19};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_fields = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1902
 * 
 *         fields = line.rstrip().split("\t")
 *         if len(fields) < 10:             # <<<<<<<<<<<<<<
 *             raise ValueError("SAM line does not contain at least 11 tab-delimited fields.")
 *         (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
*/
  __pyx_t_6 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1902, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 < 10);
  if (unlikely(__pyx_t_7)) {

    /* "HTSeq/_HTSeq.pyx":1903
 *         fields = line.rstrip().split("\t")
 *         if len(fields) < 10:
 *             raise ValueError("SAM line does not contain at least 11 tab-delimited fields.")             # <<<<<<<<<<<<<<
 *         (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
 *          seq, qual) = fields[0:11]
*/
    __pyx_t_3 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_SAM_line_does_not_contain_at_lea};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1903, __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, 1903, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1902
 * 
 *         fields = line.rstrip().split("\t")
 *         if len(fields) < 10:             # <<<<<<<<<<<<<<
 *             raise ValueError("SAM line does not contain at least 11 tab-delimited fields.")
 *         (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
*/
  }

  /* "HTSeq/_HTSeq.pyx":1905
 *             raise ValueError("SAM line does not contain at least 11 tab-delimited fields.")
 *         (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
 *          seq, qual) = fields[0:11]             # <<<<<<<<<<<<<<
 *         optional_fields = fields[11:]
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_fields, 0, 11, NULL, NULL, &__pyx_mstate_global->__pyx_slice[2], 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1905, __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 != 11)) {
      if (size > 11) __Pyx_RaiseTooManyValuesError(11);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1904, __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_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 5);
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_GET_ITEM(sequence, 6);
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_12 = PyTuple_GET_ITEM(sequence, 7);
      __Pyx_INCREF(__pyx_t_12);
      __pyx_t_13 = PyTuple_GET_ITEM(sequence, 8);
      __Pyx_INCREF(__pyx_t_13);
      __pyx_t_14 = PyTuple_GET_ITEM(sequence, 9);
      __Pyx_INCREF(__pyx_t_14);
      __pyx_t_15 = PyTuple_GET_ITEM(sequence, 10);
      __Pyx_INCREF(__pyx_t_15);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 4, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 5, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 6, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 7, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 8, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_13);
      __pyx_t_14 = __Pyx_PyList_GetItemRefFast(sequence, 9, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_14);
      __pyx_t_15 = __Pyx_PyList_GetItemRefFast(sequence, 10, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1904, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_15);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[11] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15};
      for (i=0; i < 11; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1904, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[11] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15};
    __pyx_t_16 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1904, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_16);
    for (index=0; index < 11; index++) {
      PyObject* item = __pyx_t_17(__pyx_t_16); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 11) < (0)) __PYX_ERR(0, 1904, __pyx_L1_error)
    __pyx_t_17 = NULL;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_17 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1904, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }

  /* "HTSeq/_HTSeq.pyx":1904
 *         if len(fields) < 10:
 *             raise ValueError("SAM line does not contain at least 11 tab-delimited fields.")
 *         (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,             # <<<<<<<<<<<<<<
 *          seq, qual) = fields[0:11]
 *         optional_fields = fields[11:]
*/
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 1904, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1904, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 1904, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1904, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 1904, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_10))) __PYX_ERR(0, 1904, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_11))) __PYX_ERR(0, 1904, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_12))) __PYX_ERR(0, 1904, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_13))) __PYX_ERR(0, 1904, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_14))) __PYX_ERR(0, 1904, __pyx_L1_error)
  if (!(likely(PyUnicode_CheckExact(__pyx_t_15))||((__pyx_t_15) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_15))) __PYX_ERR(0, 1904, __pyx_L1_error)
  __pyx_v_qname = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_v_flag = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_v_rname = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_v_pos = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_v_mapq = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_v_cigar = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_v_mrnm = ((PyObject*)__pyx_t_11);
  __pyx_t_11 = 0;
  __pyx_v_mpos = ((PyObject*)__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_v_isize = ((PyObject*)__pyx_t_13);
  __pyx_t_13 = 0;
  __pyx_v_seq = ((PyObject*)__pyx_t_14);
  __pyx_t_14 = 0;
  __pyx_v_qual = ((PyObject*)__pyx_t_15);
  __pyx_t_15 = 0;

  /* "HTSeq/_HTSeq.pyx":1906
 *         (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
 *          seq, qual) = fields[0:11]
 *         optional_fields = fields[11:]             # <<<<<<<<<<<<<<
 * 
 *         if seq.count("=") > 0:
*/
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_fields, 11, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[3], 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 1906, __pyx_L1_error)
  __pyx_v_optional_fields = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":1908
 *         optional_fields = fields[11:]
 * 
 *         if seq.count("=") > 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Sequence in SAM file contains '=', which is not supported.")
 *         if seq.count(".") > 0:
*/
  if (unlikely(__pyx_v_seq == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "count");
    __PYX_ERR(0, 1908, __pyx_L1_error)
  }
  __pyx_t_6 = PyUnicode_Count(__pyx_v_seq, __pyx_mstate_global->__pyx_kp_u__29, 0, PY_SSIZE_T_MAX); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1908, __pyx_L1_error)
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (unlikely(__pyx_t_7)) {

    /* "HTSeq/_HTSeq.pyx":1909
 * 
 *         if seq.count("=") > 0:
 *             raise ValueError("Sequence in SAM file contains '=', which is not supported.")             # <<<<<<<<<<<<<<
 *         if seq.count(".") > 0:
 *             raise ValueError("Sequence in SAM file contains '.', which is not supported.")
*/
    __pyx_t_1 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Sequence_in_SAM_file_contains_wh};
      __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
    }
    __Pyx_Raise(__pyx_t_15, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __PYX_ERR(0, 1909, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1908
 *         optional_fields = fields[11:]
 * 
 *         if seq.count("=") > 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Sequence in SAM file contains '=', which is not supported.")
 *         if seq.count(".") > 0:
*/
  }

  /* "HTSeq/_HTSeq.pyx":1910
 *         if seq.count("=") > 0:
 *             raise ValueError("Sequence in SAM file contains '=', which is not supported.")
 *         if seq.count(".") > 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Sequence in SAM file contains '.', which is not supported.")
 *         flagint = int(flag)
*/
  if (unlikely(__pyx_v_seq == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "count");
    __PYX_ERR(0, 1910, __pyx_L1_error)
  }
  __pyx_t_6 = PyUnicode_Count(__pyx_v_seq, __pyx_mstate_global->__pyx_kp_u__8, 0, PY_SSIZE_T_MAX); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1910, __pyx_L1_error)
  __pyx_t_15 = PyLong_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_15, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1910, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1910, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_7)) {

    /* "HTSeq/_HTSeq.pyx":1911
 *             raise ValueError("Sequence in SAM file contains '=', which is not supported.")
 *         if seq.count(".") > 0:
 *             raise ValueError("Sequence in SAM file contains '.', which is not supported.")             # <<<<<<<<<<<<<<
 *         flagint = int(flag)
 * 
*/
    __pyx_t_15 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_mstate_global->__pyx_kp_u_Sequence_in_SAM_file_contains_wh_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1911, __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, 1911, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":1910
 *         if seq.count("=") > 0:
 *             raise ValueError("Sequence in SAM file contains '=', which is not supported.")
 *         if seq.count(".") > 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Sequence in SAM file contains '.', which is not supported.")
 *         flagint = int(flag)
*/
  }

  /* "HTSeq/_HTSeq.pyx":1912
 *         if seq.count(".") > 0:
 *             raise ValueError("Sequence in SAM file contains '.', which is not supported.")
 *         flagint = int(flag)             # <<<<<<<<<<<<<<
 * 
 *         if flagint & 0x0004:     # flag "query sequence is unmapped"
*/
  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_flagint = __pyx_t_18;

  /* "HTSeq/_HTSeq.pyx":1914
 *         flagint = int(flag)
 * 
 *         if flagint & 0x0004:     # flag "query sequence is unmapped"             # <<<<<<<<<<<<<<
 *             iv = None
 *             cigarlist = None
*/
  __pyx_t_7 = ((__pyx_v_flagint & 0x0004) != 0);
  if (__pyx_t_7) {

    /* "HTSeq/_HTSeq.pyx":1915
 * 
 *         if flagint & 0x0004:     # flag "query sequence is unmapped"
 *             iv = None             # <<<<<<<<<<<<<<
 *             cigarlist = None
 *         else:
*/
    __Pyx_INCREF(Py_None);
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None);

    /* "HTSeq/_HTSeq.pyx":1916
 *         if flagint & 0x0004:     # flag "query sequence is unmapped"
 *             iv = None
 *             cigarlist = None             # <<<<<<<<<<<<<<
 *         else:
 *             if rname == "*":
*/
    __Pyx_INCREF(Py_None);
    __pyx_v_cigarlist = ((PyObject*)Py_None);

    /* "HTSeq/_HTSeq.pyx":1914
 *         flagint = int(flag)
 * 
 *         if flagint & 0x0004:     # flag "query sequence is unmapped"             # <<<<<<<<<<<<<<
 *             iv = None
 *             cigarlist = None
*/
    goto __pyx_L8;
  }

  /* "HTSeq/_HTSeq.pyx":1918
 *             cigarlist = None
 *         else:
 *             if rname == "*":             # <<<<<<<<<<<<<<
 *                 raise ValueError("Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared")
 *             # SAM is one-based, but HTSeq is zero-based!
*/
  /*else*/ {
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_rname, __pyx_mstate_global->__pyx_kp_u__31, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1918, __pyx_L1_error)
    if (unlikely(__pyx_t_7)) {

      /* "HTSeq/_HTSeq.pyx":1919
 *         else:
 *             if rname == "*":
 *                 raise ValueError("Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared")             # <<<<<<<<<<<<<<
 *             # SAM is one-based, but HTSeq is zero-based!
 *             posint = int(pos) - 1
*/
      __pyx_t_15 = NULL;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_mstate_global->__pyx_kp_u_Malformed_SAM_line_RNAME_althoug};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1919, __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, 1919, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":1918
 *             cigarlist = None
 *         else:
 *             if rname == "*":             # <<<<<<<<<<<<<<
 *                 raise ValueError("Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared")
 *             # SAM is one-based, but HTSeq is zero-based!
*/
    }

    /* "HTSeq/_HTSeq.pyx":1921
 *                 raise ValueError("Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared")
 *             # SAM is one-based, but HTSeq is zero-based!
 *             posint = int(pos) - 1             # <<<<<<<<<<<<<<
 *             if flagint & 0x0010:      # flag "strand of the query"
 *                 strand = "-"
*/
    __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_15 = __Pyx_PyLong_SubtractObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_t_15); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1921, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_v_posint = __pyx_t_18;

    /* "HTSeq/_HTSeq.pyx":1922
 *             # SAM is one-based, but HTSeq is zero-based!
 *             posint = int(pos) - 1
 *             if flagint & 0x0010:      # flag "strand of the query"             # <<<<<<<<<<<<<<
 *                 strand = "-"
 *             else:
*/
    __pyx_t_7 = ((__pyx_v_flagint & 0x0010) != 0);
    if (__pyx_t_7) {

      /* "HTSeq/_HTSeq.pyx":1923
 *             posint = int(pos) - 1
 *             if flagint & 0x0010:      # flag "strand of the query"
 *                 strand = "-"             # <<<<<<<<<<<<<<
 *             else:
 *                 strand = "+"
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__18);
      __pyx_v_strand = __pyx_mstate_global->__pyx_kp_u__18;

      /* "HTSeq/_HTSeq.pyx":1922
 *             # SAM is one-based, but HTSeq is zero-based!
 *             posint = int(pos) - 1
 *             if flagint & 0x0010:      # flag "strand of the query"             # <<<<<<<<<<<<<<
 *                 strand = "-"
 *             else:
*/
      goto __pyx_L10;
    }

    /* "HTSeq/_HTSeq.pyx":1925
 *                 strand = "-"
 *             else:
 *                 strand = "+"             # <<<<<<<<<<<<<<
 *             cigarlist = parse_cigar(cigar, posint, rname, strand)
 *             iv = GenomicInterval(
*/
    /*else*/ {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__17);
      __pyx_v_strand = __pyx_mstate_global->__pyx_kp_u__17;
    }
    __pyx_L10:;

    /* "HTSeq/_HTSeq.pyx":1926
 *             else:
 *                 strand = "+"
 *             cigarlist = parse_cigar(cigar, posint, rname, strand)             # <<<<<<<<<<<<<<
 *             iv = GenomicInterval(
 *                 rname, posint, cigarlist[-1].ref_iv.end, strand)
*/
    __pyx_t_19.__pyx_n = 3;
    __pyx_t_19.ref_left = __pyx_v_posint;
    __pyx_t_19.chrom = __pyx_v_rname;
    __pyx_t_19.strand = __pyx_v_strand;
    __pyx_t_15 = __pyx_f_5HTSeq_6_HTSeq_parse_cigar(__pyx_v_cigar, 0, &__pyx_t_19); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_v_cigarlist = ((PyObject*)__pyx_t_15);
    __pyx_t_15 = 0;

    /* "HTSeq/_HTSeq.pyx":1927
 *                 strand = "+"
 *             cigarlist = parse_cigar(cigar, posint, rname, strand)
 *             iv = GenomicInterval(             # <<<<<<<<<<<<<<
 *                 rname, posint, cigarlist[-1].ref_iv.end, strand)
 * 
*/
    __pyx_t_1 = NULL;

    /* "HTSeq/_HTSeq.pyx":1928
 *             cigarlist = parse_cigar(cigar, posint, rname, strand)
 *             iv = GenomicInterval(
 *                 rname, posint, cigarlist[-1].ref_iv.end, strand)             # <<<<<<<<<<<<<<
 * 
 *         if qual != "*":
*/
    __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_posint); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    if (unlikely(__pyx_v_cigarlist == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1928, __pyx_L1_error)
    }
    __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_cigarlist, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ref_iv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_v_rname, __pyx_t_14, __pyx_t_13, __pyx_v_strand};
      __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1927, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_15);
    }
    __pyx_v_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_15);
    __pyx_t_15 = 0;
  }
  __pyx_L8:;

  /* "HTSeq/_HTSeq.pyx":1930
 *                 rname, posint, cigarlist[-1].ref_iv.end, strand)
 * 
 *         if qual != "*":             # <<<<<<<<<<<<<<
 *             swq = SequenceWithQualities(
 *                 seq.upper().encode(), qname, qual.upper().encode())
*/
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_qual, __pyx_mstate_global->__pyx_kp_u__31, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1930, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "HTSeq/_HTSeq.pyx":1931
 * 
 *         if qual != "*":
 *             swq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 seq.upper().encode(), qname, qual.upper().encode())
 *         else:
*/
    __pyx_t_13 = NULL;

    /* "HTSeq/_HTSeq.pyx":1932
 *         if qual != "*":
 *             swq = SequenceWithQualities(
 *                 seq.upper().encode(), qname, qual.upper().encode())             # <<<<<<<<<<<<<<
 *         else:
 *             swq = SequenceWithQualities(
*/
    __pyx_t_14 = __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyUnicode_Type__upper, __pyx_v_seq); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_1 = PyUnicode_AsEncodedString(((PyObject*)__pyx_t_14), NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyUnicode_Type__upper, __pyx_v_qual); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_12 = PyUnicode_AsEncodedString(((PyObject*)__pyx_t_14), NULL, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_13, __pyx_t_1, __pyx_v_qname, __pyx_t_12};
      __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1931, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_15);
    }
    __pyx_v_swq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_15);
    __pyx_t_15 = 0;

    /* "HTSeq/_HTSeq.pyx":1930
 *                 rname, posint, cigarlist[-1].ref_iv.end, strand)
 * 
 *         if qual != "*":             # <<<<<<<<<<<<<<
 *             swq = SequenceWithQualities(
 *                 seq.upper().encode(), qname, qual.upper().encode())
*/
    goto __pyx_L11;
  }

  /* "HTSeq/_HTSeq.pyx":1934
 *                 seq.upper().encode(), qname, qual.upper().encode())
 *         else:
 *             swq = SequenceWithQualities(             # <<<<<<<<<<<<<<
 *                 seq.upper().encode(), qname, b"", "noquals")
 * 
*/
  /*else*/ {
    __pyx_t_12 = NULL;

    /* "HTSeq/_HTSeq.pyx":1935
 *         else:
 *             swq = SequenceWithQualities(
 *                 seq.upper().encode(), qname, b"", "noquals")             # <<<<<<<<<<<<<<
 * 
 *         alnmt = SAM_Alignment(swq, iv)
*/
    __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyUnicode_Type__upper, __pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = PyUnicode_AsEncodedString(((PyObject*)__pyx_t_1), NULL, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_12, __pyx_t_13, __pyx_v_qname, __pyx_mstate_global->__pyx_kp_b__12, __pyx_mstate_global->__pyx_n_u_noquals};
      __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (__pyx_t_5*__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_15)) __PYX_ERR(0, 1934, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_15);
    }
    __pyx_v_swq = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_15);
    __pyx_t_15 = 0;
  }
  __pyx_L11:;

  /* "HTSeq/_HTSeq.pyx":1937
 *                 seq.upper().encode(), qname, b"", "noquals")
 * 
 *         alnmt = SAM_Alignment(swq, iv)             # <<<<<<<<<<<<<<
 *         alnmt.flag = flagint
 *         alnmt.cigar = cigarlist
*/
  __pyx_t_13 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_13, ((PyObject *)__pyx_v_swq), ((PyObject *)__pyx_v_iv)};
    __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1937, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_15);
  }
  __pyx_v_alnmt = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_t_15);
  __pyx_t_15 = 0;

  /* "HTSeq/_HTSeq.pyx":1938
 * 
 *         alnmt = SAM_Alignment(swq, iv)
 *         alnmt.flag = flagint             # <<<<<<<<<<<<<<
 *         alnmt.cigar = cigarlist
 *         alnmt.optional_fields = [
*/
  __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_flagint); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_alnmt), __pyx_mstate_global->__pyx_n_u_flag, __pyx_t_15) < (0)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "HTSeq/_HTSeq.pyx":1939
 *         alnmt = SAM_Alignment(swq, iv)
 *         alnmt.flag = flagint
 *         alnmt.cigar = cigarlist             # <<<<<<<<<<<<<<
 *         alnmt.optional_fields = [
 *             (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]
*/
  __Pyx_INCREF(__pyx_v_cigarlist);
  __Pyx_GIVEREF(__pyx_v_cigarlist);
  __Pyx_GOTREF(__pyx_v_alnmt->cigar);
  __Pyx_DECREF(__pyx_v_alnmt->cigar);
  __pyx_v_alnmt->cigar = __pyx_v_cigarlist;

  /* "HTSeq/_HTSeq.pyx":1940
 *         alnmt.flag = flagint
 *         alnmt.cigar = cigarlist
 *         alnmt.optional_fields = [             # <<<<<<<<<<<<<<
 *             (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]
 *         alnmt.aQual = int(mapq)
*/
  { /* enter inner scope */
    __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1940, __pyx_L14_error)
    __Pyx_GOTREF(__pyx_t_15);

    /* "HTSeq/_HTSeq.pyx":1941
 *         alnmt.cigar = cigarlist
 *         alnmt.optional_fields = [
 *             (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]             # <<<<<<<<<<<<<<
 *         alnmt.aQual = int(mapq)
 *         alnmt.inferred_insert_size = int(isize)
*/
    if (unlikely(__pyx_v_optional_fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 1941, __pyx_L14_error)
    }
    __pyx_t_13 = __pyx_v_optional_fields; __Pyx_INCREF(__pyx_t_13);
    __pyx_t_6 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1941, __pyx_L14_error)
        #endif
        if (__pyx_t_6 >= __pyx_temp) break;
      }
      __pyx_t_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_13, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
      ++__pyx_t_6;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1941, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_field, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_8genexpr6__pyx_v_field, 0, 2, NULL, NULL, &__pyx_mstate_global->__pyx_slice[4], 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1941, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_1 = __pyx_8genexpr6__pyx_v_field;
      __Pyx_INCREF(__pyx_t_1);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1941, __pyx_L14_error)
      __pyx_t_14 = __pyx_f_5HTSeq_6_HTSeq__parse_SAM_optional_field_value(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1941, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1941, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 1941, __pyx_L14_error);
      __Pyx_GIVEREF(__pyx_t_14);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_14) != (0)) __PYX_ERR(0, 1941, __pyx_L14_error);
      __pyx_t_12 = 0;
      __pyx_t_14 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_15, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1940, __pyx_L14_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_field); __pyx_8genexpr6__pyx_v_field = 0;
    goto __pyx_L18_exit_scope;
    __pyx_L14_error:;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_field); __pyx_8genexpr6__pyx_v_field = 0;
    goto __pyx_L1_error;
    __pyx_L18_exit_scope:;
  } /* exit inner scope */

  /* "HTSeq/_HTSeq.pyx":1940
 *         alnmt.flag = flagint
 *         alnmt.cigar = cigarlist
 *         alnmt.optional_fields = [             # <<<<<<<<<<<<<<
 *             (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]
 *         alnmt.aQual = int(mapq)
*/
  __Pyx_GIVEREF(__pyx_t_15);
  __Pyx_GOTREF(__pyx_v_alnmt->optional_fields);
  __Pyx_DECREF(__pyx_v_alnmt->optional_fields);
  __pyx_v_alnmt->optional_fields = ((PyObject*)__pyx_t_15);
  __pyx_t_15 = 0;

  /* "HTSeq/_HTSeq.pyx":1942
 *         alnmt.optional_fields = [
 *             (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]
 *         alnmt.aQual = int(mapq)             # <<<<<<<<<<<<<<
 *         alnmt.inferred_insert_size = int(isize)
 *         alnmt.original_sam_line = line
*/
  __pyx_t_15 = __Pyx_PyNumber_Int(__pyx_v_mapq); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_t_15); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1942, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_v_alnmt->aQual = __pyx_t_18;

  /* "HTSeq/_HTSeq.pyx":1943
 *             (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]
 *         alnmt.aQual = int(mapq)
 *         alnmt.inferred_insert_size = int(isize)             # <<<<<<<<<<<<<<
 *         alnmt.original_sam_line = line
 * 
*/
  __pyx_t_15 = __Pyx_PyNumber_Int(__pyx_v_isize); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_t_15); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1943, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_v_alnmt->inferred_insert_size = __pyx_t_18;

  /* "HTSeq/_HTSeq.pyx":1944
 *         alnmt.aQual = int(mapq)
 *         alnmt.inferred_insert_size = int(isize)
 *         alnmt.original_sam_line = line             # <<<<<<<<<<<<<<
 * 
 *         if flagint & 0x0001:         # flag "read is paired in sequencing"
*/
  __pyx_t_15 = __pyx_v_line;
  __Pyx_INCREF(__pyx_t_15);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_15))||((__pyx_t_15) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_15))) __PYX_ERR(0, 1944, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_15);
  __Pyx_GOTREF(__pyx_v_alnmt->original_sam_line);
  __Pyx_DECREF(__pyx_v_alnmt->original_sam_line);
  __pyx_v_alnmt->original_sam_line = ((PyObject*)__pyx_t_15);
  __pyx_t_15 = 0;

  /* "HTSeq/_HTSeq.pyx":1946
 *         alnmt.original_sam_line = line
 * 
 *         if flagint & 0x0001:         # flag "read is paired in sequencing"             # <<<<<<<<<<<<<<
 *             if flagint & 0x0008:      # flag "mate is unmapped"
 *                 alnmt.mate_start = None
*/
  __pyx_t_7 = ((__pyx_v_flagint & 0x0001) != 0);
  if (__pyx_t_7) {

    /* "HTSeq/_HTSeq.pyx":1947
 * 
 *         if flagint & 0x0001:         # flag "read is paired in sequencing"
 *             if flagint & 0x0008:      # flag "mate is unmapped"             # <<<<<<<<<<<<<<
 *                 alnmt.mate_start = None
 *             else:
*/
    __pyx_t_7 = ((__pyx_v_flagint & 0x0008) != 0);
    if (__pyx_t_7) {

      /* "HTSeq/_HTSeq.pyx":1948
 *         if flagint & 0x0001:         # flag "read is paired in sequencing"
 *             if flagint & 0x0008:      # flag "mate is unmapped"
 *                 alnmt.mate_start = None             # <<<<<<<<<<<<<<
 *             else:
 *                 if mrnm == "*":
*/
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF((PyObject *)__pyx_v_alnmt->mate_start);
      __Pyx_DECREF((PyObject *)__pyx_v_alnmt->mate_start);
      __pyx_v_alnmt->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None);

      /* "HTSeq/_HTSeq.pyx":1947
 * 
 *         if flagint & 0x0001:         # flag "read is paired in sequencing"
 *             if flagint & 0x0008:      # flag "mate is unmapped"             # <<<<<<<<<<<<<<
 *                 alnmt.mate_start = None
 *             else:
*/
      goto __pyx_L20;
    }

    /* "HTSeq/_HTSeq.pyx":1950
 *                 alnmt.mate_start = None
 *             else:
 *                 if mrnm == "*":             # <<<<<<<<<<<<<<
 *                     raise ValueError("Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared")
 *                 posint = int(mpos) - 1
*/
    /*else*/ {
      __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_mrnm, __pyx_mstate_global->__pyx_kp_u__31, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1950, __pyx_L1_error)
      if (unlikely(__pyx_t_7)) {

        /* "HTSeq/_HTSeq.pyx":1951
 *             else:
 *                 if mrnm == "*":
 *                     raise ValueError("Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared")             # <<<<<<<<<<<<<<
 *                 posint = int(mpos) - 1
 *                 if flagint & 0x0020:   # flag "strand of the mate"
*/
        __pyx_t_13 = NULL;
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_Malformed_SAM_line_MRNM_although};
          __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1951, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
        }
        __Pyx_Raise(__pyx_t_15, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __PYX_ERR(0, 1951, __pyx_L1_error)

        /* "HTSeq/_HTSeq.pyx":1950
 *                 alnmt.mate_start = None
 *             else:
 *                 if mrnm == "*":             # <<<<<<<<<<<<<<
 *                     raise ValueError("Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared")
 *                 posint = int(mpos) - 1
*/
      }

      /* "HTSeq/_HTSeq.pyx":1952
 *                 if mrnm == "*":
 *                     raise ValueError("Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared")
 *                 posint = int(mpos) - 1             # <<<<<<<<<<<<<<
 *                 if flagint & 0x0020:   # flag "strand of the mate"
 *                     strand = "-"
*/
      __pyx_t_15 = __Pyx_PyNumber_Int(__pyx_v_mpos); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1952, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_13 = __Pyx_PyLong_SubtractObjC(__pyx_t_15, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1952, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_18 = __Pyx_PyLong_As_int(__pyx_t_13); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_v_posint = __pyx_t_18;

      /* "HTSeq/_HTSeq.pyx":1953
 *                     raise ValueError("Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared")
 *                 posint = int(mpos) - 1
 *                 if flagint & 0x0020:   # flag "strand of the mate"             # <<<<<<<<<<<<<<
 *                     strand = "-"
 *                 else:
*/
      __pyx_t_7 = ((__pyx_v_flagint & 0x0020) != 0);
      if (__pyx_t_7) {

        /* "HTSeq/_HTSeq.pyx":1954
 *                 posint = int(mpos) - 1
 *                 if flagint & 0x0020:   # flag "strand of the mate"
 *                     strand = "-"             # <<<<<<<<<<<<<<
 *                 else:
 *                     strand = "+"
*/
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__18);
        __Pyx_XDECREF_SET(__pyx_v_strand, __pyx_mstate_global->__pyx_kp_u__18);

        /* "HTSeq/_HTSeq.pyx":1953
 *                     raise ValueError("Malformed SAM line: MRNM == '*' although flag bit &0x0008 cleared")
 *                 posint = int(mpos) - 1
 *                 if flagint & 0x0020:   # flag "strand of the mate"             # <<<<<<<<<<<<<<
 *                     strand = "-"
 *                 else:
*/
        goto __pyx_L22;
      }

      /* "HTSeq/_HTSeq.pyx":1956
 *                     strand = "-"
 *                 else:
 *                     strand = "+"             # <<<<<<<<<<<<<<
 *                 alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
 *                 if alnmt.mate_start.chrom == "=":
*/
      /*else*/ {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__17);
        __Pyx_XDECREF_SET(__pyx_v_strand, __pyx_mstate_global->__pyx_kp_u__17);
      }
      __pyx_L22:;

      /* "HTSeq/_HTSeq.pyx":1957
 *                 else:
 *                     strand = "+"
 *                 alnmt.mate_start = GenomicPosition(mrnm, posint, strand)             # <<<<<<<<<<<<<<
 *                 if alnmt.mate_start.chrom == "=":
 *                     if alnmt.iv is not None:
*/
      __pyx_t_15 = NULL;
      __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_posint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_15, __pyx_v_mrnm, __pyx_t_1, __pyx_v_strand};
        __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1957, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_13);
      }
      __Pyx_GIVEREF((PyObject *)__pyx_t_13);
      __Pyx_GOTREF((PyObject *)__pyx_v_alnmt->mate_start);
      __Pyx_DECREF((PyObject *)__pyx_v_alnmt->mate_start);
      __pyx_v_alnmt->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_t_13);
      __pyx_t_13 = 0;

      /* "HTSeq/_HTSeq.pyx":1958
 *                     strand = "+"
 *                 alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
 *                 if alnmt.mate_start.chrom == "=":             # <<<<<<<<<<<<<<
 *                     if alnmt.iv is not None:
 *                         alnmt.mate_start.chrom = alnmt.iv.chrom
*/
      __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_alnmt->mate_start->__pyx_base.chrom, __pyx_mstate_global->__pyx_kp_u__29, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1958, __pyx_L1_error)
      if (__pyx_t_7) {

        /* "HTSeq/_HTSeq.pyx":1959
 *                 alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
 *                 if alnmt.mate_start.chrom == "=":
 *                     if alnmt.iv is not None:             # <<<<<<<<<<<<<<
 *                         alnmt.mate_start.chrom = alnmt.iv.chrom
 *             if flagint & 0x0040:
*/
        __pyx_t_7 = (((PyObject *)__pyx_v_alnmt->__pyx_base.__pyx_base.iv) != Py_None);
        if (__pyx_t_7) {

          /* "HTSeq/_HTSeq.pyx":1960
 *                 if alnmt.mate_start.chrom == "=":
 *                     if alnmt.iv is not None:
 *                         alnmt.mate_start.chrom = alnmt.iv.chrom             # <<<<<<<<<<<<<<
 *             if flagint & 0x0040:
 *                 alnmt.pe_which = intern("first")
*/
          __pyx_t_13 = __pyx_v_alnmt->__pyx_base.__pyx_base.iv->chrom;
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __Pyx_GOTREF(__pyx_v_alnmt->mate_start->__pyx_base.chrom);
          __Pyx_DECREF(__pyx_v_alnmt->mate_start->__pyx_base.chrom);
          __pyx_v_alnmt->mate_start->__pyx_base.chrom = ((PyObject*)__pyx_t_13);
          __pyx_t_13 = 0;

          /* "HTSeq/_HTSeq.pyx":1959
 *                 alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
 *                 if alnmt.mate_start.chrom == "=":
 *                     if alnmt.iv is not None:             # <<<<<<<<<<<<<<
 *                         alnmt.mate_start.chrom = alnmt.iv.chrom
 *             if flagint & 0x0040:
*/
        }

        /* "HTSeq/_HTSeq.pyx":1958
 *                     strand = "+"
 *                 alnmt.mate_start = GenomicPosition(mrnm, posint, strand)
 *                 if alnmt.mate_start.chrom == "=":             # <<<<<<<<<<<<<<
 *                     if alnmt.iv is not None:
 *                         alnmt.mate_start.chrom = alnmt.iv.chrom
*/
      }
    }
    __pyx_L20:;

    /* "HTSeq/_HTSeq.pyx":1961
 *                     if alnmt.iv is not None:
 *                         alnmt.mate_start.chrom = alnmt.iv.chrom
 *             if flagint & 0x0040:             # <<<<<<<<<<<<<<
 *                 alnmt.pe_which = intern("first")
 *             elif flagint & 0x0080:
*/
    __pyx_t_7 = ((__pyx_v_flagint & 0x0040) != 0);
    if (__pyx_t_7) {

      /* "HTSeq/_HTSeq.pyx":1962
 *                         alnmt.mate_start.chrom = alnmt.iv.chrom
 *             if flagint & 0x0040:
 *                 alnmt.pe_which = intern("first")             # <<<<<<<<<<<<<<
 *             elif flagint & 0x0080:
 *                 alnmt.pe_which = intern("second")
*/
      __pyx_t_13 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_first); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1962, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_13))) __PYX_ERR(0, 1962, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_13);
      __Pyx_GOTREF(__pyx_v_alnmt->pe_which);
      __Pyx_DECREF(__pyx_v_alnmt->pe_which);
      __pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_13);
      __pyx_t_13 = 0;

      /* "HTSeq/_HTSeq.pyx":1961
 *                     if alnmt.iv is not None:
 *                         alnmt.mate_start.chrom = alnmt.iv.chrom
 *             if flagint & 0x0040:             # <<<<<<<<<<<<<<
 *                 alnmt.pe_which = intern("first")
 *             elif flagint & 0x0080:
*/
      goto __pyx_L25;
    }

    /* "HTSeq/_HTSeq.pyx":1963
 *             if flagint & 0x0040:
 *                 alnmt.pe_which = intern("first")
 *             elif flagint & 0x0080:             # <<<<<<<<<<<<<<
 *                 alnmt.pe_which = intern("second")
 *             else:
*/
    __pyx_t_7 = ((__pyx_v_flagint & 0x0080) != 0);
    if (__pyx_t_7) {

      /* "HTSeq/_HTSeq.pyx":1964
 *                 alnmt.pe_which = intern("first")
 *             elif flagint & 0x0080:
 *                 alnmt.pe_which = intern("second")             # <<<<<<<<<<<<<<
 *             else:
 *                 alnmt.pe_which = intern("unknown")
*/
      __pyx_t_13 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_second); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_13))) __PYX_ERR(0, 1964, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_13);
      __Pyx_GOTREF(__pyx_v_alnmt->pe_which);
      __Pyx_DECREF(__pyx_v_alnmt->pe_which);
      __pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_13);
      __pyx_t_13 = 0;

      /* "HTSeq/_HTSeq.pyx":1963
 *             if flagint & 0x0040:
 *                 alnmt.pe_which = intern("first")
 *             elif flagint & 0x0080:             # <<<<<<<<<<<<<<
 *                 alnmt.pe_which = intern("second")
 *             else:
*/
      goto __pyx_L25;
    }

    /* "HTSeq/_HTSeq.pyx":1966
 *                 alnmt.pe_which = intern("second")
 *             else:
 *                 alnmt.pe_which = intern("unknown")             # <<<<<<<<<<<<<<
 *         else:
 *             alnmt.mate_start = None
*/
    /*else*/ {
      __pyx_t_13 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_unknown); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_13))) __PYX_ERR(0, 1966, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_13);
      __Pyx_GOTREF(__pyx_v_alnmt->pe_which);
      __Pyx_DECREF(__pyx_v_alnmt->pe_which);
      __pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_13);
      __pyx_t_13 = 0;
    }
    __pyx_L25:;

    /* "HTSeq/_HTSeq.pyx":1946
 *         alnmt.original_sam_line = line
 * 
 *         if flagint & 0x0001:         # flag "read is paired in sequencing"             # <<<<<<<<<<<<<<
 *             if flagint & 0x0008:      # flag "mate is unmapped"
 *                 alnmt.mate_start = None
*/
    goto __pyx_L19;
  }

  /* "HTSeq/_HTSeq.pyx":1968
 *                 alnmt.pe_which = intern("unknown")
 *         else:
 *             alnmt.mate_start = None             # <<<<<<<<<<<<<<
 *             alnmt.pe_which = intern("not_paired_end")
 * 
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_alnmt->mate_start);
    __Pyx_DECREF((PyObject *)__pyx_v_alnmt->mate_start);
    __pyx_v_alnmt->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None);

    /* "HTSeq/_HTSeq.pyx":1969
 *         else:
 *             alnmt.mate_start = None
 *             alnmt.pe_which = intern("not_paired_end")             # <<<<<<<<<<<<<<
 * 
 *         alnmt.proper_pair = flagint & 0x0002 > 0
*/
    __pyx_t_13 = __Pyx_Intern(__pyx_mstate_global->__pyx_n_u_not_paired_end); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_13))) __PYX_ERR(0, 1969, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_13);
    __Pyx_GOTREF(__pyx_v_alnmt->pe_which);
    __Pyx_DECREF(__pyx_v_alnmt->pe_which);
    __pyx_v_alnmt->pe_which = ((PyObject*)__pyx_t_13);
    __pyx_t_13 = 0;
  }
  __pyx_L19:;

  /* "HTSeq/_HTSeq.pyx":1971
 *             alnmt.pe_which = intern("not_paired_end")
 * 
 *         alnmt.proper_pair = flagint & 0x0002 > 0             # <<<<<<<<<<<<<<
 *         alnmt.not_primary_alignment = flagint & 0x0100 > 0
 *         alnmt.failed_platform_qc = flagint & 0x0200 > 0
*/
  __pyx_v_alnmt->proper_pair = ((__pyx_v_flagint & 0x0002) > 0);

  /* "HTSeq/_HTSeq.pyx":1972
 * 
 *         alnmt.proper_pair = flagint & 0x0002 > 0
 *         alnmt.not_primary_alignment = flagint & 0x0100 > 0             # <<<<<<<<<<<<<<
 *         alnmt.failed_platform_qc = flagint & 0x0200 > 0
 *         alnmt.pcr_or_optical_duplicate = flagint & 0x0400 > 0
*/
  __pyx_v_alnmt->not_primary_alignment = ((__pyx_v_flagint & 0x0100) > 0);

  /* "HTSeq/_HTSeq.pyx":1973
 *         alnmt.proper_pair = flagint & 0x0002 > 0
 *         alnmt.not_primary_alignment = flagint & 0x0100 > 0
 *         alnmt.failed_platform_qc = flagint & 0x0200 > 0             # <<<<<<<<<<<<<<
 *         alnmt.pcr_or_optical_duplicate = flagint & 0x0400 > 0
 *         alnmt.supplementary = flagint & 0x0800 > 0
*/
  __pyx_v_alnmt->failed_platform_qc = ((__pyx_v_flagint & 0x0200) > 0);

  /* "HTSeq/_HTSeq.pyx":1974
 *         alnmt.not_primary_alignment = flagint & 0x0100 > 0
 *         alnmt.failed_platform_qc = flagint & 0x0200 > 0
 *         alnmt.pcr_or_optical_duplicate = flagint & 0x0400 > 0             # <<<<<<<<<<<<<<
 *         alnmt.supplementary = flagint & 0x0800 > 0
 * 
*/
  __pyx_v_alnmt->pcr_or_optical_duplicate = ((__pyx_v_flagint & 0x0400) > 0);

  /* "HTSeq/_HTSeq.pyx":1975
 *         alnmt.failed_platform_qc = flagint & 0x0200 > 0
 *         alnmt.pcr_or_optical_duplicate = flagint & 0x0400 > 0
 *         alnmt.supplementary = flagint & 0x0800 > 0             # <<<<<<<<<<<<<<
 * 
 *         return alnmt
*/
  __pyx_v_alnmt->supplementary = ((__pyx_v_flagint & 0x0800) > 0);

  /* "HTSeq/_HTSeq.pyx":1977
 *         alnmt.supplementary = flagint & 0x0800 > 0
 * 
 *         return alnmt             # <<<<<<<<<<<<<<
 * 
 *     property flag:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_alnmt);
  __pyx_r = ((PyObject *)__pyx_v_alnmt);
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1891
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_SAM_line(cls, line):
 *         cdef str qname, flag, rname, pos, mapq, cigar,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.from_SAM_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_qname);
  __Pyx_XDECREF(__pyx_v_flag);
  __Pyx_XDECREF(__pyx_v_rname);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_mapq);
  __Pyx_XDECREF(__pyx_v_cigar);
  __Pyx_XDECREF(__pyx_v_mrnm);
  __Pyx_XDECREF(__pyx_v_mpos);
  __Pyx_XDECREF(__pyx_v_isize);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XDECREF(__pyx_v_qual);
  __Pyx_XDECREF(__pyx_v_optional_fields);
  __Pyx_XDECREF(__pyx_v_strand);
  __Pyx_XDECREF(__pyx_v_cigarlist);
  __Pyx_XDECREF((PyObject *)__pyx_v_swq);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF((PyObject *)__pyx_v_iv);
  __Pyx_XDECREF((PyObject *)__pyx_v_alnmt);
  __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_field);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1980
 * 
 *     property flag:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._flag
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

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

  /* "HTSeq/_HTSeq.pyx":1981
 *     property flag:
 *         def __get__(self):
 *             return self._flag             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1980
 * 
 *     property flag:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._flag
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.flag.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1983
 *             return self._flag
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._flag = value
 * 
*/

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "HTSeq/_HTSeq.pyx":1984
 * 
 *         def __set__(self, value):
 *             self._flag = value             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L1_error)
  __pyx_v_self->_flag = __pyx_t_1;

  /* "HTSeq/_HTSeq.pyx":1983
 *             return self._flag
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._flag = value
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.flag.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1986
 *             self._flag = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def paired_end(self):
 *         return self.pe_which != "not_paired_end"
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1988
 *     @property
 *     def paired_end(self):
 *         return self.pe_which != "not_paired_end"             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->pe_which, __pyx_mstate_global->__pyx_n_u_not_paired_end, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1988, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1986
 *             self._flag = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def paired_end(self):
 *         return self.pe_which != "not_paired_end"
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.paired_end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1990
 *         return self.pe_which != "not_paired_end"
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def mate_aligned(self):
 *         return self.mate_start is not None
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "HTSeq/_HTSeq.pyx":1992
 *     @property
 *     def mate_aligned(self):
 *         return self.mate_start is not None             # <<<<<<<<<<<<<<
 * 
 *     def get_sam_line(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (((PyObject *)__pyx_v_self->mate_start) != Py_None);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1990
 *         return self.pe_which != "not_paired_end"
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def mate_aligned(self):
 *         return self.mate_start is not None
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.mate_aligned.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":1994
 *         return self.mate_start is not None
 * 
 *     def get_sam_line(self):             # <<<<<<<<<<<<<<
 *         cdef str cigar = ""
 *         cdef GenomicInterval query_start, mate_start
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line(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_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line = {"get_sam_line", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_sam_line (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_sam_line", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_sam_line", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10get_sam_line(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10get_sam_line(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_v_cigar = 0;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_query_start = 0;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *__pyx_v_mate_start = 0;
  struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v_cop = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  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;
  size_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_sam_line", 0);

  /* "HTSeq/_HTSeq.pyx":1995
 * 
 *     def get_sam_line(self):
 *         cdef str cigar = ""             # <<<<<<<<<<<<<<
 *         cdef GenomicInterval query_start, mate_start
 *         cdef CigarOperation cop
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__12);
  __pyx_v_cigar = __pyx_mstate_global->__pyx_kp_u__12;

  /* "HTSeq/_HTSeq.pyx":1999
 *         cdef CigarOperation cop
 * 
 *         if self.aligned:             # <<<<<<<<<<<<<<
 *             query_start = self.iv
 *         else:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_aligned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":2000
 * 
 *         if self.aligned:
 *             query_start = self.iv             # <<<<<<<<<<<<<<
 *         else:
 *             query_start = GenomicPosition("*", -1)
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v_query_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":1999
 *         cdef CigarOperation cop
 * 
 *         if self.aligned:             # <<<<<<<<<<<<<<
 *             query_start = self.iv
 *         else:
*/
    goto __pyx_L3;
  }

  /* "HTSeq/_HTSeq.pyx":2002
 *             query_start = self.iv
 *         else:
 *             query_start = GenomicPosition("*", -1)             # <<<<<<<<<<<<<<
 * 
 *         if self.mate_start is not None:
*/
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_mstate_global->__pyx_tuple[3], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2002, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_query_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "HTSeq/_HTSeq.pyx":2004
 *             query_start = GenomicPosition("*", -1)
 * 
 *         if self.mate_start is not None:             # <<<<<<<<<<<<<<
 *             mate_start = self.mate_start
 *         else:
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_self->mate_start) != Py_None);
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":2005
 * 
 *         if self.mate_start is not None:
 *             mate_start = self.mate_start             # <<<<<<<<<<<<<<
 *         else:
 *             mate_start = GenomicPosition("*", -1)
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self->mate_start);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v_mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":2004
 *             query_start = GenomicPosition("*", -1)
 * 
 *         if self.mate_start is not None:             # <<<<<<<<<<<<<<
 *             mate_start = self.mate_start
 *         else:
*/
    goto __pyx_L4;
  }

  /* "HTSeq/_HTSeq.pyx":2007
 *             mate_start = self.mate_start
 *         else:
 *             mate_start = GenomicPosition("*", -1)             # <<<<<<<<<<<<<<
 * 
 *         if self.cigar is not None:
*/
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition), __pyx_mstate_global->__pyx_tuple[3], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "HTSeq/_HTSeq.pyx":2009
 *             mate_start = GenomicPosition("*", -1)
 * 
 *         if self.cigar is not None:             # <<<<<<<<<<<<<<
 *             for cop in self.cigar:
 *                 cigar += str(cop.size) + cop.type
*/
  __pyx_t_2 = (__pyx_v_self->cigar != ((PyObject*)Py_None));
  if (__pyx_t_2) {

    /* "HTSeq/_HTSeq.pyx":2010
 * 
 *         if self.cigar is not None:
 *             for cop in self.cigar:             # <<<<<<<<<<<<<<
 *                 cigar += str(cop.size) + cop.type
 *         else:
*/
    if (unlikely(__pyx_v_self->cigar == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 2010, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->cigar; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2010, __pyx_L1_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
      ++__pyx_t_3;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation))))) __PYX_ERR(0, 2010, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_cop, ((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "HTSeq/_HTSeq.pyx":2011
 *         if self.cigar is not None:
 *             for cop in self.cigar:
 *                 cigar += str(cop.size) + cop.type             # <<<<<<<<<<<<<<
 *         else:
 *             cigar = "*"
*/
      __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_cop->size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_5, __pyx_v_cop->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_v_cigar, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_cigar, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "HTSeq/_HTSeq.pyx":2010
 * 
 *         if self.cigar is not None:
 *             for cop in self.cigar:             # <<<<<<<<<<<<<<
 *                 cigar += str(cop.size) + cop.type
 *         else:
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "HTSeq/_HTSeq.pyx":2009
 *             mate_start = GenomicPosition("*", -1)
 * 
 *         if self.cigar is not None:             # <<<<<<<<<<<<<<
 *             for cop in self.cigar:
 *                 cigar += str(cop.size) + cop.type
*/
    goto __pyx_L5;
  }

  /* "HTSeq/_HTSeq.pyx":2013
 *                 cigar += str(cop.size) + cop.type
 *         else:
 *             cigar = "*"             # <<<<<<<<<<<<<<
 * 
 *         return '\t'.join(
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__31);
    __Pyx_DECREF_SET(__pyx_v_cigar, __pyx_mstate_global->__pyx_kp_u__31);
  }
  __pyx_L5:;

  /* "HTSeq/_HTSeq.pyx":2015
 *             cigar = "*"
 * 
 *         return '\t'.join(             # <<<<<<<<<<<<<<
 *                 (self.read.name,
 *                  str(self.flag),
*/
  __Pyx_XDECREF(__pyx_r);

  /* "HTSeq/_HTSeq.pyx":2016
 * 
 *         return '\t'.join(
 *                 (self.read.name,             # <<<<<<<<<<<<<<
 *                  str(self.flag),
 *                  query_start.chrom,
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2017
 *         return '\t'.join(
 *                 (self.read.name,
 *                  str(self.flag),             # <<<<<<<<<<<<<<
 *                  query_start.chrom,
 *                  str(query_start.start + 1),
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2019
 *                  str(self.flag),
 *                  query_start.chrom,
 *                  str(query_start.start + 1),             # <<<<<<<<<<<<<<
 *                  str(self.aQual),
 *                  cigar,
*/
  __pyx_t_1 = __Pyx_PyLong_From_long((__pyx_v_query_start->start + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2020
 *                  query_start.chrom,
 *                  str(query_start.start + 1),
 *                  str(self.aQual),             # <<<<<<<<<<<<<<
 *                  cigar,
 *                  mate_start.chrom,
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2023
 *                  cigar,
 *                  mate_start.chrom,
 *                  str(mate_start.pos + 1),             # <<<<<<<<<<<<<<
 *                  str(self.inferred_insert_size),
 *                  self.read_as_aligned.seq.decode(),
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mate_start), __pyx_mstate_global->__pyx_n_u_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":2024
 *                  mate_start.chrom,
 *                  str(mate_start.pos + 1),
 *                  str(self.inferred_insert_size),             # <<<<<<<<<<<<<<
 *                  self.read_as_aligned.seq.decode(),
 *                  self.read_as_aligned.qualstr.decode(),
*/
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":2025
 *                  str(mate_start.pos + 1),
 *                  str(self.inferred_insert_size),
 *                  self.read_as_aligned.seq.decode(),             # <<<<<<<<<<<<<<
 *                  self.read_as_aligned.qualstr.decode(),
 *                  '\t'.join(self.raw_optional_fields())))
*/
  if (unlikely(__pyx_v_self->__pyx_base.read_as_aligned->__pyx_base.seq == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
    __PYX_ERR(0, 2025, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_decode_bytes(__pyx_v_self->__pyx_base.read_as_aligned->__pyx_base.seq, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "HTSeq/_HTSeq.pyx":2026
 *                  str(self.inferred_insert_size),
 *                  self.read_as_aligned.seq.decode(),
 *                  self.read_as_aligned.qualstr.decode(),             # <<<<<<<<<<<<<<
 *                  '\t'.join(self.raw_optional_fields())))
 * 
*/
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned), __pyx_mstate_global->__pyx_n_u_qualstr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_11 = __pyx_t_12;
  __Pyx_INCREF(__pyx_t_11);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }

  /* "HTSeq/_HTSeq.pyx":2027
 *                  self.read_as_aligned.seq.decode(),
 *                  self.read_as_aligned.qualstr.decode(),
 *                  '\t'.join(self.raw_optional_fields())))             # <<<<<<<<<<<<<<
 * 
 *     def has_optional_field(SAM_Alignment self, str tag):
*/
  __pyx_t_11 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_11);
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_raw_optional_fields, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2027, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
  }
  __pyx_t_11 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__19, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "HTSeq/_HTSeq.pyx":2016
 * 
 *         return '\t'.join(
 *                 (self.read.name,             # <<<<<<<<<<<<<<
 *                  str(self.flag),
 *                  query_start.chrom,
*/
  __pyx_t_12 = PyTuple_New(12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_query_start->chrom);
  __Pyx_GIVEREF(__pyx_v_query_start->chrom);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_query_start->chrom) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_6) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_7) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_cigar);
  __Pyx_GIVEREF(__pyx_v_cigar);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_v_cigar) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_mate_start->chrom);
  __Pyx_GIVEREF(__pyx_v_mate_start->chrom);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_v_mate_start->chrom) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_1) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_t_8) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_10) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 11, __pyx_t_11) != (0)) __PYX_ERR(0, 2016, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_1 = 0;
  __pyx_t_9 = 0;
  __pyx_t_8 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;

  /* "HTSeq/_HTSeq.pyx":2015
 *             cigar = "*"
 * 
 *         return '\t'.join(             # <<<<<<<<<<<<<<
 *                 (self.read.name,
 *                  str(self.flag),
*/
  __pyx_t_11 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__19, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":1994
 *         return self.mate_start is not None
 * 
 *     def get_sam_line(self):             # <<<<<<<<<<<<<<
 *         cdef str cigar = ""
 *         cdef GenomicInterval query_start, mate_start
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.get_sam_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cigar);
  __Pyx_XDECREF((PyObject *)__pyx_v_query_start);
  __Pyx_XDECREF((PyObject *)__pyx_v_mate_start);
  __Pyx_XDECREF((PyObject *)__pyx_v_cop);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":2029
 *                  '\t'.join(self.raw_optional_fields())))
 * 
 *     def has_optional_field(SAM_Alignment self, str tag):             # <<<<<<<<<<<<<<
 *         '''Check if this alignment has the specified optional field
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13has_optional_field(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_5HTSeq_6_HTSeq_13SAM_Alignment_12has_optional_field, "Check if this alignment has the specified optional field\n\n        Args:\n            tag: the field to look for.\n        Returns: a bool with True if the field has been found, False otherwise.\n        ");
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_13has_optional_field = {"has_optional_field", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13has_optional_field, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_13SAM_Alignment_12has_optional_field};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13has_optional_field(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tag = 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("has_optional_field (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_tag,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, 2029, __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, 2029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "has_optional_field", 0) < (0)) __PYX_ERR(0, 2029, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("has_optional_field", 1, 1, 1, i); __PYX_ERR(0, 2029, __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, 2029, __pyx_L3_error)
    }
    __pyx_v_tag = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("has_optional_field", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2029, __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("HTSeq._HTSeq.SAM_Alignment.has_optional_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tag), (&PyUnicode_Type), 1, "tag", 1))) __PYX_ERR(0, 2029, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12has_optional_field(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), __pyx_v_tag);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_12has_optional_field(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_tag) {
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("has_optional_field", 0);

  /* "HTSeq/_HTSeq.pyx":2036
 *         Returns: a bool with True if the field has been found, False otherwise.
 *         '''
 *         for p in self.optional_fields:             # <<<<<<<<<<<<<<
 *             if p[0] == tag:
 *                 return True
*/
  if (unlikely(__pyx_v_self->optional_fields == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 2036, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->optional_fields; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2036, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":2037
 *         '''
 *         for p in self.optional_fields:
 *             if p[0] == tag:             # <<<<<<<<<<<<<<
 *                 return True
 *         return False
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_v_tag, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2037, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "HTSeq/_HTSeq.pyx":2038
 *         for p in self.optional_fields:
 *             if p[0] == tag:
 *                 return True             # <<<<<<<<<<<<<<
 *         return False
 * 
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "HTSeq/_HTSeq.pyx":2037
 *         '''
 *         for p in self.optional_fields:
 *             if p[0] == tag:             # <<<<<<<<<<<<<<
 *                 return True
 *         return False
*/
    }

    /* "HTSeq/_HTSeq.pyx":2036
 *         Returns: a bool with True if the field has been found, False otherwise.
 *         '''
 *         for p in self.optional_fields:             # <<<<<<<<<<<<<<
 *             if p[0] == tag:
 *                 return True
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2039
 *             if p[0] == tag:
 *                 return True
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def optional_field(SAM_Alignment self, str tag):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":2029
 *                  '\t'.join(self.raw_optional_fields())))
 * 
 *     def has_optional_field(SAM_Alignment self, str tag):             # <<<<<<<<<<<<<<
 *         '''Check if this alignment has the specified optional field
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.has_optional_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":2041
 *         return False
 * 
 *     def optional_field(SAM_Alignment self, str tag):             # <<<<<<<<<<<<<<
 *         res = [p for p in self.optional_fields if p[0] == tag]
 *         if len(res) == 1:
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_field(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_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_field = {"optional_field", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_field, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_field(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tag = 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("optional_field (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_tag,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, 2041, __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, 2041, __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, "optional_field", 0) < (0)) __PYX_ERR(0, 2041, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("optional_field", 1, 1, 1, i); __PYX_ERR(0, 2041, __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, 2041, __pyx_L3_error)
    }
    __pyx_v_tag = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("optional_field", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2041, __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("HTSeq._HTSeq.SAM_Alignment.optional_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tag), (&PyUnicode_Type), 1, "tag", 1))) __PYX_ERR(0, 2041, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_14optional_field(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), __pyx_v_tag);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_14optional_field(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_tag) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("optional_field", 0);

  /* "HTSeq/_HTSeq.pyx":2042
 * 
 *     def optional_field(SAM_Alignment self, str tag):
 *         res = [p for p in self.optional_fields if p[0] == tag]             # <<<<<<<<<<<<<<
 *         if len(res) == 1:
 *             return res[0][1]
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2042, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->optional_fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 2042, __pyx_L5_error)
    }
    __pyx_t_2 = __pyx_v_self->optional_fields; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 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, 2042, __pyx_L5_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
      ++__pyx_t_3;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2042, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_p, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_8genexpr7__pyx_v_p, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2042, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_v_tag, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2042, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_5) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr7__pyx_v_p))) __PYX_ERR(0, 2042, __pyx_L5_error)
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_p); __pyx_8genexpr7__pyx_v_p = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_p); __pyx_8genexpr7__pyx_v_p = 0;
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2043
 *     def optional_field(SAM_Alignment self, str tag):
 *         res = [p for p in self.optional_fields if p[0] == tag]
 *         if len(res) == 1:             # <<<<<<<<<<<<<<
 *             return res[0][1]
 *         else:
*/
  __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_res); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2043, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_3 == 1);
  if (__pyx_t_5) {

    /* "HTSeq/_HTSeq.pyx":2044
 *         res = [p for p in self.optional_fields if p[0] == tag]
 *         if len(res) == 1:
 *             return res[0][1]             # <<<<<<<<<<<<<<
 *         else:
 *             if len(res) == 0:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_res, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "HTSeq/_HTSeq.pyx":2043
 *     def optional_field(SAM_Alignment self, str tag):
 *         res = [p for p in self.optional_fields if p[0] == tag]
 *         if len(res) == 1:             # <<<<<<<<<<<<<<
 *             return res[0][1]
 *         else:
*/
  }

  /* "HTSeq/_HTSeq.pyx":2046
 *             return res[0][1]
 *         else:
 *             if len(res) == 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError("SAM optional field tag %s not found" % tag)
 *             else:
*/
  /*else*/ {
    __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_res); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2046, __pyx_L1_error)
    __pyx_t_5 = (__pyx_t_3 == 0);
    if (unlikely(__pyx_t_5)) {

      /* "HTSeq/_HTSeq.pyx":2047
 *         else:
 *             if len(res) == 0:
 *                 raise KeyError("SAM optional field tag %s not found" % tag)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError("SAM optional field tag %s not unique" % tag)
*/
      __pyx_t_1 = NULL;
      __pyx_t_4 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_SAM_optional_field_tag_s_not_fou, __pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2047, __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, 2047, __pyx_L1_error)

      /* "HTSeq/_HTSeq.pyx":2046
 *             return res[0][1]
 *         else:
 *             if len(res) == 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError("SAM optional field tag %s not found" % tag)
 *             else:
*/
    }

    /* "HTSeq/_HTSeq.pyx":2049
 *                 raise KeyError("SAM optional field tag %s not found" % tag)
 *             else:
 *                 raise ValueError("SAM optional field tag %s not unique" % tag)             # <<<<<<<<<<<<<<
 * 
 *     def raw_optional_fields(self):
*/
    /*else*/ {
      __pyx_t_4 = NULL;
      __pyx_t_1 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_SAM_optional_field_tag_s_not_uni, __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2049, __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, 2049, __pyx_L1_error)
    }
  }

  /* "HTSeq/_HTSeq.pyx":2041
 *         return False
 * 
 *     def optional_field(SAM_Alignment self, str tag):             # <<<<<<<<<<<<<<
 *         res = [p for p in self.optional_fields if p[0] == tag]
 *         if len(res) == 1:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.optional_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":2051
 *                 raise ValueError("SAM optional field tag %s not unique" % tag)
 * 
 *     def raw_optional_fields(self):             # <<<<<<<<<<<<<<
 *         res = []
 *         for op in self.optional_fields:
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17raw_optional_fields(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_5HTSeq_6_HTSeq_13SAM_Alignment_17raw_optional_fields = {"raw_optional_fields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17raw_optional_fields, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17raw_optional_fields(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("raw_optional_fields (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("raw_optional_fields", 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("raw_optional_fields", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_16raw_optional_fields(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_16raw_optional_fields(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_op = NULL;
  PyObject *__pyx_v_tc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("raw_optional_fields", 0);

  /* "HTSeq/_HTSeq.pyx":2052
 * 
 *     def raw_optional_fields(self):
 *         res = []             # <<<<<<<<<<<<<<
 *         for op in self.optional_fields:
 *             if op[1].__class__ == str:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2053
 *     def raw_optional_fields(self):
 *         res = []
 *         for op in self.optional_fields:             # <<<<<<<<<<<<<<
 *             if op[1].__class__ == str:
 *                 if len(op[1]) == 1:
*/
  if (unlikely(__pyx_v_self->optional_fields == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 2053, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->optional_fields; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2053, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_op, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "HTSeq/_HTSeq.pyx":2054
 *         res = []
 *         for op in self.optional_fields:
 *             if op[1].__class__ == str:             # <<<<<<<<<<<<<<
 *                 if len(op[1]) == 1:
 *                     tc = "A"
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2054, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2054, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":2055
 *         for op in self.optional_fields:
 *             if op[1].__class__ == str:
 *                 if len(op[1]) == 1:             # <<<<<<<<<<<<<<
 *                     tc = "A"
 *                 else:
*/
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2055, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2055, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = (__pyx_t_6 == 1);
      if (__pyx_t_5) {

        /* "HTSeq/_HTSeq.pyx":2056
 *             if op[1].__class__ == str:
 *                 if len(op[1]) == 1:
 *                     tc = "A"             # <<<<<<<<<<<<<<
 *                 else:
 *                     tc = "Z"
*/
        __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_A);
        __Pyx_XDECREF_SET(__pyx_v_tc, __pyx_mstate_global->__pyx_n_u_A);

        /* "HTSeq/_HTSeq.pyx":2055
 *         for op in self.optional_fields:
 *             if op[1].__class__ == str:
 *                 if len(op[1]) == 1:             # <<<<<<<<<<<<<<
 *                     tc = "A"
 *                 else:
*/
        goto __pyx_L6;
      }

      /* "HTSeq/_HTSeq.pyx":2058
 *                     tc = "A"
 *                 else:
 *                     tc = "Z"             # <<<<<<<<<<<<<<
 *             elif op[1].__class__ == int:
 *                 tc = "i"
*/
      /*else*/ {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Z);
        __Pyx_XDECREF_SET(__pyx_v_tc, __pyx_mstate_global->__pyx_n_u_Z);
      }
      __pyx_L6:;

      /* "HTSeq/_HTSeq.pyx":2054
 *         res = []
 *         for op in self.optional_fields:
 *             if op[1].__class__ == str:             # <<<<<<<<<<<<<<
 *                 if len(op[1]) == 1:
 *                     tc = "A"
*/
      goto __pyx_L5;
    }

    /* "HTSeq/_HTSeq.pyx":2059
 *                 else:
 *                     tc = "Z"
 *             elif op[1].__class__ == int:             # <<<<<<<<<<<<<<
 *                 tc = "i"
 *             elif op[1].__class__ == float:
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2059, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2059, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2059, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2059, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":2060
 *                     tc = "Z"
 *             elif op[1].__class__ == int:
 *                 tc = "i"             # <<<<<<<<<<<<<<
 *             elif op[1].__class__ == float:
 *                 tc = "f"
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_i);
      __Pyx_XDECREF_SET(__pyx_v_tc, __pyx_mstate_global->__pyx_n_u_i);

      /* "HTSeq/_HTSeq.pyx":2059
 *                 else:
 *                     tc = "Z"
 *             elif op[1].__class__ == int:             # <<<<<<<<<<<<<<
 *                 tc = "i"
 *             elif op[1].__class__ == float:
*/
      goto __pyx_L5;
    }

    /* "HTSeq/_HTSeq.pyx":2061
 *             elif op[1].__class__ == int:
 *                 tc = "i"
 *             elif op[1].__class__ == float:             # <<<<<<<<<<<<<<
 *                 tc = "f"
 *             else:
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":2062
 *                 tc = "i"
 *             elif op[1].__class__ == float:
 *                 tc = "f"             # <<<<<<<<<<<<<<
 *             else:
 *                 tc = "H"
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_f);
      __Pyx_XDECREF_SET(__pyx_v_tc, __pyx_mstate_global->__pyx_n_u_f);

      /* "HTSeq/_HTSeq.pyx":2061
 *             elif op[1].__class__ == int:
 *                 tc = "i"
 *             elif op[1].__class__ == float:             # <<<<<<<<<<<<<<
 *                 tc = "f"
 *             else:
*/
      goto __pyx_L5;
    }

    /* "HTSeq/_HTSeq.pyx":2064
 *                 tc = "f"
 *             else:
 *                 tc = "H"             # <<<<<<<<<<<<<<
 *             res.append(":".join([op[0], tc, str(op[1])]))
 *         return res
*/
    /*else*/ {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_H);
      __Pyx_XDECREF_SET(__pyx_v_tc, __pyx_mstate_global->__pyx_n_u_H);
    }
    __pyx_L5:;

    /* "HTSeq/_HTSeq.pyx":2065
 *             else:
 *                 tc = "H"
 *             res.append(":".join([op[0], tc, str(op[1])]))             # <<<<<<<<<<<<<<
 *         return res
 * 
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 2065, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_tc);
    __Pyx_GIVEREF(__pyx_v_tc);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_tc) != (0)) __PYX_ERR(0, 2065, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 2065, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__10, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 2065, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "HTSeq/_HTSeq.pyx":2053
 *     def raw_optional_fields(self):
 *         res = []
 *         for op in self.optional_fields:             # <<<<<<<<<<<<<<
 *             if op[1].__class__ == str:
 *                 if len(op[1]) == 1:
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2066
 *                 tc = "H"
 *             res.append(":".join([op[0], tc, str(op[1])]))
 *         return res             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":2051
 *                 raise ValueError("SAM optional field tag %s not unique" % tag)
 * 
 *     def raw_optional_fields(self):             # <<<<<<<<<<<<<<
 *         res = []
 *         for op in self.optional_fields:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.raw_optional_fields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_op);
  __Pyx_XDECREF(__pyx_v_tc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":51
 * 
 * cdef class SAM_Alignment(AlignmentWithSequenceReversal):
 *    cdef public list cigar             # <<<<<<<<<<<<<<
 *    cdef public int aQual
 *    cdef public GenomicPosition mate_start
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->cigar);
  __pyx_r = __pyx_v_self->cigar;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(2, 51, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->cigar);
  __Pyx_DECREF(__pyx_v_self->cigar);
  __pyx_v_self->cigar = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.cigar.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->cigar);
  __Pyx_DECREF(__pyx_v_self->cigar);
  __pyx_v_self->cigar = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pxd":52
 * cdef class SAM_Alignment(AlignmentWithSequenceReversal):
 *    cdef public list cigar
 *    cdef public int aQual             # <<<<<<<<<<<<<<
 *    cdef public GenomicPosition mate_start
 *    cdef public str pe_which
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.aQual.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 52, __pyx_L1_error)
  __pyx_v_self->aQual = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.aQual.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":53
 *    cdef public list cigar
 *    cdef public int aQual
 *    cdef public GenomicPosition mate_start             # <<<<<<<<<<<<<<
 *    cdef public str pe_which
 *    cdef public int inferred_insert_size
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->mate_start);
  __pyx_r = ((PyObject *)__pyx_v_self->mate_start);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition))))) __PYX_ERR(2, 53, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->mate_start);
  __Pyx_DECREF((PyObject *)__pyx_v_self->mate_start);
  __pyx_v_self->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.mate_start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->mate_start);
  __Pyx_DECREF((PyObject *)__pyx_v_self->mate_start);
  __pyx_v_self->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None);

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

/* "HTSeq/_HTSeq.pxd":54
 *    cdef public int aQual
 *    cdef public GenomicPosition mate_start
 *    cdef public str pe_which             # <<<<<<<<<<<<<<
 *    cdef public int inferred_insert_size
 *    cdef public bint proper_pair
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->pe_which);
  __pyx_r = __pyx_v_self->pe_which;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(2, 54, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->pe_which);
  __Pyx_DECREF(__pyx_v_self->pe_which);
  __pyx_v_self->pe_which = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.pe_which.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->pe_which);
  __Pyx_DECREF(__pyx_v_self->pe_which);
  __pyx_v_self->pe_which = ((PyObject*)Py_None);

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

/* "HTSeq/_HTSeq.pxd":55
 *    cdef public GenomicPosition mate_start
 *    cdef public str pe_which
 *    cdef public int inferred_insert_size             # <<<<<<<<<<<<<<
 *    cdef public bint proper_pair
 *    cdef public bint not_primary_alignment
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.inferred_insert_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 55, __pyx_L1_error)
  __pyx_v_self->inferred_insert_size = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.inferred_insert_size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":56
 *    cdef public str pe_which
 *    cdef public int inferred_insert_size
 *    cdef public bint proper_pair             # <<<<<<<<<<<<<<
 *    cdef public bint not_primary_alignment
 *    cdef public bint failed_platform_qc
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->proper_pair); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.proper_pair.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 56, __pyx_L1_error)
  __pyx_v_self->proper_pair = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.proper_pair.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":57
 *    cdef public int inferred_insert_size
 *    cdef public bint proper_pair
 *    cdef public bint not_primary_alignment             # <<<<<<<<<<<<<<
 *    cdef public bint failed_platform_qc
 *    cdef public bint pcr_or_optical_duplicate
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->not_primary_alignment); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.not_primary_alignment.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 57, __pyx_L1_error)
  __pyx_v_self->not_primary_alignment = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.not_primary_alignment.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":58
 *    cdef public bint proper_pair
 *    cdef public bint not_primary_alignment
 *    cdef public bint failed_platform_qc             # <<<<<<<<<<<<<<
 *    cdef public bint pcr_or_optical_duplicate
 *    cdef public bint supplementary
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->failed_platform_qc); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.failed_platform_qc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 58, __pyx_L1_error)
  __pyx_v_self->failed_platform_qc = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.failed_platform_qc.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":59
 *    cdef public bint not_primary_alignment
 *    cdef public bint failed_platform_qc
 *    cdef public bint pcr_or_optical_duplicate             # <<<<<<<<<<<<<<
 *    cdef public bint supplementary
 *    cdef readonly str original_sam_line
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->pcr_or_optical_duplicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.pcr_or_optical_duplicate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 59, __pyx_L1_error)
  __pyx_v_self->pcr_or_optical_duplicate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.pcr_or_optical_duplicate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":60
 *    cdef public bint failed_platform_qc
 *    cdef public bint pcr_or_optical_duplicate
 *    cdef public bint supplementary             # <<<<<<<<<<<<<<
 *    cdef readonly str original_sam_line
 *    cdef int _flag
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->supplementary); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.supplementary.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 60, __pyx_L1_error)
  __pyx_v_self->supplementary = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.supplementary.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pxd":61
 *    cdef public bint pcr_or_optical_duplicate
 *    cdef public bint supplementary
 *    cdef readonly str original_sam_line             # <<<<<<<<<<<<<<
 *    cdef int _flag
 *    cdef public list optional_fields
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->original_sam_line);
  __pyx_r = __pyx_v_self->original_sam_line;
  goto __pyx_L0;

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

/* "HTSeq/_HTSeq.pxd":63
 *    cdef readonly str original_sam_line
 *    cdef int _flag
 *    cdef public list optional_fields             # <<<<<<<<<<<<<<
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields___get__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields___get__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->optional_fields);
  __pyx_r = __pyx_v_self->optional_fields;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_2__set__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_2__set__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(2, 63, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->optional_fields);
  __Pyx_DECREF(__pyx_v_self->optional_fields);
  __pyx_v_self->optional_fields = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.optional_fields.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_4__del__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v_self));

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

static int __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_4__del__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->optional_fields);
  __Pyx_DECREF(__pyx_v_self->optional_fields);
  __pyx_v_self->optional_fields = ((PyObject*)Py_None);

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

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

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_18__reduce_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._flag, self._read, self._read_as_sequenced, self.aQual, self.cigar, self.failed_platform_qc, self.inferred_insert_size, self.iv, self.mate_start, self.not_primary_alignment, self.optional_fields, self.original_sam_line, self.pcr_or_optical_duplicate, self.pe_which, self.proper_pair, self.read_as_aligned, self.supplementary)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->aQual); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->failed_platform_qc); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_self->inferred_insert_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->not_primary_alignment); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->pcr_or_optical_duplicate); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->proper_pair); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_self->supplementary); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(17); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_2) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->cigar);
  __Pyx_GIVEREF(__pyx_v_self->cigar);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_self->cigar) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_3) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_4) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 7, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->mate_start);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->mate_start);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 8, ((PyObject *)__pyx_v_self->mate_start)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 9, __pyx_t_5) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->optional_fields);
  __Pyx_GIVEREF(__pyx_v_self->optional_fields);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 10, __pyx_v_self->optional_fields) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->original_sam_line);
  __Pyx_GIVEREF(__pyx_v_self->original_sam_line);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 11, __pyx_v_self->original_sam_line) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 12, __pyx_t_6) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->pe_which);
  __Pyx_GIVEREF(__pyx_v_self->pe_which);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 13, __pyx_v_self->pe_which) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 14, __pyx_t_7) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 15, ((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned)) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 16, __pyx_t_8) != (0)) __PYX_ERR(3, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._flag, self._read, self._read_as_sequenced, self.aQual, self.cigar, self.failed_platform_qc, self.inferred_insert_size, self.iv, self.mate_start, self.not_primary_alignment, self.optional_fields, self.original_sam_line, self.pcr_or_optical_duplicate, self.pe_which, self.proper_pair, self.read_as_aligned, self.supplementary)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_9 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_v__dict = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "(tree fragment)":7
 *     state = (self._flag, self._read, self._read_as_sequenced, self.aQual, self.cigar, self.failed_platform_qc, self.inferred_insert_size, self.iv, self.mate_start, self.not_primary_alignment, self.optional_fields, self.original_sam_line, self.pcr_or_optical_duplicate, self.pe_which, self.proper_pair, self.read_as_aligned, self.supplementary)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_11 = (__pyx_v__dict != Py_None);
  if (__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(3, 7, __pyx_L1_error)
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_10) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v__dict) != (0)) __PYX_ERR(3, 8, __pyx_L1_error);
    __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.cigar is not None or self.iv is not None or self.mate_start is not None or self.optional_fields is not None or self.original_sam_line is not None or self.pe_which is not None or self.read_as_aligned is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._flag, self._read, self._read_as_sequenced, self.aQual, self.cigar, self.failed_platform_qc, self.inferred_insert_size, self.iv, self.mate_start, self.not_primary_alignment, self.optional_fields, self.original_sam_line, self.pcr_or_optical_duplicate, self.pe_which, self.proper_pair, self.read_as_aligned, self.supplementary)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.cigar is not None or self.iv is not None or self.mate_start is not None or self.optional_fields is not None or self.original_sam_line is not None or self.pe_which is not None or self.read_as_aligned is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, None), state
*/
  /*else*/ {
    __pyx_t_11 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._read) != Py_None);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_10 = __pyx_t_11;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_11 = (((PyObject *)__pyx_v_self->__pyx_base._read_as_sequenced) != Py_None);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_10 = __pyx_t_11;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_self->cigar != ((PyObject*)Py_None));
    if (!__pyx_t_11) {
    } else {
      __pyx_t_10 = __pyx_t_11;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_11 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.iv) != Py_None);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_10 = __pyx_t_11;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_11 = (((PyObject *)__pyx_v_self->mate_start) != Py_None);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_10 = __pyx_t_11;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_self->optional_fields != ((PyObject*)Py_None));
    if (!__pyx_t_11) {
    } else {
      __pyx_t_10 = __pyx_t_11;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_self->original_sam_line != ((PyObject*)Py_None));
    if (!__pyx_t_11) {
    } else {
      __pyx_t_10 = __pyx_t_11;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_11 = (__pyx_v_self->pe_which != ((PyObject*)Py_None));
    if (!__pyx_t_11) {
    } else {
      __pyx_t_10 = __pyx_t_11;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_11 = (((PyObject *)__pyx_v_self->__pyx_base.read_as_aligned) != Py_None);
    __pyx_t_10 = __pyx_t_11;
    __pyx_L6_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_10;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.cigar is not None or self.iv is not None or self.mate_start is not None or self.optional_fields is not None or self.original_sam_line is not None or self.pe_which is not None or self.read_as_aligned is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.cigar is not None or self.iv is not None or self.mate_start is not None or self.optional_fields is not None or self.original_sam_line is not None or self.pe_which is not None or self.read_as_aligned is not None
 *     if use_setstate:
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_SAM_Alignment); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_9874465);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_9874465);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_mstate_global->__pyx_int_9874465) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state) != (0)) __PYX_ERR(3, 13, __pyx_L1_error);
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._read is not None or self._read_as_sequenced is not None or self.cigar is not None or self.iv is not None or self.mate_start is not None or self.optional_fields is not None or self.original_sam_line is not None or self.pe_which is not None or self.read_as_aligned is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, None), state
 *     else:
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SAM_Alignment__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_SAM_Alignment); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_9874465);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_9874465);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_mstate_global->__pyx_int_9874465) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(3, 15, __pyx_L1_error);
    __pyx_t_7 = 0;
    __pyx_t_9 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SAM_Alignment__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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(3, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(3, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(3, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_13SAM_Alignment_20__setstate_cython__(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__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_5HTSeq_6_HTSeq_13SAM_Alignment_20__setstate_cython__(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SAM_Alignment__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(3, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(3, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_SAM_Alignment__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SAM_Alignment__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("HTSeq._HTSeq.SAM_Alignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "HTSeq/_HTSeq.pyx":2072
 * # Helpers
 * ###########################
 * cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'):             # <<<<<<<<<<<<<<
 *     cdef list l = []
 *     cdef int i = 0
*/

static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15quotesafe_split(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 PyObject *__pyx_f_5HTSeq_6_HTSeq_quotesafe_split(PyObject *__pyx_v_s, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_quotesafe_split *__pyx_optional_args) {
  PyObject *__pyx_v_split = ((PyObject*)__pyx_mstate_global->__pyx_kp_b__32);
  PyObject *__pyx_v_quote = ((PyObject*)__pyx_mstate_global->__pyx_kp_b__33);
  PyObject *__pyx_v_l = 0;
  int __pyx_v_i;
  int __pyx_v_begin_token;
  int __pyx_v_in_quote;
  char *__pyx_v_s_c;
  char __pyx_v_split_c;
  char __pyx_v_quote_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char *__pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("quotesafe_split", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_split = __pyx_optional_args->split;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_quote = __pyx_optional_args->quote;
      }
    }
  }

  /* "HTSeq/_HTSeq.pyx":2073
 * ###########################
 * cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'):
 *     cdef list l = []             # <<<<<<<<<<<<<<
 *     cdef int i = 0
 *     cdef int begin_token = 0
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2074
 * cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'):
 *     cdef list l = []
 *     cdef int i = 0             # <<<<<<<<<<<<<<
 *     cdef int begin_token = 0
 *     cdef bint in_quote = False
*/
  __pyx_v_i = 0;

  /* "HTSeq/_HTSeq.pyx":2075
 *     cdef list l = []
 *     cdef int i = 0
 *     cdef int begin_token = 0             # <<<<<<<<<<<<<<
 *     cdef bint in_quote = False
 *     cdef char * s_c = s
*/
  __pyx_v_begin_token = 0;

  /* "HTSeq/_HTSeq.pyx":2076
 *     cdef int i = 0
 *     cdef int begin_token = 0
 *     cdef bint in_quote = False             # <<<<<<<<<<<<<<
 *     cdef char * s_c = s
 *     cdef char split_c = split[0]
*/
  __pyx_v_in_quote = 0;

  /* "HTSeq/_HTSeq.pyx":2077
 *     cdef int begin_token = 0
 *     cdef bint in_quote = False
 *     cdef char * s_c = s             # <<<<<<<<<<<<<<
 *     cdef char split_c = split[0]
 *     cdef char quote_c = quote[0]
*/
  if (unlikely(__pyx_v_s == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(0, 2077, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_s); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L1_error)
  __pyx_v_s_c = __pyx_t_2;

  /* "HTSeq/_HTSeq.pyx":2078
 *     cdef bint in_quote = False
 *     cdef char * s_c = s
 *     cdef char split_c = split[0]             # <<<<<<<<<<<<<<
 *     cdef char quote_c = quote[0]
 *     if len(split) != 1:
*/
  __pyx_t_3 = __Pyx_GetItemInt_Bytes(__pyx_v_split, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2078, __pyx_L1_error)
  __pyx_v_split_c = __pyx_t_3;

  /* "HTSeq/_HTSeq.pyx":2079
 *     cdef char * s_c = s
 *     cdef char split_c = split[0]
 *     cdef char quote_c = quote[0]             # <<<<<<<<<<<<<<
 *     if len(split) != 1:
 *         raise ValueError("'split' must be length 1")
*/
  __pyx_t_3 = __Pyx_GetItemInt_Bytes(__pyx_v_quote, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2079, __pyx_L1_error)
  __pyx_v_quote_c = __pyx_t_3;

  /* "HTSeq/_HTSeq.pyx":2080
 *     cdef char split_c = split[0]
 *     cdef char quote_c = quote[0]
 *     if len(split) != 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("'split' must be length 1")
 *     if len(quote) != 1:
*/
  if (unlikely(__pyx_v_split == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 2080, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyBytes_GET_SIZE(__pyx_v_split); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2080, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 1);
  if (unlikely(__pyx_t_5)) {

    /* "HTSeq/_HTSeq.pyx":2081
 *     cdef char quote_c = quote[0]
 *     if len(split) != 1:
 *         raise ValueError("'split' must be length 1")             # <<<<<<<<<<<<<<
 *     if len(quote) != 1:
 *         raise ValueError("'quote' must be length 1")
*/
    __pyx_t_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_split_must_be_length_1};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2081, __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, 2081, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":2080
 *     cdef char split_c = split[0]
 *     cdef char quote_c = quote[0]
 *     if len(split) != 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("'split' must be length 1")
 *     if len(quote) != 1:
*/
  }

  /* "HTSeq/_HTSeq.pyx":2082
 *     if len(split) != 1:
 *         raise ValueError("'split' must be length 1")
 *     if len(quote) != 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("'quote' must be length 1")
 *     while s_c[i] != 0:
*/
  if (unlikely(__pyx_v_quote == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 2082, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyBytes_GET_SIZE(__pyx_v_quote); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2082, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 1);
  if (unlikely(__pyx_t_5)) {

    /* "HTSeq/_HTSeq.pyx":2083
 *         raise ValueError("'split' must be length 1")
 *     if len(quote) != 1:
 *         raise ValueError("'quote' must be length 1")             # <<<<<<<<<<<<<<
 *     while s_c[i] != 0:
 *         if s_c[i] == quote_c:
*/
    __pyx_t_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_quote_must_be_length_1};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2083, __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, 2083, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":2082
 *     if len(split) != 1:
 *         raise ValueError("'split' must be length 1")
 *     if len(quote) != 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("'quote' must be length 1")
 *     while s_c[i] != 0:
*/
  }

  /* "HTSeq/_HTSeq.pyx":2084
 *     if len(quote) != 1:
 *         raise ValueError("'quote' must be length 1")
 *     while s_c[i] != 0:             # <<<<<<<<<<<<<<
 *         if s_c[i] == quote_c:
 *             in_quote = not in_quote
*/
  while (1) {
    __pyx_t_5 = ((__pyx_v_s_c[__pyx_v_i]) != 0);
    if (!__pyx_t_5) break;

    /* "HTSeq/_HTSeq.pyx":2085
 *         raise ValueError("'quote' must be length 1")
 *     while s_c[i] != 0:
 *         if s_c[i] == quote_c:             # <<<<<<<<<<<<<<
 *             in_quote = not in_quote
 *         elif (not in_quote) and s_c[i] == split_c:
*/
    __pyx_t_5 = ((__pyx_v_s_c[__pyx_v_i]) == __pyx_v_quote_c);
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":2086
 *     while s_c[i] != 0:
 *         if s_c[i] == quote_c:
 *             in_quote = not in_quote             # <<<<<<<<<<<<<<
 *         elif (not in_quote) and s_c[i] == split_c:
 *             l.append(s[begin_token: i])
*/
      __pyx_v_in_quote = (!__pyx_v_in_quote);

      /* "HTSeq/_HTSeq.pyx":2085
 *         raise ValueError("'quote' must be length 1")
 *     while s_c[i] != 0:
 *         if s_c[i] == quote_c:             # <<<<<<<<<<<<<<
 *             in_quote = not in_quote
 *         elif (not in_quote) and s_c[i] == split_c:
*/
      goto __pyx_L7;
    }

    /* "HTSeq/_HTSeq.pyx":2087
 *         if s_c[i] == quote_c:
 *             in_quote = not in_quote
 *         elif (not in_quote) and s_c[i] == split_c:             # <<<<<<<<<<<<<<
 *             l.append(s[begin_token: i])
 *             begin_token = i + 1
*/
    __pyx_t_8 = (!__pyx_v_in_quote);
    if (__pyx_t_8) {
    } else {
      __pyx_t_5 = __pyx_t_8;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_8 = ((__pyx_v_s_c[__pyx_v_i]) == __pyx_v_split_c);
    __pyx_t_5 = __pyx_t_8;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_5) {

      /* "HTSeq/_HTSeq.pyx":2088
 *             in_quote = not in_quote
 *         elif (not in_quote) and s_c[i] == split_c:
 *             l.append(s[begin_token: i])             # <<<<<<<<<<<<<<
 *             begin_token = i + 1
 *         i += 1
*/
      if (unlikely(__pyx_v_s == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 2088, __pyx_L1_error)
      }
      __pyx_t_1 = PySequence_GetSlice(__pyx_v_s, __pyx_v_begin_token, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2088, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_l, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2088, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "HTSeq/_HTSeq.pyx":2089
 *         elif (not in_quote) and s_c[i] == split_c:
 *             l.append(s[begin_token: i])
 *             begin_token = i + 1             # <<<<<<<<<<<<<<
 *         i += 1
 *     l.append(s[begin_token:])
*/
      __pyx_v_begin_token = (__pyx_v_i + 1);

      /* "HTSeq/_HTSeq.pyx":2087
 *         if s_c[i] == quote_c:
 *             in_quote = not in_quote
 *         elif (not in_quote) and s_c[i] == split_c:             # <<<<<<<<<<<<<<
 *             l.append(s[begin_token: i])
 *             begin_token = i + 1
*/
    }
    __pyx_L7:;

    /* "HTSeq/_HTSeq.pyx":2090
 *             l.append(s[begin_token: i])
 *             begin_token = i + 1
 *         i += 1             # <<<<<<<<<<<<<<
 *     l.append(s[begin_token:])
 *     if in_quote:
*/
    __pyx_v_i = (__pyx_v_i + 1);
  }

  /* "HTSeq/_HTSeq.pyx":2091
 *             begin_token = i + 1
 *         i += 1
 *     l.append(s[begin_token:])             # <<<<<<<<<<<<<<
 *     if in_quote:
 *         raise ValueError("unmatched quote")
*/
  if (unlikely(__pyx_v_s == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 2091, __pyx_L1_error)
  }
  __pyx_t_1 = PySequence_GetSlice(__pyx_v_s, __pyx_v_begin_token, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_l, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2091, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "HTSeq/_HTSeq.pyx":2092
 *         i += 1
 *     l.append(s[begin_token:])
 *     if in_quote:             # <<<<<<<<<<<<<<
 *         raise ValueError("unmatched quote")
 *     return l
*/
  if (unlikely(__pyx_v_in_quote)) {

    /* "HTSeq/_HTSeq.pyx":2093
 *     l.append(s[begin_token:])
 *     if in_quote:
 *         raise ValueError("unmatched quote")             # <<<<<<<<<<<<<<
 *     return l
*/
    __pyx_t_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_unmatched_quote};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2093, __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, 2093, __pyx_L1_error)

    /* "HTSeq/_HTSeq.pyx":2092
 *         i += 1
 *     l.append(s[begin_token:])
 *     if in_quote:             # <<<<<<<<<<<<<<
 *         raise ValueError("unmatched quote")
 *     return l
*/
  }

  /* "HTSeq/_HTSeq.pyx":2094
 *     if in_quote:
 *         raise ValueError("unmatched quote")
 *     return l             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "HTSeq/_HTSeq.pyx":2072
 * # Helpers
 * ###########################
 * cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'):             # <<<<<<<<<<<<<<
 *     cdef list l = []
 *     cdef int i = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("HTSeq._HTSeq.quotesafe_split", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15quotesafe_split(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_5HTSeq_6_HTSeq_15quotesafe_split = {"quotesafe_split", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15quotesafe_split, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_15quotesafe_split(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_s = 0;
  PyObject *__pyx_v_split = 0;
  PyObject *__pyx_v_quote = 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("quotesafe_split (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_s_3,&__pyx_mstate_global->__pyx_n_u_split,&__pyx_mstate_global->__pyx_n_u_quote,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, 2072, __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, 2072, __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, 2072, __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, 2072, __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, "quotesafe_split", 0) < (0)) __PYX_ERR(0, 2072, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__32));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__33));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("quotesafe_split", 0, 1, 3, i); __PYX_ERR(0, 2072, __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, 2072, __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, 2072, __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, 2072, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__32));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_b__33));
    }
    __pyx_v_s = ((PyObject*)values[0]);
    __pyx_v_split = ((PyObject*)values[1]);
    __pyx_v_quote = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("quotesafe_split", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 2072, __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("HTSeq._HTSeq.quotesafe_split", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyBytes_Type), 1, "s", 1))) __PYX_ERR(0, 2072, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split), (&PyBytes_Type), 1, "split", 1))) __PYX_ERR(0, 2072, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quote), (&PyBytes_Type), 1, "quote", 1))) __PYX_ERR(0, 2072, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_14quotesafe_split(__pyx_self, __pyx_v_s, __pyx_v_split, __pyx_v_quote);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_14quotesafe_split(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s, PyObject *__pyx_v_split, PyObject *__pyx_v_quote) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5HTSeq_6_HTSeq_quotesafe_split __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("quotesafe_split", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.split = __pyx_v_split;
  __pyx_t_2.quote = __pyx_v_quote;
  __pyx_t_1 = __pyx_f_5HTSeq_6_HTSeq_quotesafe_split(__pyx_v_s, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.quotesafe_split", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CigarOperation(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xf82f777, 0x9723161, 0xb5bd29c, b'query_from, query_to, ref_iv, size, type')
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_17__pyx_unpickle_CigarOperation(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_5HTSeq_6_HTSeq_17__pyx_unpickle_CigarOperation = {"__pyx_unpickle_CigarOperation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_17__pyx_unpickle_CigarOperation, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_17__pyx_unpickle_CigarOperation(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_CigarOperation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_CigarOperation", 0) < (0)) __PYX_ERR(3, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CigarOperation", 1, 3, 3, i); __PYX_ERR(3, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(3, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CigarOperation", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_CigarOperation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(3, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_16__pyx_unpickle_CigarOperation(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_16__pyx_unpickle_CigarOperation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CigarOperation", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_CigarOperation(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xf82f777, 0x9723161, 0xb5bd29c, b'query_from, query_to, ref_iv, size, type')             # <<<<<<<<<<<<<<
 *     __pyx_result = CigarOperation.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xf82f777, 0x9723161, 0xb5bd29c, __pyx_k_query_from_query_to_ref_iv_size); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xf82f777, 0x9723161, 0xb5bd29c, b'query_from, query_to, ref_iv, size, type')
 *     __pyx_result = CigarOperation.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CigarOperation__set_state(<CigarOperation> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xf82f777, 0x9723161, 0xb5bd29c, b'query_from, query_to, ref_iv, size, type')
 *     __pyx_result = CigarOperation.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CigarOperation__set_state(<CigarOperation> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = CigarOperation.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CigarOperation__set_state(<CigarOperation> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(3, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_CigarOperation__set_state(((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xf82f777, 0x9723161, 0xb5bd29c, b'query_from, query_to, ref_iv, size, type')
 *     __pyx_result = CigarOperation.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CigarOperation__set_state(<CigarOperation> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CigarOperation__set_state(<CigarOperation> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, __pyx_state: tuple):
 *     __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CigarOperation(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xf82f777, 0x9723161, 0xb5bd29c, b'query_from, query_to, ref_iv, size, type')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_CigarOperation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_CigarOperation__set_state(<CigarOperation> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 5)
*/

static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_CigarOperation__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CigarOperation__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, __pyx_state: tuple):
 *     __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 5)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->query_from = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->query_to = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->ref_iv);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->ref_iv);
  __pyx_v___pyx_result->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->size = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->type);
  __Pyx_DECREF(__pyx_v___pyx_result->type);
  __pyx_v___pyx_result->type = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, __pyx_state: tuple):
 *     __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 5)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 5); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_CigarOperation__set_state(<CigarOperation> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CigarOperation__set_state(CigarOperation __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.query_from = __pyx_state[0]; __pyx_result.query_to = __pyx_state[1]; __pyx_result.ref_iv = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.type = __pyx_state[4]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 5)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0162061, 0x4a200c5, 0x77bfdf2, b'_read, iv')
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_19__pyx_unpickle_Alignment(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_5HTSeq_6_HTSeq_19__pyx_unpickle_Alignment = {"__pyx_unpickle_Alignment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_19__pyx_unpickle_Alignment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_19__pyx_unpickle_Alignment(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Alignment (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_Alignment", 0) < (0)) __PYX_ERR(3, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Alignment", 1, 3, 3, i); __PYX_ERR(3, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(3, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Alignment", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(3, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_18__pyx_unpickle_Alignment(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_18__pyx_unpickle_Alignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Alignment", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0162061, 0x4a200c5, 0x77bfdf2, b'_read, iv')             # <<<<<<<<<<<<<<
 *     __pyx_result = Alignment.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x0162061, 0x4a200c5, 0x77bfdf2, __pyx_k_read_iv); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0162061, 0x4a200c5, 0x77bfdf2, b'_read, iv')
 *     __pyx_result = Alignment.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Alignment__set_state(<Alignment> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Alignment);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0162061, 0x4a200c5, 0x77bfdf2, b'_read, iv')
 *     __pyx_result = Alignment.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Alignment__set_state(<Alignment> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = Alignment.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Alignment__set_state(<Alignment> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(3, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_Alignment__set_state(((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0162061, 0x4a200c5, 0x77bfdf2, b'_read, iv')
 *     __pyx_result = Alignment.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Alignment__set_state(<Alignment> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Alignment__set_state(<Alignment> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, __pyx_state: tuple):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Alignment(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0162061, 0x4a200c5, 0x77bfdf2, b'_read, iv')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Alignment__set_state(<Alignment> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)
*/

static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_Alignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Alignment__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, __pyx_state: tuple):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->_read);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->_read);
  __pyx_v___pyx_result->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->iv);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->iv);
  __pyx_v___pyx_result->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, __pyx_state: tuple):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_Alignment__set_state(<Alignment> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Alignment__set_state(Alignment __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._read = __pyx_state[0]; __pyx_result.iv = __pyx_state[1]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_AlignmentWithSequenceReversal(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xeadbf25, 0xe297712, 0x1b7eeff, b'_read, _read_as_sequenced, iv, read_as_aligned')
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21__pyx_unpickle_AlignmentWithSequenceReversal(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_5HTSeq_6_HTSeq_21__pyx_unpickle_AlignmentWithSequenceReversal = {"__pyx_unpickle_AlignmentWithSequenceReversal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21__pyx_unpickle_AlignmentWithSequenceReversal, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_21__pyx_unpickle_AlignmentWithSequenceReversal(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_AlignmentWithSequenceReversal (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_AlignmentWithSequenceReversal", 0) < (0)) __PYX_ERR(3, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AlignmentWithSequenceReversal", 1, 3, 3, i); __PYX_ERR(3, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(3, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AlignmentWithSequenceReversal", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_AlignmentWithSequenceReversal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(3, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_20__pyx_unpickle_AlignmentWithSequenceReversal(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_20__pyx_unpickle_AlignmentWithSequenceReversal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_AlignmentWithSequenceReversal", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_AlignmentWithSequenceReversal(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xeadbf25, 0xe297712, 0x1b7eeff, b'_read, _read_as_sequenced, iv, read_as_aligned')             # <<<<<<<<<<<<<<
 *     __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xeadbf25, 0xe297712, 0x1b7eeff, __pyx_k_read__read_as_sequenced_iv_read); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xeadbf25, 0xe297712, 0x1b7eeff, b'_read, _read_as_sequenced, iv, read_as_aligned')
 *     __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_AlignmentWithSequenceReversal__set_state(<AlignmentWithSequenceReversal> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xeadbf25, 0xe297712, 0x1b7eeff, b'_read, _read_as_sequenced, iv, read_as_aligned')
 *     __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_AlignmentWithSequenceReversal__set_state(<AlignmentWithSequenceReversal> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_AlignmentWithSequenceReversal__set_state(<AlignmentWithSequenceReversal> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(3, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_AlignmentWithSequenceReversal__set_state(((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xeadbf25, 0xe297712, 0x1b7eeff, b'_read, _read_as_sequenced, iv, read_as_aligned')
 *     __pyx_result = AlignmentWithSequenceReversal.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_AlignmentWithSequenceReversal__set_state(<AlignmentWithSequenceReversal> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_AlignmentWithSequenceReversal__set_state(<AlignmentWithSequenceReversal> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, __pyx_state: tuple):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_AlignmentWithSequenceReversal(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xeadbf25, 0xe297712, 0x1b7eeff, b'_read, _read_as_sequenced, iv, read_as_aligned')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_AlignmentWithSequenceReversal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_AlignmentWithSequenceReversal__set_state(<AlignmentWithSequenceReversal> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 4)
*/

static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_AlignmentWithSequenceReversal__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_AlignmentWithSequenceReversal__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, __pyx_state: tuple):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 4)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base._read);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base._read);
  __pyx_v___pyx_result->__pyx_base._read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->_read_as_sequenced);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->_read_as_sequenced);
  __pyx_v___pyx_result->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.iv);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.iv);
  __pyx_v___pyx_result->__pyx_base.iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->read_as_aligned);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->read_as_aligned);
  __pyx_v___pyx_result->read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, __pyx_state: tuple):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 4)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_AlignmentWithSequenceReversal__set_state(<AlignmentWithSequenceReversal> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_AlignmentWithSequenceReversal__set_state(AlignmentWithSequenceReversal __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 4)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_BowtieAlignment(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe57e767, 0x9b9341c, 0x482c176, b'_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions')
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_23__pyx_unpickle_BowtieAlignment(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_5HTSeq_6_HTSeq_23__pyx_unpickle_BowtieAlignment = {"__pyx_unpickle_BowtieAlignment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_23__pyx_unpickle_BowtieAlignment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_23__pyx_unpickle_BowtieAlignment(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_BowtieAlignment (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_BowtieAlignment", 0) < (0)) __PYX_ERR(3, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BowtieAlignment", 1, 3, 3, i); __PYX_ERR(3, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(3, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BowtieAlignment", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_BowtieAlignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(3, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_22__pyx_unpickle_BowtieAlignment(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_22__pyx_unpickle_BowtieAlignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_BowtieAlignment", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_BowtieAlignment(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe57e767, 0x9b9341c, 0x482c176, b'_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions')             # <<<<<<<<<<<<<<
 *     __pyx_result = BowtieAlignment.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe57e767, 0x9b9341c, 0x482c176, __pyx_k_read__read_as_sequenced_iv_read_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe57e767, 0x9b9341c, 0x482c176, b'_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions')
 *     __pyx_result = BowtieAlignment.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_BowtieAlignment__set_state(<BowtieAlignment> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe57e767, 0x9b9341c, 0x482c176, b'_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions')
 *     __pyx_result = BowtieAlignment.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_BowtieAlignment__set_state(<BowtieAlignment> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = BowtieAlignment.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_BowtieAlignment__set_state(<BowtieAlignment> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(3, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_BowtieAlignment__set_state(((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe57e767, 0x9b9341c, 0x482c176, b'_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions')
 *     __pyx_result = BowtieAlignment.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_BowtieAlignment__set_state(<BowtieAlignment> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_BowtieAlignment__set_state(<BowtieAlignment> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, __pyx_state: tuple):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_BowtieAlignment(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe57e767, 0x9b9341c, 0x482c176, b'_read, _read_as_sequenced, iv, read_as_aligned, reserved, substitutions')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_BowtieAlignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_BowtieAlignment__set_state(<BowtieAlignment> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 6)
*/

static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_BowtieAlignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_BowtieAlignment__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, __pyx_state: tuple):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 6)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base._read);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base._read);
  __pyx_v___pyx_result->__pyx_base.__pyx_base._read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base._read_as_sequenced);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base._read_as_sequenced);
  __pyx_v___pyx_result->__pyx_base._read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.iv);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.iv);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.read_as_aligned);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.read_as_aligned);
  __pyx_v___pyx_result->__pyx_base.read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->reserved);
  __Pyx_DECREF(__pyx_v___pyx_result->reserved);
  __pyx_v___pyx_result->reserved = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->substitutions);
  __Pyx_DECREF(__pyx_v___pyx_result->substitutions);
  __pyx_v___pyx_result->substitutions = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, __pyx_state: tuple):
 *     __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 6)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 6); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_BowtieAlignment__set_state(<BowtieAlignment> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_BowtieAlignment__set_state(BowtieAlignment __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._read = __pyx_state[0]; __pyx_result._read_as_sequenced = __pyx_state[1]; __pyx_result.iv = __pyx_state[2]; __pyx_result.read_as_aligned = __pyx_state[3]; __pyx_result.reserved = __pyx_state[4]; __pyx_result.substitutions = __pyx_state[5]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 6)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_SAM_Alignment(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x096ac21, 0xd9f838f, 0xf6933f3, b'_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary')
*/

/* Python wrapper */
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment(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_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment = {"__pyx_unpickle_SAM_Alignment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_SAM_Alignment (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_SAM_Alignment", 0) < (0)) __PYX_ERR(3, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SAM_Alignment", 1, 3, 3, i); __PYX_ERR(3, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(3, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(3, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SAM_Alignment", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_SAM_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(3, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_5HTSeq_6_HTSeq_24__pyx_unpickle_SAM_Alignment(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_5HTSeq_6_HTSeq_24__pyx_unpickle_SAM_Alignment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SAM_Alignment", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_SAM_Alignment(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x096ac21, 0xd9f838f, 0xf6933f3, b'_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary')             # <<<<<<<<<<<<<<
 *     __pyx_result = SAM_Alignment.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x096ac21, 0xd9f838f, 0xf6933f3, __pyx_k_flag__read__read_as_sequenced_a); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x096ac21, 0xd9f838f, 0xf6933f3, b'_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary')
 *     __pyx_result = SAM_Alignment.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SAM_Alignment__set_state(<SAM_Alignment> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x096ac21, 0xd9f838f, 0xf6933f3, b'_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary')
 *     __pyx_result = SAM_Alignment.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SAM_Alignment__set_state(<SAM_Alignment> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = SAM_Alignment.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SAM_Alignment__set_state(<SAM_Alignment> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(3, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_SAM_Alignment__set_state(((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x096ac21, 0xd9f838f, 0xf6933f3, b'_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary')
 *     __pyx_result = SAM_Alignment.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SAM_Alignment__set_state(<SAM_Alignment> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SAM_Alignment__set_state(<SAM_Alignment> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, __pyx_state: tuple):
 *     __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_SAM_Alignment(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x096ac21, 0xd9f838f, 0xf6933f3, b'_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_SAM_Alignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_SAM_Alignment__set_state(<SAM_Alignment> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 17)
*/

static PyObject *__pyx_f_5HTSeq_6_HTSeq___pyx_unpickle_SAM_Alignment__set_state(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SAM_Alignment__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, __pyx_state: tuple):
 *     __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 17)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_flag = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base._read);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base._read);
  __pyx_v___pyx_result->__pyx_base.__pyx_base._read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base._read_as_sequenced);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base._read_as_sequenced);
  __pyx_v___pyx_result->__pyx_base._read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->aQual = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->cigar);
  __Pyx_DECREF(__pyx_v___pyx_result->cigar);
  __pyx_v___pyx_result->cigar = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->failed_platform_qc = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->inferred_insert_size = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.iv);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.iv);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->mate_start);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->mate_start);
  __pyx_v___pyx_result->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->not_primary_alignment = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->optional_fields);
  __Pyx_DECREF(__pyx_v___pyx_result->optional_fields);
  __pyx_v___pyx_result->optional_fields = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->original_sam_line);
  __Pyx_DECREF(__pyx_v___pyx_result->original_sam_line);
  __pyx_v___pyx_result->original_sam_line = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->pcr_or_optical_duplicate = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->pe_which);
  __Pyx_DECREF(__pyx_v___pyx_result->pe_which);
  __pyx_v___pyx_result->pe_which = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->proper_pair = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities))))) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.read_as_aligned);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.read_as_aligned);
  __pyx_v___pyx_result->__pyx_base.read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->supplementary = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, __pyx_state: tuple):
 *     __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 17)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 17); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_SAM_Alignment__set_state(<SAM_Alignment> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SAM_Alignment__set_state(SAM_Alignment __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._flag = __pyx_state[0]; __pyx_result._read = __pyx_state[1]; __pyx_result._read_as_sequenced = __pyx_state[2]; __pyx_result.aQual = __pyx_state[3]; __pyx_result.cigar = __pyx_state[4]; __pyx_result.failed_platform_qc = __pyx_state[5]; __pyx_result.inferred_insert_size = __pyx_state[6]; __pyx_result.iv = __pyx_state[7]; __pyx_result.mate_start = __pyx_state[8]; __pyx_result.not_primary_alignment = __pyx_state[9]; __pyx_result.optional_fields = __pyx_state[10]; __pyx_result.original_sam_line = __pyx_state[11]; __pyx_result.pcr_or_optical_duplicate = __pyx_state[12]; __pyx_result.pe_which = __pyx_state[13]; __pyx_result.proper_pair = __pyx_state[14]; __pyx_result.read_as_aligned = __pyx_state[15]; __pyx_result.supplementary = __pyx_state[16]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 17)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("HTSeq._HTSeq.__pyx_unpickle_SAM_Alignment__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval __pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval;

static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicInterval(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)o);
  p->__pyx_vtab = __pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval;
  p->chrom = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_strand = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicInterval(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *p = (struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)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_5HTSeq_6_HTSeq_GenomicInterval) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  Py_CLEAR(p->chrom);
  Py_CLEAR(p->_strand);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_strand(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_3__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_strand(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6strand_1__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_length(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_6length_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7start_d_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_d(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5end_d_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_as_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12start_as_pos_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_as_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_10end_as_pos_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d_as_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_14start_d_as_pos_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_d_as_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_12end_d_as_pos_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_chrom(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_chrom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5chrom_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5start_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_end(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3end_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_GenomicInterval[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__copy__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"range", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_21range, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_20range},
  {"range_d", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_23range_d, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval_22range_d},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_27copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_GenomicInterval[] = {
  {"strand", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_strand, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_strand, 0, 0},
  {"length", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_length, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_length, PyDoc_STR("The length is calculated as end - start. If you set the length,\n        'start_d' will be preserved, i.e., 'end' is changed, unless the strand\n        is '-', in which case 'start' is changed."), 0},
  {"start_d", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d, PyDoc_STR("See the class docstring for the meaning of the 'directional start'.\n        Note that if you set 'start_d', both the start and the end are changed,\n        such the interval gets the requested new directional start and its\n        length stays unchanged."), 0},
  {"end_d", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_d, 0, 0, 0},
  {"start_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_as_pos, 0, 0, 0},
  {"end_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_as_pos, 0, 0, 0},
  {"start_d_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start_d_as_pos, 0, 0, 0},
  {"end_d_as_pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end_d_as_pos, 0, 0, 0},
  {"chrom", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_chrom, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_chrom, 0, 0},
  {"start", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_start, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_start, 0, 0},
  {"end", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicInterval_end, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicInterval_end, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_GenomicInterval_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicInterval},
  {Py_tp_repr, (void *)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7__repr__},
  {Py_tp_hash, (void *)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_13__hash__},
  {Py_tp_str, (void *)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_9__str__},
  {Py_tp_doc, (void *)PyDoc_STR("A range of consecutive positions on a reference genome.\n\n        Properties:\n\n        chrom: The name of a sequence (i.e., chromosome, contig, etc.).\n        start: The start of the interval. Even on the reverse strand,\n          this is always the smaller of the two values 'start' and 'end'.\n          Note that all positions should be given as 0-based value!\n        end: The end of the interval. Following Python convention for\n          ranges, this in one more than the coordinate of the last base\n          that is considered part of the sequence.\n        strand: The strand, as a single character, '+' or '-'. '.' indicates\n          that the strand is irrelavant. (Alternatively, pass a Strand object.)\n        length: The length of the interval, i.e., end - start\n        start_d: The \"directional start\" position. This is the position of the\n          first base of the interval, taking the strand into account. Hence,\n          this is the same as 'start' except when strand == '-', in which\n          case it is end-1.\n        end_d: The \"directional end\": Usually, the same as 'end', but for\n          strand=='-1', it is start-1.\n    ")},
  {Py_tp_richcompare, (void *)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_11__richcmp__},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_GenomicInterval},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_GenomicInterval},
  {Py_tp_init, (void *)__pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_GenomicInterval},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_GenomicInterval_spec = {
  "HTSeq._HTSeq.GenomicInterval",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_5HTSeq_6_HTSeq_GenomicInterval_slots,
};
#else

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_GenomicInterval = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""GenomicInterval", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicInterval, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_7__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_13__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_9__str__, /*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, /*tp_flags*/
  PyDoc_STR("A range of consecutive positions on a reference genome.\n\n        Properties:\n\n        chrom: The name of a sequence (i.e., chromosome, contig, etc.).\n        start: The start of the interval. Even on the reverse strand,\n          this is always the smaller of the two values 'start' and 'end'.\n          Note that all positions should be given as 0-based value!\n        end: The end of the interval. Following Python convention for\n          ranges, this in one more than the coordinate of the last base\n          that is considered part of the sequence.\n        strand: The strand, as a single character, '+' or '-'. '.' indicates\n          that the strand is irrelavant. (Alternatively, pass a Strand object.)\n        length: The length of the interval, i.e., end - start\n        start_d: The \"directional start\" position. This is the position of the\n          first base of the interval, taking the strand into account. Hence,\n          this is the same as 'start' except when strand == '-', in which\n          case it is end-1.\n        end_d: The \"directional end\": Usually, the same as 'end', but for\n          strand=='-1', it is start-1.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_11__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_GenomicInterval, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_GenomicInterval, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_15GenomicInterval_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5HTSeq_6_HTSeq_GenomicInterval, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicPosition __pyx_vtable_5HTSeq_6_HTSeq_GenomicPosition;

static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_GenomicPosition(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *p;
  PyObject *o = __pyx_tp_new_5HTSeq_6_HTSeq_GenomicInterval(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5HTSeq_6_HTSeq_GenomicInterval*)__pyx_vtabptr_5HTSeq_6_HTSeq_GenomicPosition;
  return o;
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_15GenomicPosition_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3pos_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_end(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3end_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_6length_1__get__(o);
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_GenomicPosition[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_9copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_GenomicPosition[] = {
  {"pos", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_pos, __pyx_setprop_5HTSeq_6_HTSeq_15GenomicPosition_pos, PyDoc_STR("Alias for 'start_d'."), 0},
  {"end", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_end, 0, 0, 0},
  {"length", __pyx_getprop_5HTSeq_6_HTSeq_15GenomicPosition_length, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_GenomicPosition_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicInterval},
  {Py_tp_repr, (void *)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3__repr__},
  {Py_tp_str, (void *)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_5__str__},
  {Py_tp_doc, (void *)PyDoc_STR("Position of a nucleotide or base pair on a reference genome.\n\n    Properties:\n       chrom: The name of a sequence (i.e., chromosome, contig, etc.).\n       pos: The position on the sequence specified by seqname.\n          The position should always be given as 0-based value!\n       strand: The strand, as a single character, '+' or '-'. '.' indicates\n          that the strand is irrelavant.\n\n    The GenomicPosition class is derived from GenomicInterval. Hence,\n    a GenomicPosition is always a GenomicInterval of length 1. Do not tinker\n    with the exposed GenomeInterval properties.\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_GenomicPosition},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_GenomicPosition},
  {Py_tp_init, (void *)__pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_GenomicPosition},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_GenomicPosition_spec = {
  "HTSeq._HTSeq.GenomicPosition",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_5HTSeq_6_HTSeq_GenomicPosition_slots,
};
#else

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_GenomicPosition = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""GenomicPosition", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicInterval, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_5__str__, /*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, /*tp_flags*/
  PyDoc_STR("Position of a nucleotide or base pair on a reference genome.\n\n    Properties:\n       chrom: The name of a sequence (i.e., chromosome, contig, etc.).\n       pos: The position on the sequence specified by seqname.\n          The position should always be given as 0-based value!\n       strand: The strand, as a single character, '+' or '-'. '.' indicates\n          that the strand is irrelavant.\n\n    The GenomicPosition class is derived from GenomicInterval. Hence,\n    a GenomicPosition is always a GenomicInterval of length 1. Do not tinker\n    with the exposed GenomeInterval properties.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_GenomicPosition, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_GenomicPosition, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_15GenomicPosition_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5HTSeq_6_HTSeq_GenomicPosition, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence __pyx_vtable_5HTSeq_6_HTSeq_Sequence;

static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_Sequence(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)o);
  p->__pyx_vtab = __pyx_vtabptr_5HTSeq_6_HTSeq_Sequence;
  p->seq = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->descr = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_Sequence(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *p = (struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *)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_5HTSeq_6_HTSeq_Sequence) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  Py_CLEAR(p->seq);
  Py_CLEAR(p->name);
  Py_CLEAR(p->descr);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_sq_item_5HTSeq_6_HTSeq_Sequence(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_8Sequence_seq(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_seq(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_3seq_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_8Sequence_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_8Sequence_descr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_descr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5descr_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_Sequence[] = {
  {"__getstate__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_13__getstate__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_15__setstate__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_17__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"write_to_fasta_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_8Sequence_18write_to_fasta_file},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_Sequence[] = {
  {"seq", __pyx_getprop_5HTSeq_6_HTSeq_8Sequence_seq, __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_seq, 0, 0},
  {"name", __pyx_getprop_5HTSeq_6_HTSeq_8Sequence_name, __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_name, 0, 0},
  {"descr", __pyx_getprop_5HTSeq_6_HTSeq_8Sequence_descr, __pyx_setprop_5HTSeq_6_HTSeq_8Sequence_descr, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_Sequence_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_Sequence},
  {Py_tp_repr, (void *)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_7__repr__},
  {Py_sq_length, (void *)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__},
  {Py_sq_item, (void *)__pyx_sq_item_5HTSeq_6_HTSeq_Sequence},
  {Py_mp_length, (void *)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__},
  {Py_mp_subscript, (void *)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_11__getitem__},
  {Py_tp_str, (void *)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_5__str__},
  {Py_tp_doc, (void *)PyDoc_STR("A Sequence, typically of DNA, with a name.")},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_Sequence},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_Sequence},
  {Py_tp_init, (void *)__pyx_pw_5HTSeq_6_HTSeq_8Sequence_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_Sequence},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_Sequence_spec = {
  "HTSeq._HTSeq.Sequence",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_5HTSeq_6_HTSeq_Sequence_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_Sequence = {
  __pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_5HTSeq_6_HTSeq_Sequence, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Sequence = {
  __pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__, /*mp_length*/
  __pyx_pw_5HTSeq_6_HTSeq_8Sequence_11__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_Sequence = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""Sequence", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_Sequence, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_5HTSeq_6_HTSeq_8Sequence_7__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Sequence, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Sequence, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5__str__, /*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, /*tp_flags*/
  PyDoc_STR("A Sequence, typically of DNA, with a name."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_Sequence, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_Sequence, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_8Sequence_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5HTSeq_6_HTSeq_Sequence, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_5HTSeq_6_HTSeq_SequenceWithQualities __pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities;

static PyObject *__pyx_tp_new_5HTSeq_6_HTSeq_SequenceWithQualities(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *p;
  PyObject *o = __pyx_tp_new_5HTSeq_6_HTSeq_Sequence(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5HTSeq_6_HTSeq_Sequence*)__pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities;
  p->_qualstr = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_qualstr_phred = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_qualscale = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_qualarr = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_SequenceWithQualities(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)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_5HTSeq_6_HTSeq_SequenceWithQualities) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_qualstr);
  Py_CLEAR(p->_qualstr_phred);
  Py_CLEAR(p->_qualscale);
  Py_CLEAR(p->_qualarr);
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_Sequence(o);
}

static int __pyx_tp_traverse_5HTSeq_6_HTSeq_SequenceWithQualities(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5HTSeq_6_HTSeq_SequenceWithQualities); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->_qualarr) {
    e = (*v)(p->_qualarr, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5HTSeq_6_HTSeq_SequenceWithQualities(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5HTSeq_6_HTSeq_SequenceWithQualities); }
  tmp = ((PyObject*)p->_qualarr);
  p->_qualarr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_sq_item_5HTSeq_6_HTSeq_SequenceWithQualities(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qual(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qual(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_4qual_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qualstr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7qualstr_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualstr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualstr_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualstr_phred(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_14_qualstr_phred_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualscale(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_10_qualscale_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualarr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_8_qualarr_1__get__(o);
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_SequenceWithQualities[] = {
  {"write_to_fastq_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get_fastq_str", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_SequenceWithQualities[] = {
  {"qual", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qual, __pyx_setprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qual, 0, 0},
  {"qualstr", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities_qualstr, 0, 0, 0},
  {"_qualstr", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualstr, 0, 0, 0},
  {"_qualstr_phred", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualstr_phred, 0, 0, 0},
  {"_qualscale", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualscale, 0, 0, 0},
  {"_qualarr", __pyx_getprop_5HTSeq_6_HTSeq_21SequenceWithQualities__qualarr, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_SequenceWithQualities},
  {Py_tp_repr, (void *)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_3__repr__},
  {Py_sq_item, (void *)__pyx_sq_item_5HTSeq_6_HTSeq_SequenceWithQualities},
  {Py_mp_subscript, (void *)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_5__getitem__},
  {Py_tp_doc, (void *)PyDoc_STR("A Sequence with base-call quality scores.\n    It now has property  'qual', an integer NumPy array of Sanger/Phred\n    quality scores of the  base calls.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_5HTSeq_6_HTSeq_SequenceWithQualities},
  {Py_tp_clear, (void *)__pyx_tp_clear_5HTSeq_6_HTSeq_SequenceWithQualities},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_SequenceWithQualities},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_SequenceWithQualities},
  {Py_tp_init, (void *)__pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_SequenceWithQualities},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities_spec = {
  "HTSeq._HTSeq.SequenceWithQualities",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities),
  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_5HTSeq_6_HTSeq_SequenceWithQualities_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_SequenceWithQualities = {
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_5HTSeq_6_HTSeq_SequenceWithQualities, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SequenceWithQualities = {
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_5HTSeq_6_HTSeq_8Sequence_9__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_5__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""SequenceWithQualities", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_SequenceWithQualities, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SequenceWithQualities, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_5HTSeq_6_HTSeq_8Sequence_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  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("A Sequence with base-call quality scores.\n    It now has property  'qual', an integer NumPy array of Sanger/Phred\n    quality scores of the  base calls.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_traverse*/
  __pyx_tp_clear_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_SequenceWithQualities, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_21SequenceWithQualities_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5HTSeq_6_HTSeq_SequenceWithQualities, /*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_5HTSeq_6_HTSeq_Alignment(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)o);
  p->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
  p->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_Alignment(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)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_5HTSeq_6_HTSeq_Alignment) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_read);
  Py_CLEAR(p->iv);
  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_5HTSeq_6_HTSeq_Alignment(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->_read) {
    e = (*v)(((PyObject *)p->_read), a); if (e) return e;
  }
  if (p->iv) {
    e = (*v)(((PyObject *)p->iv), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5HTSeq_6_HTSeq_Alignment(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_Alignment *)o;
  tmp = ((PyObject*)p->_read);
  p->_read = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iv);
  p->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_9Alignment_read(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_4read_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_9Alignment_paired_end(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_10paired_end_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_9Alignment_aligned(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_7aligned_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_9Alignment__read(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_9Alignment__read(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_5_read_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_9Alignment_iv(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_9Alignment_iv(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_9Alignment_2iv_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_Alignment[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_9Alignment_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_9Alignment_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_Alignment[] = {
  {"read", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_read, 0, 0, 0},
  {"paired_end", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_paired_end, 0, 0, 0},
  {"aligned", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_aligned, 0, PyDoc_STR("Returns True unless self.iv is None. The latter indicates that\n        this record decribes a read for which no alignment was found.\n        "), 0},
  {"_read", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment__read, __pyx_setprop_5HTSeq_6_HTSeq_9Alignment__read, 0, 0},
  {"iv", __pyx_getprop_5HTSeq_6_HTSeq_9Alignment_iv, __pyx_setprop_5HTSeq_6_HTSeq_9Alignment_iv, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_Alignment_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_Alignment},
  {Py_tp_repr, (void *)__pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("An aligned read (typically from a BAM file).\n\n    An alignment object can be defined in different ways but will always\n    provide these attributes:\n      read:      a SequenceWithQualities object with the read\n      aligned:   whether the read is aligned\n      iv:        a GenomicInterval object with the alignment position\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_5HTSeq_6_HTSeq_Alignment},
  {Py_tp_clear, (void *)__pyx_tp_clear_5HTSeq_6_HTSeq_Alignment},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_Alignment},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_Alignment},
  {Py_tp_init, (void *)__pyx_pw_5HTSeq_6_HTSeq_9Alignment_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_Alignment},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_Alignment_spec = {
  "HTSeq._HTSeq.Alignment",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment),
  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_5HTSeq_6_HTSeq_Alignment_slots,
};
#else

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_Alignment = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""Alignment", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_Alignment), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_Alignment, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("An aligned read (typically from a BAM file).\n\n    An alignment object can be defined in different ways but will always\n    provide these attributes:\n      read:      a SequenceWithQualities object with the read\n      aligned:   whether the read is aligned\n      iv:        a GenomicInterval object with the alignment position\n    "), /*tp_doc*/
  __pyx_tp_traverse_5HTSeq_6_HTSeq_Alignment, /*tp_traverse*/
  __pyx_tp_clear_5HTSeq_6_HTSeq_Alignment, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_Alignment, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_Alignment, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_9Alignment_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5HTSeq_6_HTSeq_Alignment, /*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_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *p;
  PyObject *o = __pyx_tp_new_5HTSeq_6_HTSeq_Alignment(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)o);
  p->read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
  p->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *p = (struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)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_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->read_as_aligned);
  Py_CLEAR(p->_read_as_sequenced);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_Alignment(o);
}

static int __pyx_tp_traverse_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *p = (struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)o;
  e = __pyx_tp_traverse_5HTSeq_6_HTSeq_Alignment(o, v, a); if (e) return e;
  if (p->read_as_aligned) {
    e = (*v)(((PyObject *)p->read_as_aligned), a); if (e) return e;
  }
  if (p->_read_as_sequenced) {
    e = (*v)(((PyObject *)p->_read_as_sequenced), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *p = (struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal *)o;
  __pyx_tp_clear_5HTSeq_6_HTSeq_Alignment(o);
  tmp = ((PyObject*)p->read_as_aligned);
  p->read_as_aligned = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_read_as_sequenced);
  p->_read_as_sequenced = ((struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_4read_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read_as_aligned(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read_as_aligned(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_15read_as_aligned_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal__read_as_sequenced(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal__read_as_sequenced(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_18_read_as_sequenced_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal[] = {
  {"read", __pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read, 0, 0, 0},
  {"read_as_aligned", __pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read_as_aligned, __pyx_setprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_read_as_aligned, 0, 0},
  {"_read_as_sequenced", __pyx_getprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal__read_as_sequenced, __pyx_setprop_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal__read_as_sequenced, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal},
  {Py_tp_doc, (void *)PyDoc_STR("Many aligners report the read's sequence in reverse-complemented form\n    when it was mapped to the reverse strand. For such alignments, a\n    daughter class of this one should be used.\n\n    Then, the read is stored as aligned in the 'read_as_aligned' field,\n    and get reverse-complemented back to the sequenced form when the 'read'\n    attribute is sequenced.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal},
  {Py_tp_clear, (void *)__pyx_tp_clear_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal},
  {Py_tp_init, (void *)__pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal_spec = {
  "HTSeq._HTSeq.AlignmentWithSequenceReversal",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal),
  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_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal_slots,
};
#else

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""AlignmentWithSequenceReversal", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("Many aligners report the read's sequence in reverse-complemented form\n    when it was mapped to the reverse strand. For such alignments, a\n    daughter class of this one should be used.\n\n    Then, the read is stored as aligned in the 'read_as_aligned' field,\n    and get reverse-complemented back to the sequenced form when the 'read'\n    attribute is sequenced.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_traverse*/
  __pyx_tp_clear_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*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_5HTSeq_6_HTSeq_SAM_Alignment(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *p;
  PyObject *o = __pyx_tp_new_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)o);
  p->cigar = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None); Py_INCREF(Py_None);
  p->pe_which = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->original_sam_line = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->optional_fields = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_SAM_Alignment(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)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_5HTSeq_6_HTSeq_SAM_Alignment) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->cigar);
  Py_CLEAR(p->mate_start);
  Py_CLEAR(p->pe_which);
  Py_CLEAR(p->original_sam_line);
  Py_CLEAR(p->optional_fields);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(o);
}

static int __pyx_tp_traverse_5HTSeq_6_HTSeq_SAM_Alignment(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)o;
  e = __pyx_tp_traverse_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(o, v, a); if (e) return e;
  if (p->cigar) {
    e = (*v)(p->cigar, a); if (e) return e;
  }
  if (p->mate_start) {
    e = (*v)(((PyObject *)p->mate_start), a); if (e) return e;
  }
  if (p->optional_fields) {
    e = (*v)(p->optional_fields, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5HTSeq_6_HTSeq_SAM_Alignment(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment *)o;
  __pyx_tp_clear_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(o);
  tmp = ((PyObject*)p->cigar);
  p->cigar = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mate_start);
  p->mate_start = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicPosition *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->optional_fields);
  p->optional_fields = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_flag(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_flag(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_4flag_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_paired_end(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10paired_end_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_aligned(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_12mate_aligned_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_cigar(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_cigar(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5cigar_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_aQual(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_aQual(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5aQual_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_start(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_10mate_start_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_pe_which(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_pe_which(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_8pe_which_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_inferred_insert_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_inferred_insert_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_20inferred_insert_size_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_proper_pair(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_proper_pair(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11proper_pair_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_not_primary_alignment(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_not_primary_alignment(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21not_primary_alignment_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_failed_platform_qc(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_failed_platform_qc(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_18failed_platform_qc_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_pcr_or_optical_duplicate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_pcr_or_optical_duplicate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_24pcr_or_optical_duplicate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_supplementary(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_supplementary(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13supplementary_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_original_sam_line(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17original_sam_line_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_optional_fields(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_optional_fields(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_fields_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_SAM_Alignment[] = {
  {"to_pysam_AlignedSegment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"to_pysam_AlignedRead", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"from_pysam_AlignedRead", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"from_pysam_AlignedSegment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"from_SAM_line", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get_sam_line", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"has_optional_field", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_13has_optional_field, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_13SAM_Alignment_12has_optional_field},
  {"optional_field", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_field, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"raw_optional_fields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_17raw_optional_fields, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_13SAM_Alignment_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_SAM_Alignment[] = {
  {"flag", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_flag, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_flag, 0, 0},
  {"paired_end", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_paired_end, 0, 0, 0},
  {"mate_aligned", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_aligned, 0, 0, 0},
  {"cigar", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_cigar, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_cigar, 0, 0},
  {"aQual", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_aQual, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_aQual, 0, 0},
  {"mate_start", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_start, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_mate_start, 0, 0},
  {"pe_which", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_pe_which, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_pe_which, 0, 0},
  {"inferred_insert_size", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_inferred_insert_size, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_inferred_insert_size, 0, 0},
  {"proper_pair", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_proper_pair, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_proper_pair, 0, 0},
  {"not_primary_alignment", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_not_primary_alignment, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_not_primary_alignment, 0, 0},
  {"failed_platform_qc", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_failed_platform_qc, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_failed_platform_qc, 0, 0},
  {"pcr_or_optical_duplicate", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_pcr_or_optical_duplicate, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_pcr_or_optical_duplicate, 0, 0},
  {"supplementary", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_supplementary, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_supplementary, 0, 0},
  {"original_sam_line", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_original_sam_line, 0, 0, 0},
  {"optional_fields", __pyx_getprop_5HTSeq_6_HTSeq_13SAM_Alignment_optional_fields, __pyx_setprop_5HTSeq_6_HTSeq_13SAM_Alignment_optional_fields, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_SAM_Alignment_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_SAM_Alignment},
  {Py_tp_doc, (void *)PyDoc_STR("When reading in a SAM file, objects of the class SAM_Alignment\n    are returned. In addition to the 'read', 'iv' and 'aligned' fields (see\n    Alignment class), the following fields are provided:\n     - aQual: the alignment quality score\n     - cigar: a list of CigarOperatio objects, describing the alignment\n     - tags: the extra information tags [not yet implemented]\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_5HTSeq_6_HTSeq_SAM_Alignment},
  {Py_tp_clear, (void *)__pyx_tp_clear_5HTSeq_6_HTSeq_SAM_Alignment},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_SAM_Alignment},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_SAM_Alignment},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_SAM_Alignment},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_SAM_Alignment_spec = {
  "HTSeq._HTSeq.SAM_Alignment",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment),
  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_5HTSeq_6_HTSeq_SAM_Alignment_slots,
};
#else

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_SAM_Alignment = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""SAM_Alignment", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_SAM_Alignment), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_SAM_Alignment, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("When reading in a SAM file, objects of the class SAM_Alignment\n    are returned. In addition to the 'read', 'iv' and 'aligned' fields (see\n    Alignment class), the following fields are provided:\n     - aQual: the alignment quality score\n     - cigar: a list of CigarOperatio objects, describing the alignment\n     - tags: the extra information tags [not yet implemented]\n    "), /*tp_doc*/
  __pyx_tp_traverse_5HTSeq_6_HTSeq_SAM_Alignment, /*tp_traverse*/
  __pyx_tp_clear_5HTSeq_6_HTSeq_SAM_Alignment, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_SAM_Alignment, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_SAM_Alignment, /*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
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_5HTSeq_6_HTSeq_SAM_Alignment, /*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_5HTSeq_6_HTSeq_ChromVector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)o);
  p->array = Py_None; Py_INCREF(Py_None);
  p->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
  p->_storage = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->typecode = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->memmap_dir = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_ChromVector(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *p = (struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)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_5HTSeq_6_HTSeq_ChromVector) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->array);
  Py_CLEAR(p->iv);
  Py_CLEAR(p->_storage);
  Py_CLEAR(p->typecode);
  Py_CLEAR(p->memmap_dir);
  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_5HTSeq_6_HTSeq_ChromVector(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *p = (struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->array) {
    e = (*v)(p->array, a); if (e) return e;
  }
  if (p->iv) {
    e = (*v)(((PyObject *)p->iv), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5HTSeq_6_HTSeq_ChromVector(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *p = (struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector *)o;
  tmp = ((PyObject*)p->array);
  p->array = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iv);
  p->iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_sq_item_5HTSeq_6_HTSeq_ChromVector(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_5HTSeq_6_HTSeq_ChromVector(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_9__setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_array(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_array(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5array_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_iv(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_iv(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_2iv_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_offset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_6offset_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_is_vector_of_sets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_is_vector_of_sets(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17is_vector_of_sets_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector__storage(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector__storage(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8_storage_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_typecode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8typecode_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_typecode(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8typecode_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_8typecode_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_memmap_dir(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_memmap_dir(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_10memmap_dir_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_ChromVector[] = {
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_11ChromVector_create},
  {"_create_view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_3_create_view, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"extend_to_include", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_5extend_to_include, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"values", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_15values, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"steps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_17steps, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"apply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_19apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_23__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_ChromVector[] = {
  {"array", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_array, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_array, 0, 0},
  {"iv", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_iv, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_iv, 0, 0},
  {"offset", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_offset, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_offset, 0, 0},
  {"is_vector_of_sets", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_is_vector_of_sets, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_is_vector_of_sets, 0, 0},
  {"_storage", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector__storage, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector__storage, 0, 0},
  {"typecode", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_typecode, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_typecode, 0, 0},
  {"memmap_dir", __pyx_getprop_5HTSeq_6_HTSeq_11ChromVector_memmap_dir, __pyx_setprop_5HTSeq_6_HTSeq_11ChromVector_memmap_dir, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_ChromVector_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_ChromVector},
  {Py_tp_repr, (void *)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_21__repr__},
  {Py_nb_inplace_add, (void *)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_11__iadd__},
  {Py_sq_item, (void *)__pyx_sq_item_5HTSeq_6_HTSeq_ChromVector},
  {Py_mp_subscript, (void *)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_7__getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_5HTSeq_6_HTSeq_ChromVector},
  {Py_tp_doc, (void *)PyDoc_STR("Counting vector covering a chromosome.\n\n    This class supports three types of storage:\n      1. 'ndarray': Use a dense 1D numpy array\n      2. 'memmap': Use numpy memory maps on disk for large arrays\n      3. 'step': Use a StepVector\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_5HTSeq_6_HTSeq_ChromVector},
  {Py_tp_clear, (void *)__pyx_tp_clear_5HTSeq_6_HTSeq_ChromVector},
  {Py_tp_iter, (void *)__pyx_pw_5HTSeq_6_HTSeq_11ChromVector_13__iter__},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_ChromVector},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_ChromVector},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_ChromVector},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_ChromVector_spec = {
  "HTSeq._HTSeq.ChromVector",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector),
  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_5HTSeq_6_HTSeq_ChromVector_slots,
};
#else

static PyNumberMethods __pyx_tp_as_number_ChromVector = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_bool*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_11__iadd__, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

static PySequenceMethods __pyx_tp_as_sequence_ChromVector = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_5HTSeq_6_HTSeq_ChromVector, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ChromVector = {
  0, /*mp_length*/
  __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_7__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_5HTSeq_6_HTSeq_ChromVector, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_ChromVector = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""ChromVector", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_ChromVector), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_ChromVector, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_21__repr__, /*tp_repr*/
  &__pyx_tp_as_number_ChromVector, /*tp_as_number*/
  &__pyx_tp_as_sequence_ChromVector, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ChromVector, /*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("Counting vector covering a chromosome.\n\n    This class supports three types of storage:\n      1. 'ndarray': Use a dense 1D numpy array\n      2. 'memmap': Use numpy memory maps on disk for large arrays\n      3. 'step': Use a StepVector\n    "), /*tp_doc*/
  __pyx_tp_traverse_5HTSeq_6_HTSeq_ChromVector, /*tp_traverse*/
  __pyx_tp_clear_5HTSeq_6_HTSeq_ChromVector, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_5HTSeq_6_HTSeq_11ChromVector_13__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_ChromVector, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_ChromVector, /*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_5HTSeq_6_HTSeq_ChromVector, /*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_5HTSeq_6_HTSeq_GenomicArray(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)o);
  p->chrom_vectors = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->typecode = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->auto_add_chroms = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->storage = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->memmap_dir = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->header = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicArray(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *p = (struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)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_5HTSeq_6_HTSeq_GenomicArray) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->chrom_vectors);
  Py_CLEAR(p->typecode);
  Py_CLEAR(p->auto_add_chroms);
  Py_CLEAR(p->storage);
  Py_CLEAR(p->memmap_dir);
  Py_CLEAR(p->header);
  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_5HTSeq_6_HTSeq_GenomicArray(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *p = (struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->chrom_vectors) {
    e = (*v)(p->chrom_vectors, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5HTSeq_6_HTSeq_GenomicArray(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *p = (struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray *)o;
  tmp = ((PyObject*)p->chrom_vectors);
  p->chrom_vectors = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_sq_item_5HTSeq_6_HTSeq_GenomicArray(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_5HTSeq_6_HTSeq_GenomicArray(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_5__setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_chrom_vectors(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_chrom_vectors(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13chrom_vectors_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_stranded(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8stranded_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_typecode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_8typecode_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_auto_add_chroms(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_auto_add_chroms(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15auto_add_chroms_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_storage(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7storage_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_memmap_dir(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_10memmap_dir_1__get__(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_header(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_6header_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_header(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_6header_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_6header_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_GenomicArray[] = {
  {"add_chrom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"write_bedgraph_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_13write_bedgraph_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_12write_bedgraph_file},
  {"from_bedgraph_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_15from_bedgraph_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_14from_bedgraph_file},
  {"write_bigwig_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_16write_bigwig_file},
  {"from_bigwig_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_19from_bigwig_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_18from_bigwig_file},
  {"steps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_21steps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_20steps},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_GenomicArray[] = {
  {"chrom_vectors", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_chrom_vectors, __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_chrom_vectors, 0, 0},
  {"stranded", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_stranded, 0, 0, 0},
  {"typecode", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_typecode, 0, 0, 0},
  {"auto_add_chroms", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_auto_add_chroms, __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_auto_add_chroms, 0, 0},
  {"storage", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_storage, 0, 0, 0},
  {"memmap_dir", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_memmap_dir, 0, 0, 0},
  {"header", __pyx_getprop_5HTSeq_6_HTSeq_12GenomicArray_header, __pyx_setprop_5HTSeq_6_HTSeq_12GenomicArray_header, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_GenomicArray_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicArray},
  {Py_sq_item, (void *)__pyx_sq_item_5HTSeq_6_HTSeq_GenomicArray},
  {Py_sq_contains, (void *)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_11__contains__},
  {Py_mp_subscript, (void *)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_3__getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_5HTSeq_6_HTSeq_GenomicArray},
  {Py_tp_doc, (void *)PyDoc_STR("Coverage vector including multiple chromosomes.\n\n    This object is basically a collection of ChromVector, with the same options\n    for storage:\n      1. 'ndarray': Use a dense 1D numpy array\n      2. 'memmap': Use numpy memory maps on disk for large arrays\n      3. 'step': Use a StepVector\n\n    The class also supports autodiscovery of chromosomes if the 'step' storage\n    method is used. In that case, chromosomes of at least sufficient size will\n    be created whenever the data pushed into the GenomicArray refers to them.\n    For instance, if you are computing plain read coverage along chromosomes,\n    each read will inform the GenomicArray as of its chromosome and position:\n    the GenomicArray will then create an appropriate ChromVector object of at\n    least that size.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_5HTSeq_6_HTSeq_GenomicArray},
  {Py_tp_clear, (void *)__pyx_tp_clear_5HTSeq_6_HTSeq_GenomicArray},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_GenomicArray},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_GenomicArray},
  {Py_tp_init, (void *)__pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_GenomicArray},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_GenomicArray_spec = {
  "HTSeq._HTSeq.GenomicArray",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray),
  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_5HTSeq_6_HTSeq_GenomicArray_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_GenomicArray = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_5HTSeq_6_HTSeq_GenomicArray, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_11__contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_GenomicArray = {
  0, /*mp_length*/
  __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_3__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_5HTSeq_6_HTSeq_GenomicArray, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_GenomicArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""GenomicArray", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_GenomicArray, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_GenomicArray, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_GenomicArray, /*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("Coverage vector including multiple chromosomes.\n\n    This object is basically a collection of ChromVector, with the same options\n    for storage:\n      1. 'ndarray': Use a dense 1D numpy array\n      2. 'memmap': Use numpy memory maps on disk for large arrays\n      3. 'step': Use a StepVector\n\n    The class also supports autodiscovery of chromosomes if the 'step' storage\n    method is used. In that case, chromosomes of at least sufficient size will\n    be created whenever the data pushed into the GenomicArray refers to them.\n    For instance, if you are computing plain read coverage along chromosomes,\n    each read will inform the GenomicArray as of its chromosome and position:\n    the GenomicArray will then create an appropriate ChromVector object of at\n    least that size.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5HTSeq_6_HTSeq_GenomicArray, /*tp_traverse*/
  __pyx_tp_clear_5HTSeq_6_HTSeq_GenomicArray, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_GenomicArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_GenomicArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_12GenomicArray_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5HTSeq_6_HTSeq_GenomicArray, /*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_5HTSeq_6_HTSeq_CigarOperation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)o);
  p->type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_CigarOperation(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *p = (struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)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_5HTSeq_6_HTSeq_CigarOperation) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->type);
  Py_CLEAR(p->ref_iv);
  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_5HTSeq_6_HTSeq_CigarOperation(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *p = (struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->ref_iv) {
    e = (*v)(((PyObject *)p->ref_iv), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5HTSeq_6_HTSeq_CigarOperation(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *p = (struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation *)o;
  tmp = ((PyObject*)p->ref_iv);
  p->ref_iv = ((struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4type_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_4size_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_ref_iv(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_ref_iv(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_6ref_iv_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_query_from(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_query_from(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_10query_from_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_query_to(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_query_to(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_8query_to_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_CigarOperation[] = {
  {"check", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_5check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_CigarOperation[] = {
  {"type", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_type, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_type, 0, 0},
  {"size", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_size, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_size, 0, 0},
  {"ref_iv", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_ref_iv, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_ref_iv, 0, 0},
  {"query_from", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_query_from, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_query_from, 0, 0},
  {"query_to", __pyx_getprop_5HTSeq_6_HTSeq_14CigarOperation_query_to, __pyx_setprop_5HTSeq_6_HTSeq_14CigarOperation_query_to, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_CigarOperation_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_CigarOperation},
  {Py_tp_repr, (void *)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_3__repr__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_5HTSeq_6_HTSeq_CigarOperation},
  {Py_tp_clear, (void *)__pyx_tp_clear_5HTSeq_6_HTSeq_CigarOperation},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_CigarOperation},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_CigarOperation},
  {Py_tp_init, (void *)__pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_CigarOperation},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_CigarOperation_spec = {
  "HTSeq._HTSeq.CigarOperation",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation),
  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_5HTSeq_6_HTSeq_CigarOperation_slots,
};
#else

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_CigarOperation = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""CigarOperation", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_CigarOperation), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_CigarOperation, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5HTSeq_6_HTSeq_CigarOperation, /*tp_traverse*/
  __pyx_tp_clear_5HTSeq_6_HTSeq_CigarOperation, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_CigarOperation, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_CigarOperation, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_14CigarOperation_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5HTSeq_6_HTSeq_CigarOperation, /*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_5HTSeq_6_HTSeq_BowtieAlignment(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *p;
  PyObject *o = __pyx_tp_new_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)o);
  p->reserved = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->substitutions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5HTSeq_6_HTSeq_BowtieAlignment(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *p = (struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment *)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_5HTSeq_6_HTSeq_BowtieAlignment) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->reserved);
  Py_CLEAR(p->substitutions);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal(o);
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15BowtieAlignment_reserved(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_15BowtieAlignment_reserved(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_8reserved_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5HTSeq_6_HTSeq_15BowtieAlignment_substitutions(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_1__get__(o);
}

static int __pyx_setprop_5HTSeq_6_HTSeq_15BowtieAlignment_substitutions(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_3__set__(o, v);
  }
  else {
    return __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_13substitutions_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5HTSeq_6_HTSeq_BowtieAlignment[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5HTSeq_6_HTSeq_BowtieAlignment[] = {
  {"reserved", __pyx_getprop_5HTSeq_6_HTSeq_15BowtieAlignment_reserved, __pyx_setprop_5HTSeq_6_HTSeq_15BowtieAlignment_reserved, 0, 0},
  {"substitutions", __pyx_getprop_5HTSeq_6_HTSeq_15BowtieAlignment_substitutions, __pyx_setprop_5HTSeq_6_HTSeq_15BowtieAlignment_substitutions, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq_BowtieAlignment_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq_BowtieAlignment},
  {Py_tp_doc, (void *)PyDoc_STR("When reading in a Bowtie file, objects of the class BowtieAlignment\n    are returned. In addition to the 'read' and 'iv' fields (see Alignment\n    class), the fields 'reserved' and 'substitutions' are provided. These\n    contain the content of the respective columns of the Bowtie output\n\n    [A parser for the substitutions field will be added soon.]\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal},
  {Py_tp_clear, (void *)__pyx_tp_clear_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal},
  {Py_tp_methods, (void *)__pyx_methods_5HTSeq_6_HTSeq_BowtieAlignment},
  {Py_tp_getset, (void *)__pyx_getsets_5HTSeq_6_HTSeq_BowtieAlignment},
  {Py_tp_init, (void *)__pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq_BowtieAlignment},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq_BowtieAlignment_spec = {
  "HTSeq._HTSeq.BowtieAlignment",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment),
  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_5HTSeq_6_HTSeq_BowtieAlignment_slots,
};
#else

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq_BowtieAlignment = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""BowtieAlignment", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq_BowtieAlignment), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq_BowtieAlignment, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_5HTSeq_6_HTSeq_9Alignment_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("When reading in a Bowtie file, objects of the class BowtieAlignment\n    are returned. In addition to the 'read' and 'iv' fields (see Alignment\n    class), the fields 'reserved' and 'substitutions' are provided. These\n    contain the content of the respective columns of the Bowtie output\n\n    [A parser for the substitutions field will be added soon.]\n    "), /*tp_doc*/
  __pyx_tp_traverse_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_traverse*/
  __pyx_tp_clear_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5HTSeq_6_HTSeq_BowtieAlignment, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5HTSeq_6_HTSeq_BowtieAlignment, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_5HTSeq_6_HTSeq_15BowtieAlignment_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5HTSeq_6_HTSeq_BowtieAlignment, /*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_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__[--__pyx_mstate_global->__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__));
    #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_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(PyObject *o) {
  struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *p = (struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)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_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_value);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__))))
  {
    __pyx_mstate_global->__pyx_freelist_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__[__pyx_mstate_global->__pyx_freecount_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__++] = ((struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)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_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *p = (struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_value) {
    e = (*v)(p->__pyx_v_value, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *p = (struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ *)o;
  tmp = ((PyObject*)p->__pyx_v_value);
  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd___slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__},
  {Py_tp_clear, (void *)__pyx_tp_clear_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__},
  {Py_tp_new, (void *)__pyx_tp_new_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__},
  {0, 0},
};
static PyType_Spec __pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd___spec = {
  "HTSeq._HTSeq.__pyx_scope_struct____iadd__",
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd___slots,
};
#else

static PyTypeObject __pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "HTSeq._HTSeq.""__pyx_scope_struct____iadd__", /*tp_name*/
  sizeof(struct __pyx_obj_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, /*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_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, /*tp_traverse*/
  __pyx_tp_clear_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, /*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_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__, /*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_v_5HTSeq_6_HTSeq_strand_plus = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_5HTSeq_6_HTSeq_strand_minus = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_5HTSeq_6_HTSeq_strand_nostrand = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i = Py_None; Py_INCREF(Py_None);
  __pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x = Py_None; Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval = &__pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval;
  __pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval.is_contained_in = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_is_contained_in;
  __pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval.contains = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_contains;
  __pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval.overlaps = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_overlaps;
  __pyx_vtable_5HTSeq_6_HTSeq_GenomicInterval.extend_to_include = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, struct __pyx_obj_5HTSeq_6_HTSeq_GenomicInterval *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_15GenomicInterval_extend_to_include;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_GenomicInterval_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval)) __PYX_ERR(0, 31, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_GenomicInterval_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval) < (0)) __PYX_ERR(0, 31, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval = &__pyx_type_5HTSeq_6_HTSeq_GenomicInterval;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval) < (0)) __PYX_ERR(0, 31, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 31, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_5HTSeq_6_HTSeq_15GenomicInterval___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5HTSeq_6_HTSeq_15GenomicInterval___init__.doc = __pyx_doc_5HTSeq_6_HTSeq_15GenomicInterval___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5HTSeq_6_HTSeq_15GenomicInterval___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval) < (0)) __PYX_ERR(0, 31, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval) < (0)) __PYX_ERR(0, 31, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_GenomicInterval, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval) < (0)) __PYX_ERR(0, 31, __pyx_L1_error)
  __pyx_vtabptr_5HTSeq_6_HTSeq_GenomicPosition = &__pyx_vtable_5HTSeq_6_HTSeq_GenomicPosition;
  __pyx_vtable_5HTSeq_6_HTSeq_GenomicPosition.__pyx_base = *__pyx_vtabptr_5HTSeq_6_HTSeq_GenomicInterval;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_GenomicPosition_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition)) __PYX_ERR(0, 259, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_GenomicPosition_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition) < (0)) __PYX_ERR(0, 259, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition = &__pyx_type_5HTSeq_6_HTSeq_GenomicPosition;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition->tp_base = __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition) < (0)) __PYX_ERR(0, 259, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_vtabptr_5HTSeq_6_HTSeq_GenomicPosition) < (0)) __PYX_ERR(0, 259, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition) < (0)) __PYX_ERR(0, 259, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_GenomicPosition, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition) < (0)) __PYX_ERR(0, 259, __pyx_L1_error)
  __pyx_vtabptr_5HTSeq_6_HTSeq_Sequence = &__pyx_vtable_5HTSeq_6_HTSeq_Sequence;
  __pyx_vtable_5HTSeq_6_HTSeq_Sequence.get_reverse_complement = (struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement;
  __pyx_vtable_5HTSeq_6_HTSeq_Sequence.add_bases_to_count_array = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_8Sequence_add_bases_to_count_array;
  __pyx_vtable_5HTSeq_6_HTSeq_Sequence.trim_left_end = (struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_left_end *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_left_end;
  __pyx_vtable_5HTSeq_6_HTSeq_Sequence.trim_right_end = (struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_trim_right_end *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_8Sequence_trim_right_end;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_Sequence_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence)) __PYX_ERR(0, 1099, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_Sequence_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence) < (0)) __PYX_ERR(0, 1099, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence = &__pyx_type_5HTSeq_6_HTSeq_Sequence;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence) < (0)) __PYX_ERR(0, 1099, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __pyx_vtabptr_5HTSeq_6_HTSeq_Sequence) < (0)) __PYX_ERR(0, 1099, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence) < (0)) __PYX_ERR(0, 1099, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Sequence, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Sequence) < (0)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities = &__pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities;
  __pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.__pyx_base = *__pyx_vtabptr_5HTSeq_6_HTSeq_Sequence;
  __pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.__pyx_base.get_reverse_complement = (struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_8Sequence_get_reverse_complement *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement__pyx_wrap_1;
  __pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities._fill_qual_arr = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities__fill_qual_arr;
  __pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.add_qual_to_count_array = (PyObject *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_add_qual_to_count_array;
  __pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.trim_left_end_with_quals = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_left_end_with_quals;
  __pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.trim_right_end_with_quals = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, struct __pyx_obj_5HTSeq_6_HTSeq_Sequence *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_trim_right_end_with_quals;
  __pyx_vtable_5HTSeq_6_HTSeq_SequenceWithQualities.get_reverse_complement = (struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *(*)(struct __pyx_obj_5HTSeq_6_HTSeq_SequenceWithQualities *, int __pyx_skip_dispatch, struct __pyx_opt_args_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement *__pyx_optional_args))__pyx_f_5HTSeq_6_HTSeq_21SequenceWithQualities_get_reverse_complement;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities)) __PYX_ERR(0, 1248, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities) < (0)) __PYX_ERR(0, 1248, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities = &__pyx_type_5HTSeq_6_HTSeq_SequenceWithQualities;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities->tp_base = __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities) < (0)) __PYX_ERR(0, 1248, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1248, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_5HTSeq_6_HTSeq_21SequenceWithQualities___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5HTSeq_6_HTSeq_21SequenceWithQualities___init__.doc = __pyx_doc_5HTSeq_6_HTSeq_21SequenceWithQualities___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5HTSeq_6_HTSeq_21SequenceWithQualities___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_vtabptr_5HTSeq_6_HTSeq_SequenceWithQualities) < (0)) __PYX_ERR(0, 1248, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities) < (0)) __PYX_ERR(0, 1248, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SequenceWithQualities, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities) < (0)) __PYX_ERR(0, 1248, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_Alignment_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment)) __PYX_ERR(0, 1590, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_Alignment_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment) < (0)) __PYX_ERR(0, 1590, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment = &__pyx_type_5HTSeq_6_HTSeq_Alignment;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment) < (0)) __PYX_ERR(0, 1590, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Alignment, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment) < (0)) __PYX_ERR(0, 1590, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_Alignment) < (0)) __PYX_ERR(0, 1590, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Alignment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal)) __PYX_ERR(0, 1633, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) < (0)) __PYX_ERR(0, 1633, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal = &__pyx_type_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal->tp_base = __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Alignment;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) < (0)) __PYX_ERR(0, 1633, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_AlignmentWithSequenceReversal, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) < (0)) __PYX_ERR(0, 1633, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal) < (0)) __PYX_ERR(0, 1633, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment)) __PYX_ERR(0, 1708, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment) < (0)) __PYX_ERR(0, 1708, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment = &__pyx_type_5HTSeq_6_HTSeq_SAM_Alignment;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment->tp_base = __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment) < (0)) __PYX_ERR(0, 1708, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SAM_Alignment, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment) < (0)) __PYX_ERR(0, 1708, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment) < (0)) __PYX_ERR(0, 1708, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_ChromVector_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector)) __PYX_ERR(0, 310, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_ChromVector_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector) < (0)) __PYX_ERR(0, 310, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector = &__pyx_type_5HTSeq_6_HTSeq_ChromVector;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector) < (0)) __PYX_ERR(0, 310, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 310, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_5HTSeq_6_HTSeq_11ChromVector_6__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5HTSeq_6_HTSeq_11ChromVector_6__getitem__.doc = __pyx_doc_5HTSeq_6_HTSeq_11ChromVector_6__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5HTSeq_6_HTSeq_11ChromVector_6__getitem__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ChromVector, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector) < (0)) __PYX_ERR(0, 310, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_GenomicArray_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray)) __PYX_ERR(0, 598, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_GenomicArray_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray) < (0)) __PYX_ERR(0, 598, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray = &__pyx_type_5HTSeq_6_HTSeq_GenomicArray;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray) < (0)) __PYX_ERR(0, 598, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 598, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_5HTSeq_6_HTSeq_12GenomicArray___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5HTSeq_6_HTSeq_12GenomicArray___init__.doc = __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5HTSeq_6_HTSeq_12GenomicArray___init__;
    }
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, "__contains__"); if (unlikely(!wrapper)) __PYX_ERR(0, 598, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_5HTSeq_6_HTSeq_12GenomicArray_10__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5HTSeq_6_HTSeq_12GenomicArray_10__contains__.doc = __pyx_doc_5HTSeq_6_HTSeq_12GenomicArray_10__contains__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5HTSeq_6_HTSeq_12GenomicArray_10__contains__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_GenomicArray, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray) < (0)) __PYX_ERR(0, 598, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_CigarOperation_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation)) __PYX_ERR(0, 1486, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_CigarOperation_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation) < (0)) __PYX_ERR(0, 1486, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation = &__pyx_type_5HTSeq_6_HTSeq_CigarOperation;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation) < (0)) __PYX_ERR(0, 1486, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CigarOperation, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation) < (0)) __PYX_ERR(0, 1486, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation) < (0)) __PYX_ERR(0, 1486, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment)) __PYX_ERR(0, 1662, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment_spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment) < (0)) __PYX_ERR(0, 1662, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment = &__pyx_type_5HTSeq_6_HTSeq_BowtieAlignment;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment->tp_base = __pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment) < (0)) __PYX_ERR(0, 1662, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_BowtieAlignment, (PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment) < (0)) __PYX_ERR(0, 1662, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment) < (0)) __PYX_ERR(0, 1662, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__)) __PYX_ERR(0, 552, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd___spec, __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__) < (0)) __PYX_ERR(0, 552, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__ = &__pyx_type_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__) < (0)) __PYX_ERR(0, 552, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__->tp_dictoffset && __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_5HTSeq_6_HTSeq___pyx_scope_struct____iadd__->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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(4, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_2_4(__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_4(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 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_4(__pyx_t_1, "numpy", "dtype",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArray_Descr),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArray_Descr),
  #else
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArray_Descr),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 229, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "flatiter",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayIterObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayIterObject),
  #else
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayIterObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 274, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "broadcast",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayMultiIterObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayMultiIterObject),
  #else
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayMultiIterObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 278, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "ndarray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayObject),
  #else
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 317, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "generic",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(1, 826, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "number",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(1, 828, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "integer",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(1, 830, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "signedinteger",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 832, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "unsignedinteger",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 834, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "inexact",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 836, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "floating",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(1, 838, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "complexfloating",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 840, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "flexible",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 842, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "character",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(1, 844, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "ufunc",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyUFuncObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyUFuncObject),
  #else
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyUFuncObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_2_4); 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__HTSeq(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec__HTSeq},
  #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,
      "_HTSeq",
      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__HTSeq(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__HTSeq(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__HTSeq(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;
  Py_ssize_t __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)(PyObject *);
  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 '_HTSeq' 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 "_HTSeq" 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__HTSeq", 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_HTSeq___HTSeq) {
    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, "HTSeq._HTSeq")) {
      if (unlikely((PyDict_SetItemString(modules, "HTSeq._HTSeq", __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 ---*/

  /* "HTSeq/_HTSeq.pyx":1
 * import sys             # <<<<<<<<<<<<<<
 * import os
 * import math
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __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, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":2
 * import sys
 * import os             # <<<<<<<<<<<<<<
 * import math
 * import re
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_os, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __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, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":3
 * import sys
 * import os
 * import math             # <<<<<<<<<<<<<<
 * import re
 * import csv
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_math, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __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_math, __pyx_t_2) < (0)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":4
 * import os
 * import math
 * import re             # <<<<<<<<<<<<<<
 * import csv
 * import gzip
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_re, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __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_re, __pyx_t_2) < (0)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":5
 * import math
 * import re
 * import csv             # <<<<<<<<<<<<<<
 * import gzip
 * import itertools
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_csv, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __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_csv, __pyx_t_2) < (0)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":6
 * import re
 * import csv
 * import gzip             # <<<<<<<<<<<<<<
 * import itertools
 * import collections
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gzip, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __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, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":7
 * import csv
 * import gzip
 * import itertools             # <<<<<<<<<<<<<<
 * import collections
 * try:
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_itertools, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __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_itertools, __pyx_t_2) < (0)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":8
 * import gzip
 * import itertools
 * import collections             # <<<<<<<<<<<<<<
 * try:
 *     import cStringIO
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_collections, __pyx_t_2) < (0)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":9
 * import itertools
 * import collections
 * try:             # <<<<<<<<<<<<<<
 *     import cStringIO
 * except:
*/
  {
    __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:*/ {

      /* "HTSeq/_HTSeq.pyx":10
 * import collections
 * try:
 *     import cStringIO             # <<<<<<<<<<<<<<
 * except:
 *     pass
*/
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_cStringIO, 0, 0, NULL, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 10, __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_cStringIO, __pyx_t_2) < (0)) __PYX_ERR(0, 10, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "HTSeq/_HTSeq.pyx":9
 * import itertools
 * import collections
 * try:             # <<<<<<<<<<<<<<
 *     import cStringIO
 * except:
*/
    }
    __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;

    /* "HTSeq/_HTSeq.pyx":11
 * try:
 *     import cStringIO
 * except:             # <<<<<<<<<<<<<<
 *     pass
 * import warnings
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L3_exception_handled;
    }
    __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:;
  }

  /* "HTSeq/_HTSeq.pyx":13
 * except:
 *     pass
 * import warnings             # <<<<<<<<<<<<<<
 * import numpy
 * cimport numpy
*/
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_warnings, 0, 0, NULL, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_4;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_warnings, __pyx_t_2) < (0)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":14
 *     pass
 * import warnings
 * import numpy             # <<<<<<<<<<<<<<
 * cimport numpy
 * 
*/
  __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 14, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_4;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_numpy, __pyx_t_2) < (0)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":17
 * cimport numpy
 * 
 * from HTSeq import StepVector             # <<<<<<<<<<<<<<
 * from HTSeq.StretchVector import StretchVector
 * from HTSeq import _HTSeq_internal
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_StepVector};
    __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_HTSeq, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_4;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_StepVector};
    __pyx_t_6 = 0; {
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_6]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 17, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_6], __pyx_t_7) < (0)) __PYX_ERR(0, 17, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":18
 * 
 * from HTSeq import StepVector
 * from HTSeq.StretchVector import StretchVector             # <<<<<<<<<<<<<<
 * from HTSeq import _HTSeq_internal
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_StretchVector};
    __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_HTSeq_StretchVector, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_4;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_StretchVector};
    __pyx_t_6 = 0; {
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_6]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 18, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_6], __pyx_t_7) < (0)) __PYX_ERR(0, 18, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":19
 * from HTSeq import StepVector
 * from HTSeq.StretchVector import StretchVector
 * from HTSeq import _HTSeq_internal             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_HTSeq_internal};
    __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_HTSeq, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 19, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_4;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_HTSeq_internal};
    __pyx_t_6 = 0; {
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_6]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_6], __pyx_t_7) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":26
 * ###########################
 * 
 * cdef str strand_plus = intern("+")             # <<<<<<<<<<<<<<
 * cdef str strand_minus = intern("-")
 * cdef str strand_nostrand = intern(".")
*/
  __pyx_t_2 = __Pyx_Intern(__pyx_mstate_global->__pyx_kp_u__17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_5HTSeq_6_HTSeq_strand_plus);
  __Pyx_DECREF_SET(__pyx_v_5HTSeq_6_HTSeq_strand_plus, ((PyObject*)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":27
 * 
 * cdef str strand_plus = intern("+")
 * cdef str strand_minus = intern("-")             # <<<<<<<<<<<<<<
 * cdef str strand_nostrand = intern(".")
 * 
*/
  __pyx_t_2 = __Pyx_Intern(__pyx_mstate_global->__pyx_kp_u__18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_5HTSeq_6_HTSeq_strand_minus);
  __Pyx_DECREF_SET(__pyx_v_5HTSeq_6_HTSeq_strand_minus, ((PyObject*)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":28
 * cdef str strand_plus = intern("+")
 * cdef str strand_minus = intern("-")
 * cdef str strand_nostrand = intern(".")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = __Pyx_Intern(__pyx_mstate_global->__pyx_kp_u__8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __Pyx_DECREF_SET(__pyx_v_5HTSeq_6_HTSeq_strand_nostrand, ((PyObject*)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":55
 * 
 *     def __init__(GenomicInterval self, str chrom, long start, long end,
 *                  str strand=strand_nostrand):             # <<<<<<<<<<<<<<
 *         """See the class docstring for the meaning of the slots. Note that
 *         there is also a factory function, 'from_directional', to be used if
*/
  __Pyx_INCREF(__pyx_v_5HTSeq_6_HTSeq_strand_nostrand);
  __pyx_mstate_global->__pyx_k_ = __pyx_v_5HTSeq_6_HTSeq_strand_nostrand;
  __Pyx_GIVEREF(__pyx_v_5HTSeq_6_HTSeq_strand_nostrand);

  /* "HTSeq/_HTSeq.pyx":78
 *             return self._strand
 * 
 *     def __reduce__(GenomicInterval self):             # <<<<<<<<<<<<<<
 *         return GenomicInterval, (self.chrom, self.start, self.end,
 *                                  self.strand)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_3__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicInterval___reduce, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_2) < (0)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":82
 *                                  self.strand)
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
 *         constr, args = self.__reduce__()
 *         return constr(*args)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_5__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicInterval___copy, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_mstate_global->__pyx_n_u_copy_2, __pyx_t_2) < (0)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":169
 *         return hash((self.chrom, self.start, self.end, self.strand))
 * 
 *     cpdef is_contained_in(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Returns a boolean value indicating whether the 'self' interval
 *         is fully within the 'iv' interval.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_15is_contained_in, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicInterval_is_contained_in, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_mstate_global->__pyx_n_u_is_contained_in, __pyx_t_2) < (0)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":191
 *         return True
 * 
 *     cpdef contains(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Returns a boolean value indicating whether the 'self' interval
 *         fully contains the 'iv' interval.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_17contains, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicInterval_contains, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_mstate_global->__pyx_n_u_contains, __pyx_t_2) < (0)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":201
 *         return iv.is_contained_in(self)
 * 
 *     cpdef overlaps(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Returns a boolean value indicating whether the 'self' interval
 *         overlaps the 'iv' interval.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_19overlaps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicInterval_overlaps, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_mstate_global->__pyx_n_u_overlaps, __pyx_t_2) < (0)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":223
 *             return iv.end > self.start
 * 
 *     def range(GenomicInterval self, long int step=1):             # <<<<<<<<<<<<<<
 *         """Generate an iterator over the GenomicPositions covered by the interval,
 *         running from start to end.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_21range, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicInterval_range_2, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_mstate_global->__pyx_n_u_range, __pyx_t_2) < (0)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":229
 *         return _HTSeq_internal.GenomicInterval_range(self, step)
 * 
 *     def range_d(GenomicInterval self, long int step=1):             # <<<<<<<<<<<<<<
 *         """Generate an iterator over the GenomicPositions covered by the interval.
 *         running from start_d to end_d.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_23range_d, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicInterval_range_d, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_mstate_global->__pyx_n_u_range_d, __pyx_t_2) < (0)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":235
 *         return _HTSeq_internal.GenomicInterval_ranged(self, step)
 * 
 *     cpdef extend_to_include(GenomicInterval self, GenomicInterval iv):             # <<<<<<<<<<<<<<
 *         """Extend the interval such that it includes iv."""
 *         if iv is None:
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_25extend_to_include, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicInterval_extend_to_includ, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_mstate_global->__pyx_n_u_extend_to_include, __pyx_t_2) < (0)) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":247
 *         self.end = max(self.end, iv.end)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         return GenomicInterval(self.chrom, self.start, self.end, self.strand)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicInterval_27copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicInterval_copy, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicInterval, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_2) < (0)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":251
 * 
 * 
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):             # <<<<<<<<<<<<<<
 *     strand = intern(strand)
 *     if strand != strand_minus:
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_1GenomicInterval_from_directional, 0, __pyx_mstate_global->__pyx_n_u_GenomicInterval_from_directional, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[5]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_GenomicInterval_from_directional, __pyx_t_2) < (0)) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":303
 *         return "%s:%d/%s" % (self.chrom, self.pos, self.strand)
 * 
 *     def __reduce__(GenomicPosition self):             # <<<<<<<<<<<<<<
 *         return GenomicPosition, (self.chrom, self.pos, self.strand)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicPosition_7__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicPosition___reduce, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_2) < (0)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":306
 *         return GenomicPosition, (self.chrom, self.pos, self.strand)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         return GenomicPosition(self.chrom, self.pos, self.strand)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15GenomicPosition_9copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicPosition_copy, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicPosition, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_2) < (0)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":327
 *     cdef public str memmap_dir
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):
 *         """Create ChromVector from GenomicInterval
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_1create, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ChromVector_create, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[6]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_2) < (0)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_7) < (0)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":393
 *         return ncv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _create_view(cls, ChromVector vec, GenomicInterval iv):
 *         if iv.length == 0:
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_3_create_view, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ChromVector__create_view, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_create_view, __pyx_t_7) < (0)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_create_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_create_view, __pyx_t_2) < (0)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":405
 *         return v
 * 
 *     def extend_to_include(self, iv):             # <<<<<<<<<<<<<<
 *         if iv.strand != self.iv.strand:
 *             raise ValueError(
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_5extend_to_include, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ChromVector_extend_to_include, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_extend_to_include, __pyx_t_2) < (0)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":568
 *         return self.values()
 * 
 *     def values(self):             # <<<<<<<<<<<<<<
 *         return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_15values, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ChromVector_values, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_values, __pyx_t_2) < (0)) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":571
 *         return iter(self.array[self.iv.start - self.offset: self.iv.end - self.offset])
 * 
 *     def steps(self):             # <<<<<<<<<<<<<<
 *         return _HTSeq_internal.ChromVector_steps(self)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_17steps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ChromVector_steps_2, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_steps, __pyx_t_2) < (0)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":574
 *         return _HTSeq_internal.ChromVector_steps(self)
 * 
 *     def apply(self, fun):             # <<<<<<<<<<<<<<
 *         for iv, value in self.steps():
 *             self.array[iv.start - self.offset: iv.end -
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_19apply, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ChromVector_apply, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_apply, __pyx_t_2) < (0)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":582
 *         return "<%s object, %s, %s>" % (self.__class__.__name__, str(self.iv), self._storage)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         assert self.__class__ is ChromVector
 *         return(_ChromVector_unpickle,
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_11ChromVector_23__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ChromVector___reduce, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_ChromVector, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_2) < (0)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":588
 * 
 * 
 * def _ChromVector_unpickle(array, iv, offset, is_vector_of_sets, _storage):             # <<<<<<<<<<<<<<
 *     cv = ChromVector()
 *     cv.array = array
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_3_ChromVector_unpickle, 0, __pyx_mstate_global->__pyx_n_u_ChromVector_unpickle, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ChromVector_unpickle, __pyx_t_2) < (0)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":767
 *             raise TypeError("Illegal index type.")
 * 
 *     def add_chrom(self, chrom, length=sys.maxsize, start_index=0):             # <<<<<<<<<<<<<<
 *         cdef GenomicInterval iv
 *         if length == sys.maxsize:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__16 = __pyx_t_7;
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_Pack(2, __pyx_t_2, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_7add_chrom, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicArray_add_chrom, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_add_chrom, __pyx_t_2) < (0)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":790
 *                                                      self.memmap_dir)}
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (_GenomicArray_unpickle, (self.stranded, self.typecode, self.chrom_vectors))
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_9__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicArray___reduce, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_2) < (0)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":800
 *         raise NotImplementedError
 * 
 *     def write_bedgraph_file(             # <<<<<<<<<<<<<<
 *             self,
 *             file_or_filename,
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_13write_bedgraph_file, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicArray_write_bedgraph_file, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[7]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_write_bedgraph_file, __pyx_t_2) < (0)) __PYX_ERR(0, 800, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":860
 *                 f.close()
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_bedgraph_file(cls, file_or_filename, strand=".", typecode="d"):
 *         '''Create GenomicArray from BedGraph file
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_15from_bedgraph_file, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicArray_from_bedgraph_file, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[8]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_from_bedgraph_file, __pyx_t_2) < (0)) __PYX_ERR(0, 860, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_from_bedgraph_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_from_bedgraph_file, __pyx_t_7) < (0)) __PYX_ERR(0, 860, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":924
 *         return array
 * 
 *     def write_bigwig_file(             # <<<<<<<<<<<<<<
 *             self,
 *             filename,
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_17write_bigwig_file, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicArray_write_bigwig_file, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_write_bigwig_file, __pyx_t_7) < (0)) __PYX_ERR(0, 924, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "HTSeq/_HTSeq.pyx":1003
 *             write_with_buffer(bw, entries, bufsize=1)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_bigwig_file(cls, filename, strand=".", typecode="d"):
 *         '''Create GenomicArray from BigWig file
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_19from_bigwig_file, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicArray_from_bigwig_file, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[8]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_from_bigwig_file, __pyx_t_7) < (0)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_from_bigwig_file); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_from_bigwig_file, __pyx_t_2) < (0)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1058
 *         return array
 * 
 *     def steps(self):             # <<<<<<<<<<<<<<
 *         '''Get the steps, independent of storage method
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_12GenomicArray_21steps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GenomicArray_steps_2, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_GenomicArray, __pyx_mstate_global->__pyx_n_u_steps, __pyx_t_2) < (0)) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1071
 * 
 * 
 * def _GenomicArray_unpickle(stranded, typecode, chrom_vectors):             # <<<<<<<<<<<<<<
 *     ga = GenomicArray({}, stranded, typecode)
 *     ga.chrom_vectors = chrom_vectors
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_5_GenomicArray_unpickle, 0, __pyx_mstate_global->__pyx_n_u_GenomicArray_unpickle, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_GenomicArray_unpickle, __pyx_t_2) < (0)) __PYX_ERR(0, 1071, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1082
 * 
 * 
 * def _make_translation_table_for_complementation():             # <<<<<<<<<<<<<<
 *     return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_7_make_translation_table_for_complementation, 0, __pyx_mstate_global->__pyx_n_u_make_translation_table_for_comp, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_make_translation_table_for_comp, __pyx_t_2) < (0)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1086
 * 
 * 
 * cdef bytes _translation_table_for_complementation = _make_translation_table_for_complementation()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_make_translation_table_for_comp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1086, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(0, 1086, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation);
  __Pyx_DECREF_SET(__pyx_v_5HTSeq_6_HTSeq__translation_table_for_complementation, ((PyObject*)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1089
 * 
 * 
 * cpdef bytes reverse_complement(bytes seq):             # <<<<<<<<<<<<<<
 *     """Returns the reverse complement of DNA sequence 'seq'. Does not yet
 *     work with extended IUPAC nucleotide letters or RNA."""
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_9reverse_complement, 0, __pyx_mstate_global->__pyx_n_u_reverse_complement, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reverse_complement, __pyx_t_2) < (0)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1096
 * 
 * 
 * base_to_column = {'A': 0, 'C': 1, 'G': 2, 'T': 3, 'N': 4}             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_A, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 1096, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_C, __pyx_mstate_global->__pyx_int_1) < (0)) __PYX_ERR(0, 1096, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_G, __pyx_mstate_global->__pyx_int_2) < (0)) __PYX_ERR(0, 1096, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_T, __pyx_mstate_global->__pyx_int_3) < (0)) __PYX_ERR(0, 1096, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_N, __pyx_mstate_global->__pyx_int_4) < (0)) __PYX_ERR(0, 1096, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_base_to_column, __pyx_t_2) < (0)) __PYX_ERR(0, 1096, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1107
 *         self.descr = None
 * 
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):             # <<<<<<<<<<<<<<
 *         if rename:
 *             return Sequence(
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_8Sequence_3get_reverse_complement, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sequence_get_reverse_complement, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[9]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __pyx_mstate_global->__pyx_n_u_get_reverse_complement, __pyx_t_2) < (0)) __PYX_ERR(0, 1107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1134
 *         return Sequence(self.seq[item], new_name)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {'seq': self.seq,
 *                 'name': self.name,
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_8Sequence_13__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sequence___getstate, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __pyx_mstate_global->__pyx_n_u_getstate, __pyx_t_2) < (0)) __PYX_ERR(0, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1139
 *                 'descr': self.descr}
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.seq = state['seq']
 *         self.name = state['name']
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_8Sequence_15__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sequence___setstate, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __pyx_mstate_global->__pyx_n_u_setstate, __pyx_t_2) < (0)) __PYX_ERR(0, 1139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1144
 *         self.descr = state['descr']
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (self.__class__, (self.seq, self.name), self.__getstate__())
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_8Sequence_17__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sequence___reduce, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_2) < (0)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1147
 *         return (self.__class__, (self.seq, self.name), self.__getstate__())
 * 
 *     def write_to_fasta_file(self, fasta_file, characters_per_line=70):             # <<<<<<<<<<<<<<
 *         """Write sequence to file in FASTA format.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_8Sequence_19write_to_fasta_file, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sequence_write_to_fasta_file, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[10]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __pyx_mstate_global->__pyx_n_u_write_to_fasta_file, __pyx_t_2) < (0)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1169
 *                 i += 1
 * 
 *     cpdef object add_bases_to_count_array(Sequence self, numpy.ndarray count_array_):             # <<<<<<<<<<<<<<
 * 
 *         cdef numpy.ndarray[numpy.int64_t, ndim = 2] count_array = count_array_
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_8Sequence_21add_bases_to_count_array, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sequence_add_bases_to_count_arra, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __pyx_mstate_global->__pyx_n_u_add_bases_to_count_array, __pyx_t_2) < (0)) __PYX_ERR(0, 1169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1199
 *         return None
 * 
 *     cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.):             # <<<<<<<<<<<<<<
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_8Sequence_23trim_left_end, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sequence_trim_left_end, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[11]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __pyx_mstate_global->__pyx_n_u_trim_left_end, __pyx_t_2) < (0)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1223
 *         return self[match: seqlen]
 * 
 *     cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.):             # <<<<<<<<<<<<<<
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_8Sequence_25trim_right_end, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sequence_trim_right_end, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[12]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Sequence, __pyx_mstate_global->__pyx_n_u_trim_right_end, __pyx_t_2) < (0)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1351
 *         return self._qualstr_phred
 * 
 *     def write_to_fastq_file(self, fastq_file):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "descr") and self.descr is not None:
 *             fastq_file.write("@%s %s\n" % (self.name, self.descr))
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_21SequenceWithQualities_7write_to_fastq_file, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SequenceWithQualities_write_to_f, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_mstate_global->__pyx_n_u_write_to_fastq_file, __pyx_t_2) < (0)) __PYX_ERR(0, 1351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1360
 *         fastq_file.write(self.qualstr.decode() + "\n")
 * 
 *     def get_fastq_str(self, bint convert_to_phred=False):             # <<<<<<<<<<<<<<
 *         sio = cStringIO.StringIO()
 *         self.write_to_fastq_file(sio, convert_to_phred)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_21SequenceWithQualities_9get_fastq_str, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SequenceWithQualities_get_fastq, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[13]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_mstate_global->__pyx_n_u_get_fastq_str, __pyx_t_2) < (0)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1365
 *         return sio.getvalue()
 * 
 *     cpdef SequenceWithQualities get_reverse_complement(self, bint rename=True):             # <<<<<<<<<<<<<<
 *         cdef SequenceWithQualities res
 *         if rename:
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_21SequenceWithQualities_11get_reverse_complement, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SequenceWithQualities_get_revers, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[9]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_mstate_global->__pyx_n_u_get_reverse_complement, __pyx_t_2) < (0)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1383
 *         return res
 * 
 *     cpdef object add_qual_to_count_array(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *                                          numpy.ndarray count_array_):
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_21SequenceWithQualities_13add_qual_to_count_array, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SequenceWithQualities_add_qual_t, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_mstate_global->__pyx_n_u_add_qual_to_count_array, __pyx_t_2) < (0)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1407
 *         return None
 * 
 *     cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *                                                          Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_21SequenceWithQualities_15trim_left_end_with_quals, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SequenceWithQualities_trim_left, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[14]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_mstate_global->__pyx_n_u_trim_left_end_with_quals, __pyx_t_2) < (0)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1435
 *         return self[match: seqlen]
 * 
 *     cpdef SequenceWithQualities trim_right_end_with_quals(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *                                                           Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_21SequenceWithQualities_17trim_right_end_with_quals, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SequenceWithQualities_trim_right, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[14]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SequenceWithQualities, __pyx_mstate_global->__pyx_n_u_trim_right_end_with_quals, __pyx_t_2) < (0)) __PYX_ERR(0, 1435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1467
 * # CIGAR codes (SAM format)
 * ###########################
 * _re_cigar_codes = re.compile('([MIDNSHP=X])')             # <<<<<<<<<<<<<<
 * 
 * cigar_operation_names = {
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_MIDNSHP_X};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __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;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_re_cigar_codes, __pyx_t_2) < (0)) __PYX_ERR(0, 1467, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1470
 * 
 * cigar_operation_names = {
 *     'M': 'matched',             # <<<<<<<<<<<<<<
 *     'I': 'inserted',
 *     'D': 'deleted',
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_M, __pyx_mstate_global->__pyx_n_u_matched) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_n_u_inserted) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_D, __pyx_mstate_global->__pyx_n_u_deleted) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_N, __pyx_mstate_global->__pyx_n_u_skipped) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_S, __pyx_mstate_global->__pyx_kp_u_soft_clipped) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_H, __pyx_mstate_global->__pyx_kp_u_hard_clipped) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_P, __pyx_mstate_global->__pyx_n_u_padded) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__29, __pyx_mstate_global->__pyx_kp_u_sequence_matched) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_X, __pyx_mstate_global->__pyx_kp_u_sequence_mismatched) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cigar_operation_names, __pyx_t_2) < (0)) __PYX_ERR(0, 1469, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1481
 * 
 * 
 * cigar_operation_codes = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X']             # <<<<<<<<<<<<<<
 * cigar_operation_code_dict = dict(
 *     [(x, i) for i, x in enumerate(cigar_operation_codes)])
*/
  __pyx_t_2 = __Pyx_PyList_Pack(9, __pyx_mstate_global->__pyx_n_u_M, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_n_u_D, __pyx_mstate_global->__pyx_n_u_N, __pyx_mstate_global->__pyx_n_u_S, __pyx_mstate_global->__pyx_n_u_H, __pyx_mstate_global->__pyx_n_u_P, __pyx_mstate_global->__pyx_kp_u__29, __pyx_mstate_global->__pyx_n_u_X); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cigar_operation_codes, __pyx_t_2) < (0)) __PYX_ERR(0, 1481, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1482
 * 
 * cigar_operation_codes = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X']
 * cigar_operation_code_dict = dict(             # <<<<<<<<<<<<<<
 *     [(x, i) for i, x in enumerate(cigar_operation_codes)])
 * 
*/
  __pyx_t_10 = NULL;
  { /* enter inner scope */

    /* "HTSeq/_HTSeq.pyx":1483
 * cigar_operation_codes = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X']
 * cigar_operation_code_dict = dict(
 *     [(x, i) for i, x in enumerate(cigar_operation_codes)])             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1483, __pyx_L12_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_7 = __pyx_mstate_global->__pyx_int_0;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_cigar_operation_codes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1483, __pyx_L12_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
      __pyx_t_12 = __pyx_t_11; __Pyx_INCREF(__pyx_t_12);
      __pyx_t_6 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1483, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1483, __pyx_L12_error)
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_12))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1483, __pyx_L12_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_11 = __Pyx_PyList_GetItemRefFast(__pyx_t_12, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1483, __pyx_L12_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_11 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_6));
          #else
          __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1483, __pyx_L12_error)
      } else {
        __pyx_t_11 = __pyx_t_13(__pyx_t_12);
        if (unlikely(!__pyx_t_11)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1483, __pyx_L12_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
      __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
      __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyLong_AddObjC(__pyx_t_7, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1483, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7);
      __pyx_t_7 = __pyx_t_11;
      __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1483, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
      __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x) != (0)) __PYX_ERR(0, 1483, __pyx_L12_error);
      __Pyx_INCREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
      __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i) != (0)) __PYX_ERR(0, 1483, __pyx_L12_error);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1483, __pyx_L12_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
    __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i, Py_None);
    __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
    __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x, Py_None);
    goto __pyx_L16_exit_scope;
    __pyx_L12_error:;
    __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i);
    __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_i, Py_None);
    __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x);
    __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5HTSeq_6_HTSeq_x, Py_None);
    goto __pyx_L1_error;
    __pyx_L16_exit_scope:;
  } /* exit inner scope */
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyDict_Type), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cigar_operation_code_dict, __pyx_t_2) < (0)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1509
 *             str(self.ref_iv), self.query_from, self.query_to)
 * 
 *     def check(CigarOperation self):             # <<<<<<<<<<<<<<
 *         cdef int qlen = self.query_to - self.query_from
 *         cdef int rlen = self.ref_iv.length
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_14CigarOperation_5check, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CigarOperation_check, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation, __pyx_mstate_global->__pyx_n_u_check, __pyx_t_2) < (0)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_14CigarOperation_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CigarOperation___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CigarOperation, (type(self), 0xf82f777, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CigarOperation__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_14CigarOperation_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CigarOperation___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_CigarOperation, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(3, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1529
 * 
 * 
 * cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."):             # <<<<<<<<<<<<<<
 *     cdef list split_cigar, cl
 *     cdef int size
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_11parse_cigar, 0, __pyx_mstate_global->__pyx_n_u_parse_cigar, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[15]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parse_cigar, __pyx_t_2) < (0)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1547
 * 
 * 
 * cpdef list build_cigar_list(list cigar_pairs, int ref_left=0, str chrom="", str strand="."):             # <<<<<<<<<<<<<<
 *     cdef list split_cigar, res
 *     cdef int rpos, qpos, size
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13build_cigar_list, 0, __pyx_mstate_global->__pyx_n_u_build_cigar_list, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[15]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_build_cigar_list, __pyx_t_2) < (0)) __PYX_ERR(0, 1547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_9Alignment_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Alignment___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Alignment, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Alignment, (type(self), 0x0162061, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Alignment__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_9Alignment_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Alignment___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_Alignment, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(3, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AlignmentWithSequenceReversal_2, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_AlignmentWithSequenceReversal, (type(self), 0xeadbf25, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_AlignmentWithSequenceReversal__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_29AlignmentWithSequenceReversal_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AlignmentWithSequenceReversal_3, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_AlignmentWithSequenceReversal, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(3, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15BowtieAlignment_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BowtieAlignment___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_BowtieAlignment, (type(self), 0xe57e767, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_BowtieAlignment__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15BowtieAlignment_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BowtieAlignment___setstate_cytho, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_BowtieAlignment, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(3, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1717
 *     """
 * 
 *     def to_pysam_AlignedSegment(self, sf):             # <<<<<<<<<<<<<<
 *         try:
 *             import pysam
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_1to_pysam_AlignedSegment, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment_to_pysam_AlignedSe, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_to_pysam_AlignedSegment, __pyx_t_2) < (0)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1749
 *         return a
 * 
 *     def to_pysam_AlignedRead(self, sf):             # <<<<<<<<<<<<<<
 *         try:
 *             import pysam
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_3to_pysam_AlignedRead, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment_to_pysam_AlignedRe, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_to_pysam_AlignedRead, __pyx_t_2) < (0)) __PYX_ERR(0, 1749, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1781
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pysam_AlignedRead(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_5from_pysam_AlignedRead, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment_from_pysam_Aligned, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_from_pysam_AlignedRead, __pyx_t_2) < (0)) __PYX_ERR(0, 1781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_from_pysam_AlignedRead); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_from_pysam_AlignedRead, __pyx_t_8) < (0)) __PYX_ERR(0, 1781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1829
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pysam_AlignedSegment(cls, read, samfile):
 *         strand = "-" if read.is_reverse else "+"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_7from_pysam_AlignedSegment, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment_from_pysam_Aligned_2, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1829, __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_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_from_pysam_AlignedSegment, __pyx_t_8) < (0)) __PYX_ERR(0, 1829, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_from_pysam_AlignedSegment); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_from_pysam_AlignedSegment, __pyx_t_2) < (0)) __PYX_ERR(0, 1829, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "HTSeq/_HTSeq.pyx":1891
 *         return a
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_SAM_line(cls, line):
 *         cdef str qname, flag, rname, pos, mapq, cigar,
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_9from_SAM_line, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment_from_SAM_line, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_from_SAM_line, __pyx_t_2) < (0)) __PYX_ERR(0, 1891, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_from_SAM_line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_from_SAM_line, __pyx_t_8) < (0)) __PYX_ERR(0, 1891, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1994
 *         return self.mate_start is not None
 * 
 *     def get_sam_line(self):             # <<<<<<<<<<<<<<
 *         cdef str cigar = ""
 *         cdef GenomicInterval query_start, mate_start
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_11get_sam_line, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment_get_sam_line, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1994, __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_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_get_sam_line, __pyx_t_8) < (0)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":2029
 *                  '\t'.join(self.raw_optional_fields())))
 * 
 *     def has_optional_field(SAM_Alignment self, str tag):             # <<<<<<<<<<<<<<
 *         '''Check if this alignment has the specified optional field
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_13has_optional_field, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment_has_optional_field, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2029, __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_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_has_optional_field, __pyx_t_8) < (0)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":2041
 *         return False
 * 
 *     def optional_field(SAM_Alignment self, str tag):             # <<<<<<<<<<<<<<
 *         res = [p for p in self.optional_fields if p[0] == tag]
 *         if len(res) == 1:
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_15optional_field, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment_optional_field, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2041, __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_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_optional_field, __pyx_t_8) < (0)) __PYX_ERR(0, 2041, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":2051
 *                 raise ValueError("SAM optional field tag %s not unique" % tag)
 * 
 *     def raw_optional_fields(self):             # <<<<<<<<<<<<<<
 *         res = []
 *         for op in self.optional_fields:
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_17raw_optional_fields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment_raw_optional_field, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2051, __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_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_raw_optional_fields, __pyx_t_8) < (0)) __PYX_ERR(0, 2051, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 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 (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_8) < (0)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SAM_Alignment, (type(self), 0x096ac21, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SAM_Alignment__set_state(self, __pyx_state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_13SAM_Alignment_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SAM_Alignment___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 16, __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_5HTSeq_6_HTSeq_SAM_Alignment, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(3, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":2072
 * # Helpers
 * ###########################
 * cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'):             # <<<<<<<<<<<<<<
 *     cdef list l = []
 *     cdef int i = 0
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_15quotesafe_split, 0, __pyx_mstate_global->__pyx_n_u_quotesafe_split, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[16]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_quotesafe_split, __pyx_t_8) < (0)) __PYX_ERR(0, 2072, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CigarOperation(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xf82f777, 0x9723161, 0xb5bd29c, b'query_from, query_to, ref_iv, size, type')
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_17__pyx_unpickle_CigarOperation, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CigarOperation, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 4, __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_pyx_unpickle_CigarOperation, __pyx_t_8) < (0)) __PYX_ERR(3, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_19__pyx_unpickle_Alignment, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Alignment, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 4, __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_pyx_unpickle_Alignment, __pyx_t_8) < (0)) __PYX_ERR(3, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_AlignmentWithSequenceReversal(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xeadbf25, 0xe297712, 0x1b7eeff, b'_read, _read_as_sequenced, iv, read_as_aligned')
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_21__pyx_unpickle_AlignmentWithSequenceReversal, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_AlignmentWithSequ, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 4, __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_pyx_unpickle_AlignmentWithSequ, __pyx_t_8) < (0)) __PYX_ERR(3, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_23__pyx_unpickle_BowtieAlignment, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_BowtieAlignment, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 4, __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_pyx_unpickle_BowtieAlignment, __pyx_t_8) < (0)) __PYX_ERR(3, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_SAM_Alignment(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x096ac21, 0xd9f838f, 0xf6933f3, b'_flag, _read, _read_as_sequenced, aQual, cigar, failed_platform_qc, inferred_insert_size, iv, mate_start, not_primary_alignment, optional_fields, original_sam_line, pcr_or_optical_duplicate, pe_which, proper_pair, read_as_aligned, supplementary')
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5HTSeq_6_HTSeq_25__pyx_unpickle_SAM_Alignment, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_SAM_Alignment, NULL, __pyx_mstate_global->__pyx_n_u_HTSeq__HTSeq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 4, __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_pyx_unpickle_SAM_Alignment, __pyx_t_8) < (0)) __PYX_ERR(3, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "HTSeq/_HTSeq.pyx":1
 * import sys             # <<<<<<<<<<<<<<
 * import os
 * import math
*/
  __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);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init HTSeq._HTSeq", __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 HTSeq._HTSeq");
  }
  __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_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open); if (!__pyx_builtin_open) __PYX_ERR(0, 835, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1042, __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;
  __pyx_mstate->__pyx_umethod_PyUnicode_Type__upper.type = (PyObject*)(&PyUnicode_Type);
  __pyx_mstate->__pyx_umethod_PyUnicode_Type__upper.method_name = &__pyx_mstate->__pyx_n_u_upper;
  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);

  /* "HTSeq/_HTSeq.pyx":360
 *             else:
 *                 ncv.array = numpy.empty(shape=(iv.length,), dtype=typecode)
 *                 ncv.array[:] = None             # <<<<<<<<<<<<<<
 * 
 *         elif storage == "memmap":
*/
  __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);

  /* "HTSeq/_HTSeq.pyx":975
 *             bufsize = 1000
 * 
 *             def write_with_buffer(bw, entries, bufsize, newentry=None):             # <<<<<<<<<<<<<<
 *                 if newentry is not None:
 *                     for key in entries:
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "HTSeq/_HTSeq.pyx":962
 *             raise ValueError("Strand must be specified for stranded GenomicArray.")
 * 
 *         with pyBigWig.open(filename, "w") as bw:             # <<<<<<<<<<<<<<
 *             # Write header with chromosome info
 *             header = []
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "HTSeq/_HTSeq.pyx":1083
 * 
 * def _make_translation_table_for_complementation():
 *     return bytes.maketrans(b'ACGTacgt', b'TGCAtgca')             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_b_ACGTacgt, __pyx_mstate_global->__pyx_n_b_TGCAtgca); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "HTSeq/_HTSeq.pyx":1093
 *     work with extended IUPAC nucleotide letters or RNA."""
 * 
 *     return seq[::-1].translate(_translation_table_for_complementation)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_mstate_global->__pyx_slice[1] = PySlice_New(Py_None, Py_None, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);

  /* "HTSeq/_HTSeq.pyx":1905
 *             raise ValueError("SAM line does not contain at least 11 tab-delimited fields.")
 *         (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
 *          seq, qual) = fields[0:11]             # <<<<<<<<<<<<<<
 *         optional_fields = fields[11:]
 * 
*/
  __pyx_mstate_global->__pyx_slice[2] = PySlice_New(__pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_11, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[2])) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]);

  /* "HTSeq/_HTSeq.pyx":1906
 *         (qname, flag, rname, pos, mapq, cigar, mrnm, mpos, isize,
 *          seq, qual) = fields[0:11]
 *         optional_fields = fields[11:]             # <<<<<<<<<<<<<<
 * 
 *         if seq.count("=") > 0:
*/
  __pyx_mstate_global->__pyx_slice[3] = PySlice_New(__pyx_mstate_global->__pyx_int_11, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[3])) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]);

  /* "HTSeq/_HTSeq.pyx":1941
 *         alnmt.cigar = cigarlist
 *         alnmt.optional_fields = [
 *             (field[:2], _parse_SAM_optional_field_value(field)) for field in optional_fields]             # <<<<<<<<<<<<<<
 *         alnmt.aQual = int(mapq)
 *         alnmt.inferred_insert_size = int(isize)
*/
  __pyx_mstate_global->__pyx_slice[4] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_2, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[4])) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[4]);

  /* "HTSeq/_HTSeq.pyx":2002
 *             query_start = self.iv
 *         else:
 *             query_start = GenomicPosition("*", -1)             # <<<<<<<<<<<<<<
 * 
 *         if self.mate_start is not None:
*/
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__31, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 2002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "HTSeq/_HTSeq.pyx":223
 *             return iv.end > self.start
 * 
 *     def range(GenomicInterval self, long int step=1):             # <<<<<<<<<<<<<<
 *         """Generate an iterator over the GenomicPositions covered by the interval,
 *         running from start to end.
*/
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);

  /* "HTSeq/_HTSeq.pyx":251
 * 
 * 
 * def GenomicInterval_from_directional(str chrom, long int start_d, long int length, str strand="."):             # <<<<<<<<<<<<<<
 *     strand = intern(strand)
 *     if strand != strand_minus:
*/
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(1, ((PyObject*)__pyx_mstate_global->__pyx_kp_u__8)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);

  /* "HTSeq/_HTSeq.pyx":327
 *     cdef public str memmap_dir
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create(cls, GenomicInterval iv, str typecode, str storage, str memmap_dir=""):
 *         """Create ChromVector from GenomicInterval
*/
  __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u__12); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "HTSeq/_HTSeq.pyx":800
 *         raise NotImplementedError
 * 
 *     def write_bedgraph_file(             # <<<<<<<<<<<<<<
 *             self,
 *             file_or_filename,
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_kp_u__8, __pyx_mstate_global->__pyx_kp_u__12, __pyx_mstate_global->__pyx_kp_u__19); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);

  /* "HTSeq/_HTSeq.pyx":860
 *                 f.close()
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_bedgraph_file(cls, file_or_filename, strand=".", typecode="d"):
 *         '''Create GenomicArray from BedGraph file
*/
  __pyx_mstate_global->__pyx_tuple[8] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__8, __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(0, 860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);

  /* "HTSeq/_HTSeq.pyx":1107
 *         self.descr = None
 * 
 *     cpdef Sequence get_reverse_complement(self, bint rename=True):             # <<<<<<<<<<<<<<
 *         if rename:
 *             return Sequence(
*/
  __pyx_mstate_global->__pyx_tuple[9] = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(0, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]);

  /* "HTSeq/_HTSeq.pyx":1147
 *         return (self.__class__, (self.seq, self.name), self.__getstate__())
 * 
 *     def write_to_fasta_file(self, fasta_file, characters_per_line=70):             # <<<<<<<<<<<<<<
 *         """Write sequence to file in FASTA format.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[10] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_70); if (unlikely(!__pyx_mstate_global->__pyx_tuple[10])) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[10]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[10]);

  /* "HTSeq/_HTSeq.pyx":1199
 *         return None
 * 
 *     cpdef Sequence trim_left_end(Sequence self, Sequence pattern, float mismatch_prop=0.):             # <<<<<<<<<<<<<<
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)
*/
  __pyx_mstate_global->__pyx_tuple[11] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_float_0_); if (unlikely(!__pyx_mstate_global->__pyx_tuple[11])) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[11]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[11]);

  /* "HTSeq/_HTSeq.pyx":1223
 *         return self[match: seqlen]
 * 
 *     cpdef Sequence trim_right_end(Sequence self, Sequence pattern, float mismatch_prop=0.):             # <<<<<<<<<<<<<<
 *         cdef int seqlen = len(self.seq)
 *         cdef int patlen = len(pattern.seq)
*/
  __pyx_mstate_global->__pyx_tuple[12] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_float_0_); if (unlikely(!__pyx_mstate_global->__pyx_tuple[12])) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[12]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[12]);

  /* "HTSeq/_HTSeq.pyx":1360
 *         fastq_file.write(self.qualstr.decode() + "\n")
 * 
 *     def get_fastq_str(self, bint convert_to_phred=False):             # <<<<<<<<<<<<<<
 *         sio = cStringIO.StringIO()
 *         self.write_to_fastq_file(sio, convert_to_phred)
*/
  __pyx_mstate_global->__pyx_tuple[13] = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[13])) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[13]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[13]);

  /* "HTSeq/_HTSeq.pyx":1407
 *         return None
 * 
 *     cpdef SequenceWithQualities trim_left_end_with_quals(SequenceWithQualities self,             # <<<<<<<<<<<<<<
 *                                                          Sequence pattern, int max_mm_qual=5):
 *         cdef int seqlen = len(self.seq)
*/
  __pyx_mstate_global->__pyx_tuple[14] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_5); if (unlikely(!__pyx_mstate_global->__pyx_tuple[14])) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[14]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[14]);

  /* "HTSeq/_HTSeq.pyx":1529
 * 
 * 
 * cpdef list parse_cigar(str cigar_string, int ref_left=0, str chrom="", str strand="."):             # <<<<<<<<<<<<<<
 *     cdef list split_cigar, cl
 *     cdef int size
*/
  __pyx_mstate_global->__pyx_tuple[15] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_kp_u__12, __pyx_mstate_global->__pyx_kp_u__8); if (unlikely(!__pyx_mstate_global->__pyx_tuple[15])) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[15]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[15]);

  /* "HTSeq/_HTSeq.pyx":2072
 * # Helpers
 * ###########################
 * cpdef list quotesafe_split(bytes s, bytes split=b';', bytes quote=b'"'):             # <<<<<<<<<<<<<<
 *     cdef list l = []
 *     cdef int i = 0
*/
  __pyx_mstate_global->__pyx_tuple[16] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_b__32, __pyx_mstate_global->__pyx_kp_b__33); if (unlikely(!__pyx_mstate_global->__pyx_tuple[16])) __PYX_ERR(0, 2072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[16]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[16]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<17; ++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<5; ++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[] = {{88},{38},{42},{71},{67},{38},{25},{25},{32},{18},{19},{27},{21},{29},{86},{13},{35},{65},{66},{50},{4},{179},{15},{80},{51},{23},{22},{50},{59},{35},{36},{48},{58},{58},{35},{16},{31},{51},{44},{52},{36},{24},{36},{1},{1},{0},{2},{1},{1},{1},{1},{1},{1},{2},{2},{1},{1},{2},{2},{2},{3},{1},{4},{2},{1},{1},{1},{2},{2},{2},{1},{2},{8},{13},{37},{10},{9},{44},{34},{37},{7},{6},{2},{12},{49},{9},{10},{4},{15},{39},{34},{9},{9},{9},{11},{6},{61},{59},{12},{24},{4},{4},{48},{16},{19},{12},{10},{24},{20},{24},{15},{14},{11},{10},{14},{20},{19},{23},{15},{2},{1},{11},{14},{9},{29},{47},{49},{27},{29},{13},{15},{33},{35},{1},{11},{22},{24},{17},{18},{29},{17},{17},{21},{18},{14},{32},{34},{20},{1},{1},{12},{23},{22},{31},{29},{18},{18},{22},{32},{30},{15},{24},{26},{24},{20},{33},{32},{31},{24},{21},{21},{23},{22},{15},{26},{20},{1},{5},{19},{12},{15},{1},{3},{1},{1},{1},{1},{20},{4},{1},{13},{31},{33},{27},{36},{39},{26},{32},{28},{33},{34},{37},{8},{21},{45},{35},{44},{46},{47},{41},{21},{19},{21},{33},{31},{22},{23},{28},{10},{13},{8},{1},{1},{1},{1},{1},{3},{10},{9},{24},{9},{23},{6},{4},{7},{5},{6},{5},{4},{5},{18},{4},{14},{11},{7},{16},{2},{1},{9},{19},{5},{5},{10},{13},{6},{5},{25},{21},{21},{11},{12},{9},{11},{9},{17},{5},{18},{5},{3},{4},{11},{7},{6},{8},{16},{3},{4},{8},{12},{6},{12},{3},{2},{1},{6},{7},{5},{8},{5},{5},{5},{6},{3},{5},{4},{9},{7},{5},{9},{8},{17},{1},{10},{10},{5},{6},{16},{8},{5},{4},{7},{13},{18},{16},{22},{25},{3},{8},{2},{13},{22},{12},{8},{12},{6},{8},{4},{18},{6},{1},{8},{24},{5},{8},{8},{9},{15},{13},{12},{9},{14},{9},{8},{8},{10},{12},{16},{11},{17},{5},{5},{9},{2},{4},{3},{1},{6},{4},{5},{8},{43},{9},{15},{4},{7},{12},{15},{16},{10},{4},{11},{7},{6},{10},{13},{7},{4},{10},{4},{4},{8},{4},{3},{7},{7},{8},{17},{20},{4},{7},{14},{5},{6},{2},{4},{14},{15},{2},{8},{1},{6},{10},{11},{4},{7},{5},{3},{3},{6},{8},{5},{14},{12},{11},{10},{24},{44},{30},{29},{28},{14},{5},{4},{5},{3},{4},{12},{9},{7},{10},{15},{14},{11},{5},{15},{1},{5},{7},{3},{19},{2},{15},{4},{15},{10},{17},{13},{6},{8},{13},{12},{15},{6},{3},{11},{18},{5},{4},{5},{6},{3},{1},{7},{6},{4},{3},{9},{3},{12},{10},{12},{19},{2},{5},{3},{4},{7},{6},{5},{5},{7},{11},{9},{10},{5},{6},{4},{5},{4},{7},{8},{6},{8},{7},{3},{3},{3},{4},{2},{15},{8},{3},{20},{23},{13},{9},{13},{24},{14},{25},{5},{4},{8},{5},{7},{7},{6},{5},{12},{1},{5},{6},{3},{1},{8},{5},{19},{17},{44},{19},{19},{17},{1},{1},{5},{0},{1},{1},{1},{206},{11},{11},{21},{35},{19},{21},{15},{171},{106},{279},{281},{11},{14},{16},{56},{78},{313},{118},{117},{113},{30},{225},{102},{25},{217},{143},{49},{36},{35},{226},{20},{23},{463},{426},{312},{206},{187},{199},{674},{25},{20},{313},{137},{97},{21},{25},{50},{39},{25},{22},{40},{321},{236},{153},{115},{28},{11},{70},{247},{167},{111},{495},{123},{163},{167},{372},{202},{59},{57},{57},{56},{55},{11},{8},{8}};
    #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (7430 bytes) */
const char* const cstring = "BZh91AY&SY\035\010\266\n\000\010\302\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\300@@@@@@@@@@@@\000@\000`\037\337}\347\016\371}\206\213\327u\240\001\353\323\014\267\243>\373\357z\355\265\367\275\336\251\353z\315\356\364{mWs{\243\334\242\354\364i\310\016\326\001\245y\333\240U4h\r\235\235\014\224\200\000\000\360\017\220X\000\035|%\021\032 FM\241=F)?!\225O\330\203*\237\352z\231\023b\231\232\003\022i!\3516\207\242\215\2656\244cj\237\246\243P\365\036\223 \r\004\222\t\223\020L\204\2155M\251\372$\362\236)\342\215\223\023I\247\220\320F\215=!\243M4\320h\r\r\001\211\246\21544\321\220\tM\001\"D\251\340\223F\233\325\017\3252mCF@\364\236jM\006\232=\r&\364\323&\032`\215\025\r\224\033Ph\032\017F$\301\004\232QL\243#I\2423J\037\252\r0j\000=M\030\365G\250\332\2324\r\003@4m@4\033P\003CF\206\200\000\311\024\231\000\000h\000\000\000\000\032z\233\322\200\000\000\000\r\000\000\000\000h\001\"A\001\032\000\214M\004\320\321=LF\220'\251\372\223\3242z\230G\250h\000\000\000\000\006@\000\007\377\000\005\300z\3737\364\351\246\334\353\271\223\333I\003\361\370.\222{b\215>pE\255B\277\014I \242\000u\020\224@\002\004(\204\367\364\237\317\221\361\362HQ!\370\037_m\332\211\245W\370\353\361\001LZ\323\270\230\332\236\345\331&\305\254L\256\211\211r\022\023\316D\320$-1tV\031\254\230\207\301\264}\317\177\360\367|\035\363\233\227\231\374\376o\234\363\375='\253\327\331\327\230{}\337\3237<\317*\245T\372c\315#\2168\3129\261\306f\221\307J8\343JQ\307\237\237\370\375\024}4(\376\031\317\377\n?\313\263\372\375\377\332F\231a\022\302%\202\306\236\214QN'\305\024\370\247\305\024QDP\377\300\001\371!u\200\250\252=9\235y_\233\261\343\355\366\332\261\370\351\316\254\005a\n\310\205d+\"k\327|}\036\263\024QE\024\374\311\363\247\317\237C\266\005\177g\027\345\030QB\212\021\322\322\221#\201\021r0\0140\01400\025\004\211\251\251\204\303\003\224\356B:\220\203\233MU\004@\026DA \213\026\010\222)\001EEd\026\n\n\252\252\010\210\311\030!\"\322w\027*]m\274\376v\224\"\366\206\326t\206\305\373q\207\270\001\2141E""\213e\001#/g\307\337\371\233\340j\222\251Z\232}c5!\022\004\014\311+\215\242\306\r\341\323\016\365\005\021\"\254\202\200\262\002\2102\013\"*,X\002\221QY\024X\262,H\202\210\200\261\020\324\2777\206,\232Hk\006\007R\032\310!\240.\240\034\256\240i\257l*\013\024\036I\307\336\0312 \242#\031\233\034\310\272\203aF\313B\303-\366\243\024+KRV\261\246\330\230\252\n@Q\207\004\340\241:\333\270\003\221\210\210\311\024\202\204\024\221b\202\305P\2101VI8|\303l\333'\003\013j\301\214\217\320\206\220\206\234|{\257P\3338NT>Q17\r0\304\330\321\241j\026\320\324\256W\343\005'>2Y\235\256\332\222%\025\211\316\"\361\365V[\312rVl\032\213\251\222\006\320\233HP\032\323\276\237KY\032'$C\006S8\215&Y#>P\304\324 >\313\013\013\220^\203\"\306!\214\200\373:\006K\r\360\"\221\260fg\003\2048df\030\254R7\315\360\343\343:z\365g uy\252\204\250\242\305\0058\267\305\035\344f`d\300b\205\210#\021\030\350\031\006H\210\365\351\006\005\265\rU\214\300\331\234\202\001\216J\tC\3732l\026B\300\3102Fc%ih\266a\207#\\2fC)0\233\0201F\"1X\225);\370<\347\203\220\312\244\034\364=\311\202\245PU\025+\231\267z\357\351\230#DlK\355\356\315\031\350\347\r\241\264p\365\rCE\241\242\321a\200R\212\2145Q\271\350\260\300\367m\265\255C\317\026\307qi\245\013\252\014\301\021\356\266#\364\261\260\255\310\364\271\032\353l=9\030;m\265=LLJ\337}Sd\006\325 \330\210-r\013\270.\002\267\227}\352\233\241\2767\243@\275^UmF\373\312\001k\305\177\006>\277\263\346\034\377\200\372\353\273\326\037\360\373\207\223\032u\"\367I\376\304\036<\247\305\354b\376\024b\343\255^\307w\034}\335o\361[\305\371\372\257\277\267cNoq\024\352\377\262\353\367:\357\365\263v,D\212w\267c\203|\245*\335\224#&L6\316\023\321\300\226V\207\273\217\225\347W\005Kl\036\325t2\271[,\362\r\234\223K\210@\221|l\373\206\231RNS\035\246X\"d]7\224\307\031\320\302V\0262c(C\032\016\311<\305\377a\267\326\346\263\020a\250\324\217\255\032\303*\221\330\306\271\006\022\240\330\023\264r(\330@\263\263\214\257\274\224\341\241BjT\301\225G\207\265yqH^\316\271\211\\\250\232>{\260|\276\256O\274\236\357\213\320\005""\220\345\314l\004\314\301\222&#\241\222\302\347oV\365\325K\346\002\321\271\271\257\357\235\302\372_D;\270e\340f<\354\320E\022\361\200\356\206#\213\026#\203\310\302\347\\\3713\242\207\204 \306$\257\254P\344&z\313\253\212\244\363\026\316\362UF0P{\247\240\031d\331\017\241b\200Y{\332\231`\013\000U;\205\n+\366\251\004\222\210\021\025EplQ\1772a\357\366zj\001p~\354<\303-\247\220\346\315f\245Cb\241*\036\006C\014u\364}'\311~\356\265\265v\235\334\315q\314\001\374~\037\317\221\366\35615\244\222\336\036/7\261Z\217\013\275\313A\250i\324B\236\250\025\217YT*\245\260\355eJ3\\\216\2649'9\323\253Z>\037e\203]\371\204\316+\210\341\002\212d\355\221k\273_\303\010\231\374\230\014\244\214\222_.J\211S\017\023\023\335=\t\232\217y,I\375\214\355\\\024\340\335l\237Y\353)U\261\224D\254Y\177T\306\341`\363/1\257.V\007=j\3315\345\366T\276\332\354\324o?\032\024(\207!IT\373\374\251\272\301\375)\225:\320\215RwS\274~\324\317\004?\026\333A\233%\017.<q|\303\355\236\227\317\354\366\373\013\351\3733\243v\325\275\031R\346\035\225x\317P`1\373\010dH8*\241\372\340\321i\"\2637\021&\336b\335k\026\367[r\023\3019%\332K\303\323I\204\325\032g\311\234\007\227\252\265D\304\334\247(\005\321\265L\353cL\006,a\261\014\032R\2614mnf.\374fMH\212\t.\251\347\024\010\022\021$\244\237$\270s\266'c\223\345\347d%`,X\013\001\256y,0$\356aUUQE\024)\336\366\353[\357\275\027\201\201\303#\013\204\\\225\311\027\n\305\264\372W\201z\262\323\247\350\266\013\004\260\3000]\362T\231\360!\002{H\334J\251\252S\336\263\253\2032d\314\302\231\374Ins\207Uu8\300\311\307\226L\224G\"\014D\327e\233\221\004\351\306\274\202\375\270{d\226f\311\233+T\221\216\313\321\347j:\274s!4\251\375\253\324\333=\010\017\220\223\314w.\000v\204;@\210\010\240R\230\213@\264\266\004\364\302LIJ\242\016\344\221\310\0179\342\212\365(\251R\261dD\217\352,r\223\205&Z\322\032(\246ja\323\016\027\221,\227^)(\0375MQ\246k\316\3144\006\240\350\2612*2p\271>\347{cj\357)\254\246*\224^\006\316\237CBs\352\361W\213\232\271\247U\023_\305>\255\305\252\257\301\302\301\365\223Vj$\324B\222\025\004""\315\n\216\247g\344\351\241=\310K\022ZE\202\301^\307\364\271`q\214c\322w/\360u\3729 \274\026K\311\337\010\"\0336\006\364\265\007\273>\215\313\370?\227\2578tq\373\035\234\331\336\347\353d\353.\332\004\372%XF\361o\r\351)!H\244\224\217\275JT\346\335\305g/\275\3660\235:pN'\004\351\304\335\331\337V\2054\217\214\251oo\3449\034\310v\220\26554\317\213\274\274-9\315\321\333B\234\212\373\376$\372m|\226 \362\244)\312|&\362\370\376!\037\241\373;d\222\3718v\3462\326df\311\345\373Gg\257\277\014\271\365\362\277\r\275g\235\032\265\027r=~~\035\224\177,\263\360V\22753m\367\245\366\222\345P\332p\363t\324d9 z\345.\214<\3356{\355M\206\0066\315K\016\0011\340%\223-\005\330\300J\027d)%\246~\\\216AU0\3162Biv\036\034t\324 |\305\004\016c\002\007>\326,\016j\nM\216\272P\367\247\230\243M\030\330x-\350\004\324\313\022h\231\211\251\257\360Fg%\223Z\226\300s\336\347\035\206\353Es\237\250u\334\217\021*t\2515udq\204c?\tH\262\346\3213\313\271#r7n7.f\376\177\t\333\342\244y\307\335\253\320\227\016\203v\266\357nz6\245\264[@\332\215\253W\364\375^5\200\271\225\250\225j\253\275sy\227\256\330\035\2373\203\3751\304F \264\206e\230\346p\343\353\316x\007\221.a\362\347\003>p\305b\030\243\207,\276\0033\214\337\260;\370\201\2020\013m^\321\021Ae\215\255_\346\333,]\303\234\3708\217W\373|\352\220\255q\353\357\312sF\204\326\355\334r^&\316K\370\257\313/\204\301`@:\373\277\213\356\211\337\000\370\213 \367\305\245Od\225\254\362=\237o\227\271\263\303N\r\245\003\261\345\212\0147e\216\243\307(\243\013\237\006\243\241;^vo\213\2479\366g\003\336\306\357B\2211x\376\034\212\315\277\2261r\223\301\0314a\252r\253E\236\331o\325Y%r\302M\215%f\362B]cc\320\352\221\321\271G\020\364B<\351\241\233U\302\035\375H\343\331\212\244\240\251\014\270$hKvC4\375\241\312Y8\234\356\255\306\014$`:\252\300\226q;\271\003;\205\356\311\357t\215Y^\332\336\342\332H17\035\374)\010\215\233k\213\331\231\231\252\"\rS\r\267BC1\251Y\220\005S6Z@\230<v\366Rf\304\232\026q\304z$g\241\205G\004\234:\315\302\343t\366kzb8\254j\220\206\201\357V\023\374\351\350\247wO\002""\332\327Be\255*\tIR\214KGYP\350Z Qu\223\313G\303\333\034|\336]u\246\ts\302\232\t\030#\272\t\035\251\342\305\350\305\022*\177>\300\247\352\0061\305\016!\221r\\Y1(\365\216\304\336su]\232\001\252,\330\020V\342\027\373\331\010\270\204|8\211^$\354<\n\2425\220\323i/\250\217\253\"K5H\002\026w\277(\334k\005f\310\337&MtO\337|\263o\014\032\325\206t\332\013)\030\330\354f=H\354\2738X\024\344\006V\317@\024\301jd\245\002q6y\2721\216.\270\253E\004`9\360\337m\324\323\t\251\214\201vN\222:B\207d'g\300\223\304;FL\302\352\343H\203\222\335m\3235&\265\266\306\177\363\022\244}2\252ls\235\227R\331\262\267{\336>\215<\017oY\347$\007\310\022\017$\241\014EI\0342\2112\356,\214\200\315,\321\250Cn;\330Ir\361\346\362\215\014U\335\365\022\265\202\324\t\266\032\337\305\0255\001\3651\363\355\335@|\342>~K\267U,*f\370\005 \374\273\031\004\331\233$\235w\310\350\016\300\267\3432\225E\027v\345\223\342\361\303GW\252\263E\n\272\310eo\257\246E=\014#a\010\271Vr]7\351cF\307\256P\250\2013)\255\204\022+\010\225Q+\201\\\256\205t\256\232C\3260lv\266\365'$\344ED\214YK\005\217=0\202\275\351G\237\274\304*a\206n\202b\0302\\P\316r\030\226E\254\347\273\002uZ\317\013\302\214D\325\324\033\207\034g*\360\356\2267\005\226\334\312#\216j\362\301\022\302\360\276\372Jn\016l3z50\257h\272\034\247L\207\245\023Pm,7\005{\235~\273u\306?=\212\210\225\n\211o:\332\367%O\324\3174\036\237e\202\261\303\250S\2708\264I\222\313K\014\252\316}\342\t}\215\225\022qP\3651\300\343\276-\370\265lZ#\211\304\260\260~\270m\230\203q=\346\007Y\312\204\231\223\0101$\216\013&#\"\010\033~\0149\202I$\222\337J\014F\324\334'Z\371\325\206\246\003\346\3618a\353\244\313\317\177]\335\355T8.\246\037\033<\222\253\262fq?\215^\346\357$na\240\327-L\253'_\251\\k\201\335m\204\241Z\233\246\275\3012I\014i\316\351\206R\234_X\2519\222%$,i;\251ML\224\241\016+\016\262\000\177A\033\342\374\332\356\320%|\331u\303\356\275*\020\315\261\271\361)Q\t\220\336\037=_z\350\277\234c\004\340\371z\331\3525\203\021\037XIWL\213\260\316\304\005\215<\276\teU6\r\217`\233\235\244\022L\033\000r\343""\272\373\r\214\321\021\321(\310\211[\3214\024\\\321:\360&t\251D\204M\346\225\215$Xt\242\247\246\245x\212\217T\310\267v\027:\322\334by\312fO\256\333\020\031\221\004:\257w.O{0\314\224\007\026\244o\236\240\302|\331l\230\305VI\010B\223\005g\023\346r\\\037\233\251r\341h\265j^\235\252i\242\271&\265\032M;\264ne\032~f\211\024\216\005\235\naaFC\314\310\032]M\023\227d\202D\216\034\341O\212\203\205\035[\244C\273\350u[\2269FW\006\207\2169\276\277\260\344#\221\355\303\234\347\334u\323\232\2547\262\220x\267\201\200\r\367:u\021\241Z\306\346\311:YV\267WYpE\374\313\021\205\020\221{\2640\235\257\204@\212\"\315(4\207\2605\032\265\0378\354;\315\251u\0142\030\344\302\0011\250\010\201q \340l\245$\317\221\233J\245\013\304{\330\202\302\177v!\203hj\312\007\270*\024(P36;\226R\312Uel\275\025\260\"#5\211\250\224x\324$A\010\242Y\000iH~\262\233\217\260|\037\352\243\2228\242\211\027\007b\320\222c@\253j=9\204h\364\020\t\366\223\270\013d\211\350\2152d&\232\2344\022\0316\321\014\357\263\306s\234\335\t\327\243@}\206\262\nq\323<\004\223\274,\216\256Y^X\301\016l\2609\014\034\353g\322'\\=ON\353\272\343\244_\177\200\225\351\334\201\336F\230\014\311\027n\306\331\362G\024\206\225\300M=,\006Y,\354>\017G\234\366{7\352Yy=\373\256K\304<{|=\320\007a\323\246I@\354Vd{\350\273\335v\366&\304\221\334\034N\225\200xg6\007\203=\254\013\241z<!\2644xp%z\372\270\313&Pa\326\211\001,\351L\370*\2764\354\263\347\352\263+\243E\244\006\222\212e \371\2044\320)EB\363&\035\260]9\337u\2001\240\277\350\242\306\374f\037l\307\017!4C-z\030m\030\356\240\244\212\035\212\334O'a\300\347\361u\337\357<\0010\031~\022\3171g\t\020\025\220A\264\257YB\010\331\276\024\270q\227\250\314\363zq\343\313\246ZS\020\310\316n\033\307\000\352\261\302\331\031Q\301\2655\021$\234\207\006\367\027\353MjP\272\260\240\242\312L0\367\334\210\031\260\371\365/\027G\235\311\344\354>cbn\032J\273\2712`\005\010\357\241Qr0\351\240q^\227Q\351hF\367\024\213\372p\240\001\323\210\243\261\251\274\351\246\233N\006\013\336\312b\244\352\206\023sd\2111\264\\$\306e\001'\306X\230J""\352\002\270M\\#62_^0Sp\261H[\365J\341\\$\2713-m\246\233\027Li\251\347;\263\336\225\306\203k\320\307j\325Y\025H(4\224\222\222P\020\244\"hL\220\337\332h\317\372\372#oM\377\037/S\362Z\250\320\313 \201\243H\3631\005\353y\3465\266\322v\3147\034\272l\303\357{\346_6\263 X\271\207\021%\0014\230`y_\323\320\004\222\033b\n\022+E2m\240\267\334\327c%\347\276\315*)70\237k\275\353e\250\254\352\217Z\222C\244\001BI\220Z\216\333\366\277\252\262w\000j\351\315` \321\270\301\216F\343#!\024\310\325\322;a\363xu>\245:\271\362\356>]\261\346\350\350\343\324\325#\346\347\267\243\036\034\001c\274\203\0247LY\365\220\324\247V\322\347]\222ih\245a6\027\227\251\025\270\312\263N\216\"\372\214v6\306\244\352\020\314{&b\010SG\357\321\350~\263\003\215\204qpu(\005\351\230\211nZ\274\3657\346\261@\305\037^&\364\302B\247Dlj\270\305>\221\364Z>\220\320\330 \365\031\273#\037@\372\003}L+1\330\272\222\352 \243$W\352\302bB\232\223\222;\217\250v\224 \270s*jF\272w)\312\232\032\305z\027Lco,\020TN+%OY\014S\261\234\340\266\262\265rH\224\221!-|\t\306\271\257\225r\007D\213l\337\331j\005\277\262\245\35611\2437\315\370\207%\030+\307\034\326i\244r\313\335\332\301\325f\203\357F/t`\2138N\252np\244\r\001\206BS:\353\222\244\353\316\225\232\311#\304M\241\244\306v\022\270\255\243>64\206\014ke\005L'!KD\3459\264C\205\020D[$@\013\326\322\272C\352\016\240\\\216\244\272\300\355\002\223\303\201\350\037\267\365\226\362\232r\036vE \312%)O\204\345N\206\275\323\273\252\005\3527C\233\234\246]1\312w`\023\2027\260(0d\007\274#\231\326Y\337Yad\207\224\263\023\300\344\347TJZ\260\254\3253\274\363\313\257\302\235\366d_\237I\234\237\262\205\354\016\207k\244\354\206,\361\331\301mb\241=;\220\234\212\r\020\204\254\234\r\271\327\032\343\262\033k\343\336\342,\304XX*\306\341J\222[\363\345v\247\030\204\264\260\206.\367y\247\010\320T\336e\320l\335\271B\355\021\027A\033;.\323\010\026\037td\300\356\345\240AO\306\271\353\243\r5\327.\347T\360W\200\217*<\003\300^\007b\362.\243G.\031\352I\r-[\3478+\025*\025q\024\221ey\325\001\ru\264kad\312\2353N\370J\226\355m""\266\360$\360\334XcY\326\366\235zo\316\351\036\375\362\222\030a7[\313\270Da\313\\\025\343-%\211\324\006\206\220\301\214\342\355\252\265\320\235\217!\\\257b\276\363M\230\"Ql\222E2\274\"v\320\361r\311\025\202\0066\220\330\264\001`\345>\364-\204V#\034=\364P\ny\212\311\246\333\027\2242i8q\2626,\004\244Q\013\235\340\263<\200GY\2672\361'!\253\034\265\212\036\305\274nW;\326\235\307\000h,\315\034/\202\203\301\214\324j\262\010\232(57\262\243\321;e\t\021\242\006\362\254\347:\013c\326#=\364\306s;\322]\350]\340\035\350\357Gz\370~\0377\267\311\315\037\220\223\032`\264\255\010]\251I\260\001\257R\250\316[(V\315\376\021^\027\215\034\326\007G\357t\235\265\204\247A\031\2037k\3130R}\226u\265\240T4\257\016h\346s\\\272\313\304\214\207\206m\372=/N\234\257\326OIQ\033&R\307\023\370\274Q\255kF\264\273\205\334\266\255\235\237\026\010\324z{$t\036(h\322-\333\207l\375\2356\215\274\316\033\255\210\337\267j\003hmA\267j[O-\014\027\343\236\250\036\246\202\024ZC\245\270\232n\333\016~\307\2036\3609\303*\223\"\n&;X\301ic\021\006\0104_\275\212\277k\345\030\002\356\262\036\">n\340U\202G\205\2323Y\255\307\032\300\325\334\\sJ\342\334\336g*6$=\017\036y\273\334\177\311u'(\245\027\003\2178p\370~\177\354\374\337W\242\034o\272\273o\n\337\260\251\002WQR\365\021\024\223\217\223\365\3632\233.\271<\357\344\037\340!\347\236|\220\357\317{=2\035\324\004\031\026Ac\031\005\016!\n\207\231\321\307\231\350\252\252#$G\247\373\261\352#D\007r\030~X\304M\233\243\376\223\376C\335 \233[\250\202\210\017O\037g\333\376\022lD\313\024\224C\322\023\t0\200\301\022\331DQ\221\024\230\236\273\351Y\335\020\365;\205\"$\346\025\256R\0366g\271X?\221<\274g\301\317\353's\323\273\013\202d\207h\032\311X\025\373~\037\373\236F\244\240\377\247\345\353\177~\302\223[\203\320s2\310zL\206\205\354\247\305\236t\022\300\371\325\217l\206?{\341\212\226k\3332HL\360\177\023\020\014\342o\203\324A\352\010\361\236\377\322\271?\020!\235\031$\364|\005\304\221Om\242\275\347\320[\025l\310\013*S\273\321z?\256\343\006\023\321F\230\013\213\202tQ\264\207\277\375\232c]l""\323:/\004\246N\036\320S]\2256\343\002\310\340\240t\035\037\003\001\376rv\234\311\321\367\210\363~6\210\272J\325\016\033\017\252\315c\030K\237\343\003\266\277\371\306\221\177\267\322uW\320\305\355\237\016\306l\244\331\223\315\230|k\204\323I\217%\014\371c\375\261C.mb\355\324\307\010\371Z\355\326\344`'\304\236O\367\371\230\277\361\356\343\343\335\240\352\314\211\212^\\\366\027\273\235/EQ\360\016\372\035\316!\006i\304\356\343\276?\257\354}s\377\017\260\337g\372.=\344\\\246B\357\366\2412f\225\260&\320\216\220\315\202\016?^\030\335\247g\301\355#\037\376\315\267/km\202\2707\010;~\024\035\264<\373$}\221\330\355\314\223\376\256BC\023\333v\247iN(\020t\271]\306\037\357\366\273o\335\356\235\241\221.u{y~\330w`&\021\004\350\311\210\275\377\3373\275Q\006\306\321\260\322\\\321Cp+!\334\374\0037\177\267\337t\202\010;\262\223wJ*\216\345Mw\240\357W\371,\330I\205\220m\360\370cc}E\0346|j\037y\366\273\247\270\376\026\035|^7\004O\027}\231\322aRMg\340%\243\225\247\222\351V\316:\232x{\363s\345\363\013m\315pf\343'{\3412\320#\t\304I\311\325\317\340\374\247$\216.^S\300s\013\227\242&topH\216{t\3204\213\254\2625\001q\020\177\3279\313\334o\nbNo3n\327}\006\236\333_\223l \373h/\t\262\033\337\351\336\nc}\002x!y/\210\346\344\350\351G?\235\270tes\316\213\347\321\235\023\263\343\357{ff\310\304mui,\024\252:l\320\331\357\355\361F\365\374g'+\077\077!\007\376\314\362\241.op'\311dA\215\345\332\013\326\304}\356\246\342$2\303\315\306\360sy\017\351\033\306G0tB\350\252R\250DWU\027\323\207\216C\360\340\362m\345\361s\263s3\271\376\021\314O;\365 \366r\202\307\371/\223\361;W\214\270\021\2442-6\376C\313\302x\223\213\2077?\217\235\271\374\220t\037\225u\023\344o*$G\227\206L\267\310Z\342\231R\330\373\t\324}~qrs\013\321\203\250:\231\246\303\245\274\264t\204\377|24\330%\217\033\202S\346rx]O\207\3621\312{\034\374\364\307\210\346\242\347\253\016\237!\265\345u\021\276\3768/\203\256\220\372\336\006s\227\231)<B\020\203\235\t\240\374\356\203\237 \234\027C\233\006\366nrx9\3729<=\016\354\376.~X\210\204\244!\221\361\371\250\222""\271}\337\027{\274$w\374<\266CG\332\327\306\rt^\321n@\273\374\237\027\177\336\034\376\331\237\002\372\334\274\214\3449\315C\337\210\214]o\007l\373N\274=\337\nn_\004\314\362\264\030Q\241N\2126\333#\271\364\373GiB\366\275\242\033\333(*j\t>\307\337U2c\030bfO\027*\370\205i\373\2505\342\005\032? \346\223\2118\327\227\220\345x\031\221\354o\035\\\3072\037\2006\022\031#\030\337\205\376#k&C\033\315\361\263\251\366\216\346Na\204+\013Z\373\034\242\244$-=\307\001\342\027\213\223\0263\024\003\3577\244\346d#\230\250p\360\352\234b\3627\245E\311\324<\305G\274Y\010Z\304S\213\017\243\224\3408\230\271/@\336\206\342$\r!\034\257\214\207\033\303M~\036-\376>A\212\373\330\233\324b\304@\351\004\rB\014|<w9\016uj\257\235\346c\r'\325F8V\261X[\315\336\341V\234O\0377\033\234\306+\355\304\360\347o\2376\366\373\017Q\205\257>)\276\243\023\342\323\353\347>\006\341\336V3t\302\346z\232\321\265S|\347\340\336U\303oy\242\242\263\345\254\327u\375\033~\014?\0030\217\347+\333\312,\0201\244\0171\3473k\342>]\252j\2557Y\270/\203u\220\217\261@,\331\273\310\367i\244\336Pp\233\241\323\322\302\344\205-\313\306\251\336[,m\314-\350\200t\214\032N`]6\246\330\033b\366\021\306\210\321\323[B\375\207\204\255\2010\305\253\326\326\323\313$\263\310i\307\333\353\\p\020\352\333;\364\321\216\277\262b\333V\367}\014n\313\024so\227\273\207\217\271\200\330\331\277x\350\247~\363-\352\251u}\035Lk\332\335\356j<\312\3239\366!\326m~\373\271<l\252\343\275\255\346[\271\267r^\202\346+\324\332\251\345\341\026\347\316\306\264\271\303\341\263\rs\276W\332\350n\376\003c\tz\232\257\223A\356\203\235\000\304\237w\177\312\200n\371A>\357\325\3436\200\232gb'\230;\307\307E\224\241;\347\276BT)\364\204\254x*LB|\311i\351\347&kj\303\350\206\244\214\304\235\225B\035\222\327N\r\204\344CNo\372\346\331\010\215\357\215\025vq^\313\265\346\362#aC\030\207\307\350\030\241\215\213h!x\270\203\367\340Q\351o\365\016yi\312P\365)V\224\2163\257\252\352\020\215f\323\352\351\307\336\211\234\227{\371\236~\2475\231\257\217\375\323\351\354w\030\215\315\337v6\336b\210*\234""\307\036=g\034\273>\342c\311\351\371\347\003w\0357\r\330\311\330\201\312L\350\247\"\267x\314OuY&D\345\342\262/ \310\302\362$\212'&\356'\007\024K\274\024\204\360\344\246\246\023ZL\3237\214Q\200\257\334\371{\372x\034\025\207\000}\320KD\303\355\023;\217\010\341\025Se\025\206<\317\325\263T\331\214\327\365\004\361(*\003e\262\322eB\246\231#\n\264\367vD\272\230\034\326#\014\221e\211\307/h!\264\215\240\200\255kX\220\361wq\014\355uLUz\305\242.\351\320\210,\261\362I\207{\232*\302\305Sv\351\336\227\243\363\224\220\333\276i\360\2446\245:\207\376Y*\362\326\351L\211\032-\321\021Pjd\221\346YA8\020\204\234\226\024\345Xe#\371\237\214\351+\371\363s\211\366\324\307\006y#\212\236\252\021L\177^\324\246R{\343KP#S\263\323\315\306f\013!\302\230\262`O\017!\027\251\252\311\372\246\254\325\274,x\277\315\331\344\306)\3611Y\010\242\201\344RUC\224\035eV>%\217*s\r\322\211\223\0378\301i\341\355\327\351\366;\016\204\365\267\026\341Q\305U\266\215\261\265kP\266\226\265/\341h\217\325|\321\272m\272\307\034\314\037\"F\371S\213-\343\363#Q\351j\352\351> \251\316\334\357\377\342\356H\247\n\022\003\241\026\301@";
    PyObject *data = __Pyx_DecompressString(cstring, 7430, 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 (7687 bytes) */
const char* const cstring = "x\332\315ZK{\323\326\326&\211\201\004\022\210s\007\n\310\334\014\245\004\014\341R(\264&\201\020\332P\234\004BK\251\217b\313\216\212m\331\222\234\020NO\313\320C\r5\324\320C\017=\3640C\r=\364O\340'|\357Z[\212/q\240=\347<\347\371\236'\321\336\332\367\275.\357\272\310\321\242\251eeSMHr2\251\346\322\222\226\222\022\353\272\226\325\014-\253\030RB\316I\222\226\313lIk\212T4\224\244\264\251\232\353\222aj\272\234V$s+\257Ha\303T\362aI\323\251\246+fb=<=+\347r\232)\311\206\241\246s\222\251I\357\025]\273\222Qri\314Vs\246\242o\310\031\177\224\362\316TrI\t[\371=4C\315%2\305\244\"=\323r\312_\033\331\332\254\345\360\252\231\353\212\336r\237\377h\031\334M\316%\375%\214\342\232\241\230{\337lgO)'\343\221U\r\2209\261>\275\220\311(i,<\2730\037]\2425\211\350\341\363F\330\357X\223\rE\312(&\026\222\224\\B+\322\222Jrg\242\232K*\357\230\360\273[v\006\025\212rF5\267$#!g\024^~\247\313g]VKb<6\310\031*\030\2303\275#iyE\207@h9t&\225\224\232SM\305\277\336\177C2.\276^\\\230{\266\374\344\371\375Wo.-\312\231\224\246\2032&\346/G\027\261;m\215c\246T%\223\304\311\303\336\020\257?\243\346\224\273\322\342\322\263E\351\376})\374eX\2223\346\272VL\257K\251\214\234\226\326TS\272p\355\335\265k\327\356H\211\214\"\203r\335\026Xz\026]|\364\271\025f\374\025 \201W\004\367\261\210\2406_\030\313J;\355\363JN\313\252\211\250\256\313[\323$\263\3174\023dX\227A\330-l\000\2412\244\244\222Q\327\210\276\n\350F\314O\020\2331('=\177\364\374\312\314\235\031\210[R\322\225\337\224\204i\220\220%2\320!\220\033z\271VT3\246\232c\322\032\323\322BJ\332\322\212RN\301\346\020\303<\306\265N\200\314\346$\026\321u0\202\205\226\331\032\307t\310\\XJ\252:6Q7\024\232\375X\316\030\312\364s\031m\311+\n\037AN>\307\365!\214\0139\303\2243\031\351\371\326\262\234\245\301\270<V\305uR\305\\B\360\213\204\355\342\272i\346\357^\275\232 \311JkZ:\243L'\264\354\325\374\325\374\226!g\257^\212\371R)\244~]6$R%:\240AJ\342I\031\232\r\245P\204\360+\323\035S\240F\006\312=\232\2270\213.\340\301N\226\204\232*\262Y\324\025\336j\013\364P\263\371\214B}P*_\"\244\244\246""\210\303@\037L\031D\006\333\350\366\246\024\211H\246\274v\2058\227UILY2\215\351.\322jB|\316\213eR\320\333\344\247\207\024s*.\331e\014\353\221\352\251+\353\221\007\007\244\307\313\036e \207,\317)\025\n\356\035\332\220\302\367\303_I\233\353jb\235\244M\340T>\257\351|\327O\317\234\376\304LS\326M\222\300\035X\304\0209EGR!\245\020\027\014!5h\302\234\377^\004\005\327\224\360e,\036\276\202\007A\301t\270\243[2\362JB\305\345?\245R\336\224\346P\\\243\230\353>v\005\022\225S6\233\347\345\215\370d,m\211\242\256\263px\263s\212a\254h\232\224\221u@\227\017\236\230XT\3320x\005\314 \351n\247\317]\351E\356mN\333\314y\010\312#\210Wms\357^\375Jzp\371\312\3007\207\016\r]z }w\371\3207\322]\351\222\364\200X\366\032@\364\355W\341\007w__\272:\035\276\013[\034\307\026\na\023\344W(x\213P\343\215\016\331.)\306\272\234Wd\330\363+\233:\004\225\r\311E\343\222\024f\324\306i|j\313\020y\324@i\031 \220\340Z\230&\2023|\336\270LT\014\263\202\232 K\n\244Lh\231b6gt\214\240^p\034\340\300\214\363\2656\251\032\362ZFQr\364L'\326e=y%\221Q\363y%\271\016\\\201\334\260\322\361\361\303\340A\342-\313\371\3755%9\257\313\371\365pS\207\246UC,\223\014K\027=\200\230\316e\263 \032;\030\202>\017r\305l~k:\236\320te:[\004L\362\001\245\224\014!g\352A\353\301\254\326aE\310\303\372\256\021\222\266F\330+\205\275\312W\222W\271K\326\016\260\010-\330\220^\347\241\021o\362[\017\325\364\252\232&u\320}\354\301J\202\376r\233L2\007a\\x<\251\0363\220\214\250oC\005\177\t\275$>\246$\256\000\265c\014\020G/B\244\357|\005\356+\372\026\037$\\(\262\240\370\314\365H\024yp\3368\364\035\376\303`J\230\215J\230v\204\304\003\3715\246\335\272L\330\337\016\276\323>\017\257\260\266(\311\346\273\247\332h\322R\246\317NC\313(\357\344+Z&\0316\362\320\232\335\0071\364\304\325'+\000\237\253q.\246\363[\357\014\006\024P\215\025\3163\200\200\021\321\276#T\360%\362\374\306\303.}\345\351\253\024n\326\276\021\026\300\320\212zBy\320E\224\016ui\353\322\004P>T\314y\027\224\230\246\233\227\243Q!]K\220Y\257\272\254\244I\003\371\255\255\262\nY\366\021vI\331PtC\316|\262s:""\036\207\270\024\023J<\301\356A<\376\271\3410\346 \220\331e\302'\326\3526OHm|\211U\361\241\266i\252\312\316\370\216\327\335+\357\036\260k\375Y\366~_Bi4\275\245\332\\+\336\326\232\200\257\201\331\033\252\262\331\332.\347\363\231\255\326\0061\256\265E\370\361qS\213{\276{Kg\234|O\243u47\264n\035/\346\362j\342m\246mMF}cVM\313\372\217\276+\334\376\266\233&\273\372w\223\244}\004\244,\361vn\276\025 \332\014X\223Rm\315d\027\030\315\333ZSh\210C\220\323$\310q\302\226.\335jz\023,\357\354\024Dj\033.\250\3246\310'S\3338\006\271Ol\353\365\357\332w\301\263\311\035\257\270rB\313o\355\\\270\245\275\203\024;=\276\357\262\273=\277\325\331\266KR:\006\304\231J\236KL\276X\347\002\252\021\367\366S\222X\243\263[\203\226f\344|\347Y\342@\251t\347^\323{7\306\223]\027\360[\237k\206J\307\353x\335M\243\235\036\242\305\023\306]\001\276\313\"\014\023\262.\232\004,{O\366\230p\375\205\205\\j\361\331\217\317\343\361\347[\357\360?\007?!\376\014T\\RR\204\033\313\360 \233 \323\366\262[=:\273wiG\373\000f\0055\221\223\320\245\213\243\211x\0136\177n\214\007\332\355\303\322\212\031\2471\2737\201\333\023\367]\3628\273\344\355\375\237\352\323\345\315\216\271F\373\000H\340g\316\3379\302?\275g\020\374\222\214\204\010\203T\305\350\332\310pAF\237\304\276\305m\353>\230\350\221B\300S\000&\350{\017\321\331\036\201u\232\037Fu\037\013\263\014\332*)3NzG\236\036\037\305\370\304h]M\257\377\265\341\002[p+q`B\027\177 \304+\355\213W\274\245\321W\220\226&c\3678\242\030\371\315\306\036$\373\014\t\332o\335\336\272s\273\235\346\266[\310\342\026\000_\241\233m\212\272\314N\316\302\217+\257~\216\3138#\376\036\345\320\246\030\250=a3\276\327\311wL\306\036\302\200f\300\214\214sy\256\264\234\311eM\330^j!\013\014\327\313\020#\215\255\\B\325\000)\272V4\2415\006\305\014\264\247X\222\342\2035v\016X\247\326\212)C}\257P\322\002' \363\027\247\260cm3\221\360\257C\201\201L\031\020#\016\313\310\263\3300\362y\371\021\247\370D\3246\230\022\206\010fx=\261\350N\276*Nq\227\230\320\245\303\350l\244\264\234\327\230\227U\335\253\nw\222\353tZ\256\230E""\260\331\200}\242\314J<\356W \n\340_\226^\025\034\206N\017\370\214\223s\251\254\301\301Ld4CId\014\332\035\324\311\010\313b\220\324\200\323\224w3u\337\204\241\204L\231D\310\374:D\025\260-\254\241\377\334\341\227\357-\2658M\tc#\261\221Lrd\232T2\nBR\272\257\036gb\304E\221$wW\311\346\315-\nJ\223\210\315\222\244i\364\300\235(\033\242sABE\005\206\025\263\234\251B\363;\325\244g\207\tM5\345\266\251\207\214y\002\370\3505\016/\213J\242v\263\324\r\223rm\364\017\203\323\206\367\273\235\231N\377\245\273\r\330\023\365SE\030\030JT\001\030\3446\220\353\256\313\255v\001u\235N\334\212)\250\231j\022Ov\024\323\357\325\374n{!\202\\5\036WI\353\342~9\375MFK\000\324\036L\013\255\343T\":sD^H\201B\331\004?gatx\034q~\367T\017\365$\244RM\340H\250\3479oG\025\235\004\234\337\361VHPt\213\n%\363\"^y\235K\2765j\006\tbR\326\267\250^\314{4\020\357\024\017Q\214\207\252P\276\270\226b\320TI\261I\366\341d\340\314\232\206\303n\374\246\251\271\267\312VF\304}D\275\214\226\216\\\213\307\263\270A\234\212\267\n)G\316\310xyH\212\352\343),\333$>\367\320H\036H\333C\033\343^B\006\257\005/B\313\022+<\300\342z\363R\376\253\177z~\347\300\222\342\375\254\374.\236\315\362\212\250\322=\262J\026\003\305\223\034@?\316eZz\211E\312\225\343\006Z\262\230\2412\257\031Y=\007\315\027\262A\317\\b\203\310H\n\032\317)\233\374`5\312Amp\264\224\242\023\346\307\325dG\003\237,\247\345\340\267\261\301C`\356\261\223l\005\007\375Z*\005\252ky\2606\327.g\035\236\206f\370nh>\017\tS\222\315\205\3622K9\301Y\036d\310S\306]\3171\326`]\\\010\177\220<?\243!\024\t\372\364.\316\210l\024\2757]1\212\031S\324=\205\240*\201\213\250\371\261B\323\241\331\253\275[\224\3331\266#\326\354\350m\217\251::\333|*\321\267!$.^ \254(@N\013\304\271\202\311\204\217\263L\010\2062#\350\313\211\2271\341l\013\263Y\324\n\276#\"^\375\024\211\367F\014\345\004\002?\0149\005&SjDgW\336s\363\341'vq\025u\005\004\366\214%\033-RX\372\217\003b<qo\2722\273\374\354\235\006B\025\210X\\\335\240'\371#M\201\2030\264\212c\207$\352\214\320:\355\274AjI*\277\033#u\242\240\016\n2:\352d4\363""\300\001\003BC\010-@\305P2\220\333<\376`\345\311t#\274 \370\360\264\0065\230\020\231\245\251\351\211u\t\016\214\024g6\rU#u5\336\266\344\235\230\256|n~\304E\002)\316\270\312\325\244\n\335\341~r)y]\003\333\352:G\271\364O9&\357\233U\334+En\311\317\r{\037\256\214\315\202\261\205\005\322\370\203_\000\360\313g\350\224\002\356\342qZ\030O5\331\315\301\337\303\245\347<\224'\003\206\017\215J\233\017\271\227\033\335\356R\356\351>\263^\322\303\3642\327\234?,\212tu1G\234\200\035IbW`\277\242\027\301e\237\376\033l\337D6\004\360\277\271)\3539\312\264\261\327\332%\370\337\025\357\357jh\232?\321\305\307\204\233\010\001\354\342\nw\361\361wM{\267E\037_\r\351\336\031w\3375\367\332\303Z\250\036\030\261\360\010Z\301z\340\204\035\251\007\216\331\250MXr=0e\357\267cvk\345\340\007\243\024*\335\266\316Z\261z\377\221\322ov\017\r\356\336z\250t\266\024+%\254Q+Z\357?\\\272Q\222K\006\017\031\234\264Lltd\304\372\322\236s\372\234\2103\353\030\345P}p\250\264jE\255\230%[\377r\242\365\301\343\366\031\373!v\355\037*\305\352\201\375\037VKQ,(\227\n\264c\241e\247\303\245\310\207\236z\340^5R}\\\013Q\365r9R~\\\t\271\201\353\225\320\307\376}\003\303\245?\335S3\225h\345e5\302\2154[\265\266\234\236z\377\240;(9=\316\270\203\235\216\342\210\227l\254\206I\373\007q\346\244u\306zj\313v\301\r`\372\316R7+\261J\252\032\245\255\016\227nZ\207\354\220}\277\334\343\356\273U\311\326\276u\227\226i\372\250u\325\231p\n\345\036:\356?\261\316\254e\330g\355e\276\361be\244r\275\262\\\355\361\256\341\036\273YY\252\340f\003%\\\250\277\264\277\364\302\nY7\230\024\263\016.;P\037\034\345\367\177:!\347\272\263\204\266\243\303\365A\242a\324=\371uu\244\032\241\343\377\023'\271n/\331\2723\342\240\341P)l\215X\267\230H\356a\260\027\004?T\016W\202\356\340\035\354=<j}m\317c\340\330\224}\320.\324\247N\333\005'\340\314\203zO@\254\030\r\240=\267\350\314\365\261\t\353\255\023\024\203x\021\220q\352\244\275\352D\235\237\312\351\312j5Z\2155\332Wz\\\016}\210\326\277\236\257\025>J\373\006\006!#!w\364\274\003\031\030\266z\032x\004\254\250;\036v\n\215""\376\201\306\340\270\305\035\3756\237l\206\257\212m\307\353\303\023V\232\004\260!*h\002\201\207\306A\321B}8X\037>fO\362\t\207Iv\207\247h\376\244\245\333\343\3048\032\031\024kNZ\233\266\342\334)\317\2247+re\263\232\252E\251q\003<\351q\246\312\243\345h9&h2\347\354\307!\307\276\260gq\215\236\372\370);\201\233\343\375\221\023tB\215\261\343\366\227N\324=\377m\265P\353i\014\217[q\320`\265<_\271Y=X\305\221p\021+e\223\270\014\r\227L\353\266\035rO\\\241\265\203\326\204\205\273\036-\025@\026\210\311\265}\003G\241\"AR\220[V\260\201\342\016Q\274>x\264\264e\367AK\3708\217X\220\016\226\365\312\t\222\360F\267F\032y\313\236\260\013\r\020f\031\327\345%\366\023{\0045\202DF\231h4b\337\024\367\033'\236\246Y\\\246\312#\345\033e\031\253M\261,M\035\207\254\306\3545g\000\035\021\276R\333\302\207\234\313\345\325J\224I\336\3261D\013\237\264ct\371Q\222N;F\327\372\006\254\022\305\307\003$\tw\255%nq\017K\244\204\207K\017p@&\014\364\345+p\342e%\002\032\241\005\352v\255\322S\t~\210~\034\363\324/B\262\347\006\276\2512\262DH5\356\020\255\316@`f\240\031\303\247p\360\200\023m\354\352\030\263\242\037\242t\236\353\245W\342\314#\342\214\300\201\322l\211\024\2554!\212c\002\317\006J\307\231#\375\003\356\200\020\0034}\301s=>\356\254\026 q\361V\004\257\t-F\25411t\322*p\377\246\263V\356-_$\004\302\206\356\321\020\t\024\325\237ZI\242\270\240\316L\351\275=\212E@Q\323\272K\362Ib\275\337~\t\350\230\207\374\032\225\313\325\227\265\231Z\241\321\275\231\370\365\022\027\037\004\254[\227\355\237\035\275|\2742S\331\250\306\352P\206\343\366\r\300\352\340\230\365\010z\303za\242\345my\242lV\"m\002B\252\204G\237}\3339\343\314\225\373\312w\004jU\307\252\313\265\376\355\336\355\220/(I\347,P`\255\322#De\367\306\037\007Ic\347\210\026\203\245\005+&\330p\203\245\037$\003\352\332L\312\231\322\246\225\300\t\"-\254\241\326w\326\246{j\272\234\254\234\251<\251\316\273\263\313\356\362\n\361\363\t\000\354:!J\013#\177\200]\030\263_1J2ie\334\360\026A\242\020\242A\177\337Q+\322\261\347N\313g\367\3536w\306*\302d\2559=$y\327\255\027\260`sN""\0176\235\370k\233n\331\007\335\323W\301\206\353\225W\325Uwn\305]y\261\327\246kv\257\035vF\301\226\375\345%\350\255\2772\013%\250\335\261\341\321\222\356\006Y\332Hd\241\265$\236$i\005\262\264\347\000\256(\256\226\203\345\013\225\236\006o\361;\270\016\253|\014\244\004C\217\331\247\313=\020\221B\303\333\237\200\030h}\220\2159\204\006\362\nA=\010\216\003H\033\220\256(\001\235i\335\004\313\203\343\240E\250\036D\243\265\002E\017~\001f\363\333k\236\021l\351\032\251\007\311\017\341\206\237\355\242\363\020\206\271\331;\356\216\237wV\312\223\225\036\257\376\212aHl`\317\270\247o\010\3348L\266\006\200x\3149\347$a\254&a\356\006'\010\225\355_\331\000$\253\241\206\327@\202b\002\344\372G\254\013,9+\316$d\375:\020\333k\n6\373^\001\350g\211\334\245(\303\t_\014\300>F\216\013\351R\201$\233\034\253~\206\013\354/7\372\207\255!(I\246\034\002\310\222\2224\245u\257\036b\217d\233d\305\007K\217\254q\310p\301\263\2168\016\200A\307\226\244\343\303d\326g\355\r\210G\220$p\003\253\376\373m/\235\326\025\311\340\376\006\343\030\364l\026\241\323l\017\335\355p\023\243\206\255\243\200\275\376hm\254\006\250\237.g\341\207}_+lC\323\257\224\337TC\325o\350\205\304\346\036\204\346\rn\372M\245Pm\277\351P\353\025\311\235\212\210+\222\363\350\237\201\034\307\002\260\350\326\316q\2104s\326\000\270B\307\306\314\003XB\007\250\365\202\352*\2304^\221\353\223'\354{N\002\202\r\301\377xDl5F\236\006\226\260z\260\003{\021\223d\215v\026\235'\251%\256\017\226\236\000%\203vH\240\026\311\030\213\327\024\300\374)\240<P\366^\310\213b\242lx\206\300tnA\021\346*}\014\177\31356\217E,6\nH8\000\231<\017\270>W\021\"C\250<\001\367\360\034$f\314yI\226\270\333\360\320\347\007?\004\022\237\207;}\256,\377\365\301b\335F\013~@.\335\341K\345\261\362\353j\000\3144\267\371\326\344\257-\36223\345w\025\263z\177\273\207\204=hM\332\001\367\013\362p\230\004&\226\201\376\317\333_\303-Z\201r\303\032\234\006\007'\231\\\241\363\356y\370\317l\">\036\3327p\234\360\205\310\373#\214P\npv\264bT\201;'\251\365\230}\312\331,\313\004gC`\365\001 \346\004H;\343l""\224\227YY\334\2210\331u\t\346~\021\0208\034l\264\265=\001\007\366\223kJ\222;TZ\004+\317\333\302\274\273#\344\025\\w\317\337\205\210\336\256]\204-\203D^\206\362\237\256\004\334\231\307\265\364\366k\367\325k\367\365\257\356\257\353\356\272\312\036@\010\267\217\t\357\340\034;\005\245)\026&TN\203\355Q\036t\206t\236k\247\205\002\243v\236\tA5\006[\317\235\020\345\027d$\004\351\n\302)\236s\247.\227oV\002\225\307\325sUY8\270\001\367\034NJPs\312\376\023\236\332fE\205\257\t\353\334O]\010~\032\334U\020NC\204\006~\301\236\001\243c\254\345\275\321RE\320\365\013y\215\216\357\316\374=v>\206\010\247\253\202\231B\033\367d\321\230\365\243s\033r\231\254\\\344k4\272\366\234\253*\265\333\333\241\277\303\256c\230\232\252\314W\357\325\022\333\243\333O\335\227\253\377\317XU\037;\341\321n\2522F\302\370\337\341\024h\204@hz\337\300\241\372\350\230\027\r^&P\017\n\352\315\341t\337\343V\267\313g\313\261\016o\352=\224n\025\332\261X\r\356\364\220\033O\000w\02765\266\023\215\r\260z\302\251[\201*\026\312\007 y\005\202\3445\021\236\210\370a\023D\034\364\342ql>4\205\2201\340,\224W\020M\214U\177\206C\nS\013\017\003A\347\307)\212\307\272\257:\006\377p\000n\332-\320\177l\222\221\\\244\007\266*\275\360\303f+zu\274\232\250\215\"n\233:\326@\3702\025\242\2004\304\301\356\224\004\330\207?z\206\0024\304\230\300\314K\225\257\253\0130J\204%\200\272Kp_\t\307\256\336\207;z\252\033\335`\211\216\224\336\330\241\306\320q\021\322{\356\017\\\272\203\016E.\237\n:\251\233n\206\267/\000\255\277\301]\232\204\\D\305\275\016\302\225yZV\311\362a\233\361)\334\216\254'\002\350_E\262\242r\273\372e\255\243\341l\365\247\032\201\337\370\361\0352\211\3205M\246V \365\353_\352\375\276\017\036\362\253i\207\243\256\333\326\031\030\320A\366\310\211\237\375\236\224\237f\216\261\027\330\036o\264\332\362\246\343a\300\321$\0223&c\314~a\010)\344\274\303\256\202\341\\\204Y\277\r\036=\254\254\301\264\217\235u\356\226c$\371\223\326\357\354\271\202_\034\230\263K\030\001\230\020#~y\363\277;:\030\332\345\350\363\234K!\227u\026\026\255\320<z\272""\262\004i\243Hx\257+\314Z\233\344\351\213\210\202\342\274U0=\0055\217\371\351\256w\034u\357(\336\000\371'i\373\205s\001Q\373\006\245\242\352\220\266uvA\227\350\350\307\355\013\302\327\242\351)v-\317\320\315Z4\267{\373\010\205\252\320/N\037\\'\275%8\036\304a\033\200\230\r\216@w<\271A\016\326\355q:<!\2208%\307\361,\312\230v\230\343\311;\020\300\220\007\366\344 \274\263\267\020\272\236)\317WnU\371\2207\255>2\r>\214S\376a\0041\3039'\r\305\237\000\371&k=\215\256\335/*!\337'V\210\251C\210\237cT\374DH=\344\016QR`h\004\"\000x\275\r\276\364\327\002\265\205moHB8d\030v\336Y\206\226\005\271Nz\337$\300\316\275\306\255_\235\010eLn2`\211\324\rx\344E,/\231\265,\r\327m\221\271h\320CL\374\026Zx\253:U\013\326y\201\303\036\226B$\2120\004\200\004R\327\327\345\0018\232\211j\260m\327_\274\344_\360\030\307x\315\226FKu\320\263\003M\224\307\005\343\366\023\004=i\004u\005\276\330\005g\035\221\301A\320S\\\364\254s\007\261\311*TM\320\352\022\314\312\010xu\206\322!x?e\257\3033\245\304P\323O>J\231\2061\000\273@\344\030\2740'\326\3211\001\217.\342\231\225\372\361\023\365\211\311\217_R~\nr5\370\267\215\211\027\201\355\231\355k\261}\023\234\032\211\212\234\237\t\t\271\004\374\213\326\3078\205!\222 \177\210\024\210\030\333\323\020\025w\352\006\342\344V#%\354\307\230\363k%\002sLn\302\005D!\237\265$\336V\365\251\023\366Mls\362\264\375\216\234b\020\371'b+\010;_\273Q\223a\305N\302\017\330#\253G\304<R\222\ty\036\263\303\301\361K\020\"\374=\3401\344\247R!\035\354\213\303\300\221\306\321\203B\257\210\365\320z\213`>\312\351\223\335-\rn\306\222\233\214i\347\311\r \\\203\273\034\000t\025p\253P\245\351\274\343 \034\037\276\260\317\271\247\256R\344\000\212\314\262_\355aS\221\355\330`\363P!\202\n\0031\363M\337\260\257\333\262{\372Qm\211\262L\014\036n\350\t\245|\274\264\234-C\034(\231\272QY\251\006;\033)<\270EPL\371\274\201\322\t`y\340\300\007\225\222\367\007>\244J\374\366\233\205\276\003\356\001\376\354p\340C\206\276CP.?\352C\354\234}\200\027\274\301\332`\302\232\317\325\372j7q\210s\333\262\010H\274\364\303\224""\220 6\326\315\216{\"\247\277A\271F\177\325{\"\207\007B\211\304\n\245zW\312\307*\347\334[O\375e\007|\307\200\350\235\342d^}p\250\301F\205\300\220<\301\023\366\014,:\305\027\001P\266X\235\255\232\020\222\365\355\204\033\373\331\375\0311C\302M\274w\337\377\356\376\376\257\035\317q\277\363\023\234\334s\020*\022\276\261\332\362v\277\373|\331]\376\305\375\345\037\356?\024W\301\350?\334?\376$\037\365\024\316\177\223\367j\372\255^\345\260\310\332\020R<tO\021<\366\020F!,?\031r\306\341\367\320\267\024\302\320\000\177;\240\372I\341\2449\246\010\000\275\336h\263\326\240\032yS\203\214 rs\027B\3263\374M`\256r\0306k\220qw\245|\242\"&\235uD\333\005A\354\302\347\010\370\205\315w\231\004\032<\262\203\376\265(\213\342\371\352\212\035\371\344\255\177\262\326\334)N\001W\356T#\000\275I\322[q\233\322*\204\206\344\227\253\017\371\263\001\245&cbb\322\346\317L\257(\227\324\030\024V\307+\232\353\277\202\270l\262\334\335cZ\361\360\023\302\003'\373\344\025tW7\360\260\026\3728,\374\020/%\366\351$S\203R\336\247\031\021\274\216\025\000\226\227R\"\214\344\274\310\031\353\241;\361%l-\2516\273\220\354\033P\264\027`oAwC\267\331?\271Q]s\277[qWD\234\n)\222\031/\334\300\3026\333\350\026\373\334\231\035'\371_\300\366A\316c5v\217\033\263:\306\370p?)<\207\337\241\002[\"\005\342%\356)3\036\003\225abY\263)\001\341\177\236\003T\"L\213\272\3738\223\032\030*\275\204\206G\351\343\330\246\370\004\"\340c\323Q\001\036:\ttc\247\3117\200\243\325'\265\207\010\363\202\342\013\335\221\322\2125e\217\271'\257C\251\224\352\214\373m\314\215\275p_\200\014I7\251\324\003\224\311\211X\217\355\257\034\376x\271\001\231x$\322\r\364\321\223\222\362\215\376I\2669\341\362x9Q\031so.lO\272\317\261\306+\367\225P\313\264\233\316\270\031\315\325\214\217\373\366\231=\217zQ<\352\375\201\212\037zcT\304zW\250X\351}E\305\253\3365*\326zU*\324\336\034\025\271\336\002\025\205\336\"\025\305\336\271>\024s}\337S\361}\337\017}\336'MX\343k\304o\004\211\337\3276\267ay\333Z\n\335\257]-\374\017n\272\330\333<\343\203j\262\026B\230~\331}\201\231o\032\035m/""\333\216\2113\374\375\323\301\244\300yl\356\370%%\264\240Pok\223\224Jlki\027\006(\332\212{\211Ns\021p\276\356\276\004\032\357\\\351{\272\313\367\275?R\361c\007\327\024*\024\237kQ\342L\264\357\021\025\217\372V\251X\355{M\305\353>\215\n\255\317\240\302\350{\026@\361,\260D\305R\340\r\025o\0022\025r@\243B\013\030T\030\201G\373i\261\375\013T,\354\177\272\377\277\3005\030\231\337\334\337p?\335\3257\334\215\367X\371\237=\017\351\n\017{\347\251\230\357}J\305\323\336gT<\353\375\231\212\237{e*\344\336\024\025)\377\316Y*\262\275\177P\361G\257w\365\247T<\355[\244b\261/FE\254/IE\262\357-\025o\373\362T\344}zlR\261\331\027\245;G\003O\250x\022X\244b1\360\234\212\347\201\025*V\002\n\025J CE&\220\r4\331M\337](\376\275\\[\335\2166\332[bMv\237\004\266_\206\347z\254z\016\021\361\312v\360\257S\364\016<Y\221\201M\301\273\2134\267\246\257/\021\316&\245\267c\215\366\026\331\r\274\344\364\322\177\026\264\016\375\333a5\331X\270\263\177\302\277?\302-\273\303j7\260\352\256\276\372\037\035\261K\370\374\271#za\263\273\357^\365\376\366Q\034U\374\324\"\302v\202~5\022\242\337?\034@\\\314>\010\305\2303\354\361\032\210\034\023\254\005A\337\021\376\203B7\262\242\217\235\3638\305\004\\\321\027\360\326\037\327\302\020\005\372\002%\036C#\342w'-\223\310\341\277\205 l\003\241\350\031\304\n\341Z\3603c\307q\241\0030`\377\355\261\177\347\0144\366%G\345\237\037\322\360\177\0332\007\213)3u\335\300\005'\341^\372\266Z\020\202pV|\001\367\263\271C\225\345\352\241Z\250\321\322\360Km\244vg;\262\343\034\r[G`\217\267(/\306\331>\277e\303\211\201\355\303'\350\213!|\007\372\230v6\354\274\007\216s.b\204?\002\376\345)\ro\010\373\"\3743\003\230\003\nZo~\215\010\223\036\037z\032\201\323v\301\225\256\301%\275W{\353\306\226\352\201Qw\364Z\245\037\2760\377$\351w\n\320\352\375\270\254\373\035l[\316\315i\236+\322m\252\365-\253Z\244e&<L\367\372\\\355\231\273\264\374\251\211\017\234)\372\266\3242\361Z\245\307\215<\254M\273\317c\237\232x\337\351\347\334Es\342\325r\301\275\366]\355\310\266\374\251y_\333O8\201\321\234G\277v\372\241z""\244&\357\370Za\221,\214\316\316\257\310\211\264\2712?\0335\323\t\371\377\000\325\251\237\324";
    PyObject *data = __Pyx_DecompressString(cstring, 7687, 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 (17596 bytes) */
const char* const bytes = "Automatic adding of chromosomes can  only be used with storage type 'step' or 'stretch'.Cannot assign to zero-length interval.Cannot extend an interval to include None.Cannot extend an interval to include an interval on another chromosome.Cannot extend an interval to include an interval on another strand.Cannot subset to zero-length interval.Chromosome name mismatch.Illegal CIGAR string '%s'Illegal base letter encountered.Illegal index typeIllegal index type.Illegal quality scale '%s'.Illegal storage mode.Inconsistent CIGAR operation.Indefinite-length chromosomes can  only be used with storage type 'step' or 'stretch'.([MIDNSHP=X])Malformatted SAM optional field '%'Malformed SAM line: MRNM == '*' although flag bit &0x0008 clearedMalformed SAM line: RNAME == '*' although flag bit &0x0004 clearedNon-stranded index used for stranded GenomicArray.NoneNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.Paired-end readPlease Install PySam to use this functionality (http://code.google.com/p/pysam/)Quality string has not the same length as sequence.Quality string missing.Quality string missingRequired assignment signature not yet implemented.SAM line does not contain at least 11 tab-delimited fields.SAM optional field tag %s not foundSAM optional field tag %s not uniqueSAM optional field with illegal type letter '%s'Sequence in SAM file contains '=', which is not supported.Sequence in SAM file contains '.', which is not supported.Start of interval is after its end.Strand mismatch.Strand must be'+', '-', or '.'.Strand must be specified for stranded GenomicArray.Strand specified in unstranded GenomicArray.The new interval must match the current strandednessToo large quality value encountered.Typecode not supported: Unknown CIGAR code '%s' encountered.:/, >+-\t<\n\n\r)> @+\n< : ) >=', [ '*?,'>:[)/.':add_note' aligned to assignment to qual with illegal ""shapeauto-write base(s) 'chroms' must be a list or a dict or 'auto'.'count_array' has too few columns.'count_array' too small for sequence.disableenablegchard-clippedheader line with 'track type=bedGraph' not found.isenabled' (length .nmm', not aligned>numpy._core.multiarray failed to importnumpy._core.umath failed to import object ' object,  object:  on ref iv [part]pyBigWig is required to write a GenomicArray to a bigWig filequal can only be assigned a numpy array of type numpy.uint8, query iv ['quote' must be length 1>%s\n@%s\n'seq' and 'qualstr' do not have the same length.sequence-matchedsequence-mismatchedsoft-clippedsolexa-old'split' must be length 1src/HTSeq/_HTSeq.pyxstart is larger than endstart too smallstop too large), strand ', strand '<stringsource>track type=bedGraph\ntrack type=bedGraphtrack type=bedGraph %s\nunmatched quotew+AAlignedReadAlignedSegmentAlignmentAlignmentWithSequenceReversalAlignmentWithSequenceReversal.__reduce_cython__AlignmentWithSequenceReversal.__setstate_cython__Alignment.__reduce_cython__Alignment.__setstate_cython__BigWig_ReaderBowtieAlignmentBowtieAlignment.__reduce_cython__BowtieAlignment.__setstate_cython__CChromVectorChromVector.__reduce__ChromVector._create_viewChromVector.applyChromVector.createChromVector.extend_to_includeChromVector_stepsChromVector.steps_ChromVector_unpickleChromVector.valuesCigarOperationCigarOperation.__reduce_cython__CigarOperation.__setstate_cython__CigarOperation.checkDGGenomicArrayGenomicArray.__reduce__GenomicArray.add_chromGenomicArray.from_bedgraph_fileGenomicArray.from_bigwig_fileGenomicArray_stepsGenomicArray.steps_GenomicArray_unpickleGenomicArray.write_bedgraph_fileGenomicArray.write_bigwig_fileGenomicIntervalGenomicInterval.__copy__GenomicInterval.__reduce__GenomicInterval.containsGenomicInterval.copyGenomicInterval.extend_to_includeGenomicInterval_from_directionalGenomicInterval.is_contained_inGenomicInterval.overlapsGenomicInterval_rangeGenomicInterval.rangeGenomicInterval.range_dGenomi""cInterval_rangedGenomicPositionGenomicPosition.__reduce__GenomicPosition.copyHHTSeqHTSeq.StretchVectorHTSeq._HTSeq_HTSeq_internalIInfMNOP__Pyx_PyDict_NextRefReadSSAM_AlignmentSAM_Alignment.__reduce_cython__SAM_Alignment.__setstate_cython__SAM_Alignment.from_SAM_lineSAM_Alignment.from_pysam_AlignedReadSAM_Alignment.from_pysam_AlignedSegmentSAM_Alignment.get_sam_lineSAM_Alignment.has_optional_fieldSAM_Alignment.optional_fieldSAM_Alignment.raw_optional_fieldsSAM_Alignment.to_pysam_AlignedReadSAM_Alignment.to_pysam_AlignedSegmentSequenceSequenceWithQualitiesSequenceWithQualities.add_qual_to_count_arraySequenceWithQualities.get_fastq_strSequenceWithQualities.get_reverse_complementSequenceWithQualities.trim_left_end_with_qualsSequenceWithQualities.trim_right_end_with_qualsSequenceWithQualities.write_to_fastq_fileSequence.__getstate__Sequence.__reduce__Sequence.__setstate__Sequence.add_bases_to_count_arraySequence.get_reverse_complementSequence.trim_left_endSequence.trim_right_endSequence.write_to_fasta_fileStepVectorStretchVectorStringIOTXZ_aaddaddEntriesaddHeaderadd_bases_to_count_arrayadd_chromadd_qual_to_count_arrayaddvalaendalignedalnmtappendapplyargsarrayasyncio.coroutinesautobase_to_columnbowtie_linebufsizebuild_cigar_listbwccStringIOcharacters_per_linecheckchromchrom_dictchrom_vectorschromscigarcigar_operation_code_dictcigar_operation_codescigar_operation_namescigar_pairscigar_stringcigarlistcigartuples__class____class_getitem__clearcline_in_tracebackcloseclscodecollectionscompileconstrcontainsconvert_to_phredcopcopy__copy__count_array_create_create_viewcsvcvddecodedeleteddescr__dict___dictdtypeemptyencodeendend_dends__enter__entriesentryenumerate__exit__extend_to_includeffasta_filefastq_filefieldfieldsfile_or_filenamefilenamefirstflagflagintfrom_SAM_linefrom_bedgraph_filefrom_bigwig_filefrom_pysam_AlignedReadfrom_pysam_AlignedSegmentfun__func__gaget_fastq_strget_reverse_complementget_sam_linegetrname__getstate__gettidgetvaluegziphas_optional_fieldheaderi__iadd____""iadd__.<locals>.addvalindex__init__insertedintervalsis_contained_in_is_coroutineis_duplicateis_pairedis_proper_pairis_qcfailis_read1is_read2is_reverseis_secondaryis_supplementaryis_unmappedis_vector_of_setsisizeitemsitertoolsivjoinkeyllengthlinelog10__main___make_translation_table_for_complementationmaketransmapping_qualitymapqmatchedmate_alignedmate_is_reversemate_is_unmappedmate_startmathmax_mm_qualmaxsizememmapmemmap_dirmismatch_propmissingmode__module__mposmrnm__name__namencvndarray__new__newentrynext_reference_idnext_reference_startnonenoqualsnot_paired_endnumpyoffsetopopenoptional_fieldoptional_fieldsosoverlapsppaddedpaired_endparse_cigarpathpatternphredpopposposintpyBigWigpysam__pyx_checksum__pyx_result__pyx_state__pyx_type__pyx_unpickle_Alignment__pyx_unpickle_AlignmentWithSequenceReversal__pyx_unpickle_BowtieAlignment__pyx_unpickle_CigarOperation__pyx_unpickle_SAM_Alignment__pyx_vtable__qfromqlenqnameqtoqual__qualname__qualscalequalstrquery_namequery_qualitiesquery_sequencequery_startquotequotesafe_splitrrangerange_drawraw_optional_fieldsre_re_cigar_codesreadread_as_aligned__reduce____reduce_cython____reduce_ex__ref_ivref_leftreference_endreference_idreference_startrenameresrevcomp_of_reverse_complementrfromrlenrnamerstriprtossamfilesecondselfsepseparatorseq__set_name__setdefault__setstate____setstate_cython__sfshapesiosizeskippedsolexasplitstartstart_dstart_indexstartdiffstartswithstatestderrstepstepsstopstorage_storagestrandstrandedstretchswqsystagtagstctemplate_length__test__tidto_pysam_AlignedReadto_pysam_AlignedSegmenttrack_optionstranslatetrim_left_endtrim_left_end_with_qualstrim_right_endtrim_right_end_with_qualstype_typetypecodeuint8unknownunnamedupdateupperuse_setstatevvaluevaluesvecwwarningswritewrite_bedgraph_filewrite_bigwig_filewrite_bigwig_file.<locals>.write_with_bufferwrite_to_fasta_filewrite_to_fastq_filewrite_with_bufferxyzeros ;\"\320\0000\3200B\300!\330\004\022\220!\330\004\021\220\021\330\004\033\2301\330\004\031\230\021\330\004\026""\220a\330\004\030\230\005\230Q\230a\330\004\030\230\005\230Q\230a\330\004\007\200s\210!\2107\220#\220Q\330\010\016\210j\230\001\230\021\330\004\007\200s\210!\2107\220#\220Q\330\010\016\210j\230\001\230\021\330\004\n\210#\210Q\210c\220\023\220A\330\010\013\2103\210a\210s\220#\220Q\330\014\027\220t\2301\330\016\022\220*\230D\240\003\2401\240C\240s\250!\330\014\r\210W\220A\220Q\220a\220}\240A\330\014\032\230\"\230B\230a\330\010\r\210Q\330\004\005\200W\210A\210Q\210a\210q\330\004\007\200q\330\010\016\210j\230\001\230\021\330\004\013\2101\200\001\330\004;\2701\270F\300!\200\001\330\004+\2501\250F\260!\320\0042\260!\360\010\000\t\020\210\177\320\0364\260A\260V\2701\320\0042\260!\330\010\016\210i\220y\240\001\330\010\014\320\014 \240\001\240\025\240a\330\010\017\210s\220)\2301\200\001\360\010\000\005\014\2103\210d\220\"\220J\230a\230q\320\0044\260A\360\010\000\t\020\210\177\320\0365\260Q\260f\270A\200\001\330\004\013\2105\220\n\230!\230=\250\001\320\0006\260m\300?\320RS\360\010\000\005\023\220/\240\026\240q\250\001\330\004\007\200{\220\"\220C\220s\230#\230S\240\003\2401\240M\260\022\2602\260S\270\001\330\010\016\210j\230\001\320\0315\260R\260q\330\004\t\210\021\330\004\010\210\005\210U\220!\2203\220a\220}\240C\240q\330\010\t\330\014\023\2203\220a\220{\240!\2402\240R\240q\330\017\020\330\014\022\220*\230A\320\0359\270\022\2701\330\010\017\210{\230!\2302\230R\230r\240\022\2401\330\010\n\210'\220\022\2206\230\021\330\004\013\320\013\033\2301\230D\240\n\250'\260\021\320\0148\270\001\330\020\023\2209\230G\2401\330\024\030\230\007\230q\330\030\037\230q\240\004\240G\2501\250H\260A\260Q\330\020\023\2203\220a\220y\240\003\2401\330\024\026\220k\240\021\330\030\037\230q\240\n\250'\260\021\260!\330\030\035\230W\240A\240Y\250g\260W\270A\270Q\340\024\030\230\007\230q\330\030\037\230q\240\004\240F\250!\200A\3309G\300q\360 \000\t\014\2107\220!\320\023%\240Q\330\014\020\220\001\340\014\020\220\004\220A\320\025'\240q\340\010\t\340\014\025\220Q\330\014\020\220\010\230\001\330\020\023\2204""\220{\240!\2401\330\024\025\330\020\026\220g\230Q\230a\340\020\026\220g\230Q\330\024\025\360\010\000\r\025\220C\220q\330\020\021\330\020\031\230\027\240\003\2401\330\020\031\230\021\330\020\030\230\001\330\020\027\220r\230\025\230a\230q\360\010\000\r\021\220\010\230\001\330\020\027\220w\230e\2408\2504\250w\260a\260w\270f\300A\330\020\027\220v\230S\240\001\240\030\250\023\250A\250Q\330\020\023\2209\230D\240\005\240Q\330\024\034\230C\230q\240\001\330\025\036\230c\240\021\330\024\034\230E\240\021\240!\340\024\032\230*\240A\320%?\270q\300\001\340\020\025\220_\240A\240W\250G\2605\270\007\270q\330\020\025\220Q\220f\230A\360\010\000\r\020\210t\2207\230!\320\033-\250Q\330\020\021\220\026\220q\340\010\017\210q\200A\330RS\3600\000\t\017\210c\220\021\330\010\013\2106\220\021\340\010\013\2108\2203\220a\330\014\017\210y\230\003\2301\330\020\023\2209\230E\240\026\240q\250\007\250r\260\033\270F\300!\340\020\023\2209\230E\240\026\240q\250\007\250r\260\033\270F\300!\330\020\023\2206\230\026\230q\340\r\025\220S\230\001\330\014\017\210y\230\005\230W\240A\330\020\027\220r\230\021\330\020\026\220a\330\020\031\230\022\2305\240\005\240Q\330\024\025\330\024\026\220g\230R\230r\240\030\250\022\2503\250a\250r\260\030\270\022\2701\330\030\032\230#\230Q\230b\240\t\250\022\2501\330\020\025\220Q\340\r\025\220S\230\001\330\014\017\210y\230\n\240+\250W\260A\330\020\031\230\021\340\r\025\220S\230\001\330\014\017\210y\230\r\240Q\330\024\035\230Q\360\010\000\r\023\220*\230A\230Q\340\010\013\210<\220q\330\010\013\210<\220q\360\006\000\t\014\210:\220R\220q\330\010\013\320\013 \240\001\330\010\013\210>\230\021\330\010\017\210q\200\001\330\004,\250A\250V\2601\200A\330\010\017\210\177\320\0360\260\001\260\021\200A\360\024\000\t\020\210\177\320\0361\260\021\260!\320\004<\270A\330\010\013\2101\330\014\023\2208\2301\330\020\"\240!\2404\240q\330\020\036\230b\240\004\240A\340\014\023\2208\2301\330\020\"\240!\2404\240q\330\020\024\220A\200A\340\010\013\2102\210X\220S\230\001\330\014\022\220*\230A\230Q\330\010""\014\210C\210q\330\010\t\210\026\210q\330\010\t\210\031\220#\220Q\330\010\t\210\032\2203\220a\330\010\t\320\t\036\230c\240\021\330\010\t\210\034\220S\230\001\330\010\017\210q\200A\330\010\013\2102\210X\220S\230\004\230C\230q\330\014\022\220*\230A\330\020\021\360\010\000\t\022\220\024\220S\230\001\330\010\027\220q\230\004\230C\230w\240b\250\002\250(\260!\330\010\014\210C\320\017!\240\021\240!\330\010\014\210J\220d\230#\230Q\360\006\000\t\014\2104\210z\230\023\230A\330\014\017\210t\220:\230S\240\001\330\020\030\230\005\230V\2401\240G\2504\250s\260+\270V\3004\300q\340\020\030\230\005\230V\2401\240G\2504\250s\260+\270V\3004\300q\330\020\025\220V\2301\330\014\021\220\021\220+\230Z\240r\250\032\2604\260v\270Q\330\r\021\220\032\2303\230a\330\014\024\220E\230\027\240\001\330\020\027\220t\2303\230k\250\026\250t\2601\330\020\031\230\022\2305\240\005\240Q\330\024\030\230\001\330\024\030\230\003\2307\240\"\240D\250\003\2508\2602\260S\270\001\270\024\270S\300\010\310\002\310!\330\030\032\230#\230Q\230d\240#\240Y\250b\260\001\330\020\025\220Q\340\014\021\220\021\220+\230Z\240r\250\032\2604\260v\270Q\360\014\000\r\025\220D\230\001\330\010\014\210I\220Q\200A\340\010\013\2103\210c\220\021\330\014\022\220)\2301\230A\330\010\013\2104\210w\220c\230\022\2301\330\014\022\220*\230A\230Q\330\010\013\2104\210x\220w\320\036.\250d\260\"\260H\270G\320CS\320ST\330\020\024\220H\230G\2402\240Q\330\014\022\220*\230A\230Q\330\010\014\210L\230\001\230\024\230X\240R\240q\330\010\014\210J\220a\220t\2306\240\022\2401\200A\360\024\000\t\014\2103\210c\220\021\330\014\023\2201\330\010\013\2104\210w\220c\230\022\2301\330\014\023\2201\330\010\013\2104\210x\220w\320\036.\250d\260\"\260H\270G\320CS\320ST\330\020\024\220H\230G\2402\240Q\330\014\023\2201\330\010\013\2104\210w\220c\230\022\2301\330\014\023\2204\220u\230B\230b\240\001\340\014\023\2202\220U\230\"\230D\240\001\200A\360\026\000\t\014\2103\210c\220\021\330\014\023\2201\330\010\013\2104\210w\220c\230\022\2301\330\014\023\2201\330\010\013\2104\210y""\230\007\320\037/\250t\2602\260X\270W\320DT\320TU\330\020\024\220H\230G\2402\240Q\330\014\023\2201\330\010\013\2104\210w\220b\230\002\230'\240\023\240D\250\005\250R\250r\260\021\330\014\023\2201\330\010\017\210q\200A\360\014\000\t\014\2103\210c\220\021\330\014\023\2201\330\010\017\210r\320\021!\240\021\240!\200A\330\010\031\230\021\360\010\000\t\014\2104\210q\330\014\032\230$\230a\340\014\032\230/\250\021\250&\260\001\340\010\013\2104\210|\2307\240!\330\014\031\230\024\230Q\340\014\031\230\037\250\001\250\026\250q\340\010\013\2104\210w\220g\230Q\330\014\020\220\007\220t\2301\330\020\031\230\023\230A\230S\240\007\240r\250\023\250A\340\014\024\220A\340\010\017\210t\2205\230\001\330\021\025\220U\230!\330\021\024\220A\220T\230\021\330\021\034\230A\330\021\024\220A\220[\240\007\240r\250\021\330\021\024\220A\220T\230\021\330\021\022\330\021\033\2301\330\021\024\220A\220Z\230u\240B\240a\330\021\024\220A\220T\230\021\330\021\025\320\025%\240T\250\027\260\001\330\021\025\320\025%\240X\250W\260A\330\021\025\220U\230!\2304\320\0373\2601\200A\330\010\013\2107\220!\2206\230\031\240$\240d\250'\260\027\270\001\330\014\026\220f\230A\230^\2504\250w\260d\270!\340\014\026\220f\230A\230X\240R\240t\2501\330\010\022\220&\230\001\230\024\230T\240\027\250\003\2502\250Q\330\010\022\220&\230\001\230\021\330\010\022\220&\230\001\230\024\230X\240W\250C\250r\260\021\210A\330\020\024\220A\220U\230!\330\020\021\220\024\220Q\220a\330\020\027\220q\200A\340\010B\300!\330\010\036\230c\240\021\240$\240a\340\010\020\220\r\230Q\230l\250!\2503\250b\260\001\330\014\022\220*\230A\230Q\330\010\020\220\r\230Q\230l\250!\2503\250b\260\001\330\014\022\220*\230A\230Q\360\010\000\t \230t\2401\330\010\014\210E\220\025\220a\220q\330\014\020\220\010\230\001\230\021\330\014\017\210r\220\024\220V\2301\330\020\033\2301\230C\230v\240Q\330\021\023\2204\220v\230Q\330\020\033\2301\230C\230v\240Q\330\021\023\2204\220v\230Q\330\020\033\2301\230C\230v\240Q\330\021\023\2204\220v\230Q\330\020\033\2301\230C\230v\240Q\330\021""\023\2204\220v\230V\2401\330\020\033\2301\230C\230v\240Q\340\020\026\220j\240\001\240\021\340\010\017\210q\200A\360\006\000\tC\001\300!\330\010\013\2104\210z\230\023\230A\330\014\020\220\017\230q\330\010A\300\024\300Q\340\010.\250m\2701\270K\300q\310\001\330\010-\250]\270!\270<\300q\310\001\340\010\013\210;\220g\230]\250!\250<\260q\270\001\330\014\022\220*\230A\230Q\360\010\000\t\r\210E\220\025\220a\220q\330\014\020\220\n\230!\2301\330\014\017\210r\220\023\220A\330\020\026\220j\240\001\240\021\330\014\027\220q\230\003\2306\240\021\340\010\017\210q\200A\330\010\014\210D\220\t\230\024\230V\2401\330\014\020\220\006\220a\220r\230\027\240\002\240$\240i\250r\260\025\260a\330\027\033\230;\240c\250\021\250!\200A\360\016\000\t\r\210E\220\024\220Q\330\014\017\210q\220\001\220\023\220C\220q\330\020\027\220q\330\010\017\210q\200A\330\010\014\210G\2205\230\001\230\021\330\010\014\210H\220E\230\021\230!\330\010\014\210I\220U\230!\2301\200A\330\010\030\230\004\230J\240b\250\004\250A\330\010\030\230\004\230G\2401\330\010\013\2104\210v\220S\230\004\230C\230t\2406\250\023\250D\260\003\2604\260v\270S\300\001\330\014\017\210u\220E\230\023\230D\240\006\240d\250%\250s\260$\260a\330\020\027\220q\330\r\021\220\026\220s\230$\230c\240\024\240V\2503\250a\330\014\017\210u\220E\230\023\230D\240\006\240d\250%\250s\260!\330\020\027\220q\330\r\021\220\026\220s\230$\230c\240\024\240V\2503\250a\330\014\017\210u\220E\230\023\230B\230d\240%\240s\250$\250a\330\020\027\220q\330\r\021\220\026\220s\230$\230c\240\024\240V\2503\250a\330\014\017\210u\220E\230\023\230B\230d\240%\240s\250!\330\020\027\220q\340\014\023\2201\330\010\017\210q\200A\330\010\020\320\020)\250\024\250[\270\004\270K\300t\3101\200A\330\010\020\220\004\220M\240\024\240V\2504\250x\260t\270=\310\001\200A\340\010\021\220\027\230\004\320\034-\250Q\330\010\013\2104\210t\2201\330\014\024\220G\2309\240A\240T\250\021\330\014\021\220\037\240\001\240\027\250\004\250A\330!%\320%5\260Q\340\014\021\220\021\360\n\000\t\032\230\024\230Q\330\010\014""\210O\2303\230f\240D\250\017\260s\270!\330\014\035\230Q\330\010\031\230\036\240w\250a\360\014\000\t\r\210D\220\006\220c\230\026\230t\2404\240v\250S\260\001\330\014\022\320\022'\240q\330\020 \240\004\240M\260\021\330\020\021\340\014\022\320\022'\240q\330\020 \240\004\240H\250D\260\005\260W\270A\360\006\000\t\r\210M\230\021\230%\230q\330\010\t\210\031\320\022\"\240!\2402\320%:\270!\2707\300(\310!\330\014\022\220+\230T\240\037\260\004\3204F\300g\310[\320X[\320[^\320^h\320hi\330\010\t\320\t!\240\024\240Q\330\010\t\210\031\220$\220a\330\010\t\210\030\220\024\220Q\330\010\t\210\037\230\004\230A\330\010\t\320\t\"\240$\240a\330\010\t\320\t\037\230t\2401\330\010\t\320\t%\240T\250\021\330\010\t\320\t\032\230$\230a\330\010\t\320\t\036\230a\330\010\t\320\t\034\230D\240\001\330\010\013\2104\210q\340\014\020\220\004\220D\320\030+\2505\260\004\260F\270$\270a\330\020\031\230\027\240\004\320$:\270!\330\020\021\220\036\230\177\250a\250w\260i\270q\330\024\030\230\010\240\004\320$;\2701\340\020\021\220\036\230q\330\014\017\210t\2201\330\020\021\220\034\230V\2401\240A\330\021\025\220Q\330\020\021\220\034\230V\2401\240A\340\020\021\220\034\230V\2401\240A\340\014\r\210\\\230\026\230q\240\001\330\010\017\210q\200A\340\010\021\220\027\230\004\320\034-\250Q\330\010\013\2104\210t\2201\330\014\024\220G\2309\240A\240T\250\021\330\014\021\220\037\240\001\240\027\250\004\250F\260$\260g\270Q\340\014\021\220\021\330\010\014\210D\220\006\220c\230\026\230t\2404\240v\250S\260\001\330\014\022\320\022'\240q\330\020\024\220O\2407\250$\250d\260(\270!\330\020\021\340\014\022\320\022'\240q\330\020\024\220O\2407\250$\250d\260(\270$\270e\3007\310!\360\006\000\t\r\210M\230\021\230%\230q\330\010\t\210\031\320\022\"\240!\2402\320%:\270!\2707\300(\310!\330\014\022\220+\230T\240\031\250$\250f\260G\270;\300c\310\023\310J\320VW\330\010\t\320\t!\240\024\240Q\330\010\t\210\031\220$\220a\330\010\t\210\030\220\024\220Q\330\010\t\210\037\230\004\230A\330\010\t\320\t\"\240$\240a\330\010\t\320\t\037\230t\2401\330\010\t""\320\t%\240T\250\021\330\010\t\320\t\032\230$\230a\330\010\t\320\t\036\230a\330\010\t\320\t\034\230D\240\001\330\010\013\2104\210q\340\014\020\220\004\220D\320\030+\2505\260\004\260F\270$\270a\330\020\031\230\027\240\004\320$:\270!\330\020\021\220\036\230\177\250a\330\024\033\2309\240A\240T\250\030\260\024\260W\270A\340\020\021\220\036\230q\330\014\017\210t\2201\330\020\021\220\034\230V\2401\240A\330\021\025\220Q\330\020\021\220\034\230V\2401\240A\340\020\021\220\034\230V\2401\240A\340\014\r\210\\\230\026\230q\240\001\330\010\017\210q\200A\360\006\000\024\025\360.\000\t\n\330\023\024\330\017\020\330\014\022\220+\230Q\330\020\021\360\006\000\t\r\210D\220\004\220K\230t\2407\250#\250Q\330\014\022\220*\230A\230Q\330\010\013\2104\210z\230\024\230W\240H\250M\270\021\330\014\022\220*\230A\230Q\340\r\025\220U\230!\230:\240X\250Q\340\014\025\220Q\330\014\020\220\t\230\024\230Q\330\020\025\220T\230\036\240q\250\006\250a\250q\330\020\026\220b\230\003\2301\330\020\026\220g\230R\230w\240a\330\014\016\210j\230\001\230\021\360\006\000\r\030\220y\240\004\240I\250T\260\030\270\024\270Z\300q\330\014\026\220a\340\0148\270\001\360\030\000\r\021\220\t\230\024\230Q\330\020\025\220T\230\036\240q\250\006\250a\250q\330\020\024\220D\230\t\240\022\2406\250\021\330\024\027\220r\230\027\240\003\2401\240C\240y\260\002\260\"\260C\260r\270\025\270c\300\023\300A\330\030\031\340\024\025\330\030!\240\021\330\030!\240\022\2401\330\030 \240\002\240!\330\030\"\240!\340\024%\240Q\240d\250)\2609\270I\300Q\340\014\035\230Q\230d\240)\2508\2601\200A\330/=\270Q\360\036\000\t\n\330\023\024\330\017\020\330\014\022\220+\230Q\330\020\021\360\010\000\t\016\210]\230!\340\r\032\230!\230=\250\001\330\014\031\230\024\230Q\230b\240\007\240q\360\006\000\r\025\220C\220q\330\020\021\330\020\031\230\027\240\003\2401\330\020\031\230\021\330\020\030\230\001\360\006\000\r\021\220\t\230\021\330\020\034\230B\230j\250\001\250\027\260\004\260A\330\020\024\220D\230\007\230u\240J\250i\260q\270\001\360\010\000\025\030\220r\230\023""\230A\330\030\035\230^\2501\250F\260!\2607\270*\300A\330\030\035\230^\2501\250F\260!\2607\270#\270Y\300a\360\014\000\025\032\230\036\240q\250\006\250a\250w\260a\260w\270g\300Q\340\010\017\210q\200A\330[\\\330\010\032\230#\230Q\230d\240!\330\010\032\230#\230Q\230g\240Q\340\010\013\2107\220\"\220A\330\014\025\220Q\340\014\025\220Q\330\010\037\230t\2401\330\010\037\230w\240a\330\010\031\230\021\360\006\000\t\014\2104\210z\230\023\230A\330\014\020\220\017\230q\330\010A\300\024\300Q\330\010\014\210E\220\025\220a\220s\230'\240\022\2401\330\014\035\230Q\330\014\020\220\005\220U\230!\2301\330\020\023\2208\2301\230C\230s\240(\250!\2507\260\"\260B\260b\270\001\330\024#\240:\250Q\250a\330\024\027\220|\2402\240Q\330\030\031\340\020\030\230\001\330\010\017\210t\2201\220G\2301\200A\330\\]\330\010\032\230#\230Q\230d\240!\330\010\032\230#\230Q\230g\240Q\340\010\013\2107\220\"\220A\330\014\025\220Q\340\014\025\220Q\330\010\037\230t\2401\330\010\037\230w\240a\330\010\031\230\021\360\006\000\t\014\2104\210z\230\023\230A\330\014\020\220\017\230q\330\010A\300\024\300Q\330\010\014\210E\220\025\220a\220s\230'\240\022\2401\330\014\032\230!\330\014\020\220\005\220U\230!\2301\330\020\023\2208\2301\230G\2402\240R\240r\250\023\250C\250x\260q\270\001\330\024#\240:\250Q\250g\260R\260r\270\022\2701\330\024\027\220|\2402\240Q\330\030\031\340\020\030\230\001\330\010\017\210t\2201\220C\220w\230b\240\001\200A\360\024\000\t\022\220\024\220W\230B\230f\240A\240Q\330\010\013\2103\210a\210x\220r\230\021\330\014\022\220*\230A\230Q\330\t\020\220\006\220g\230U\240&\250\007\250v\260V\2701\330\t\016\210h\220f\230A\230R\230q\330\010\032\230&\240\001\240\021\340\010\013\2103\210f\220A\220U\230\"\230A\330\014\022\220*\230A\230Q\330\010\013\2103\210f\220A\220U\230\"\230A\330\014\022\220*\230A\230Q\330\010\022\220#\220Q\220a\340\010\013\2108\2202\220Q\330\014\021\220\021\330\014\030\230\001\340\014\017\210v\220S\230\001\330\020\026\220j\240\001\240\021\340\014\025\220S\230\001\230\025\230b\240\001\330\014\017\210x""\220r\230\021\330\020\031\230\021\340\020\031\230\021\330\014\030\230\013\2401\240G\2508\2607\270!\330\014\021\220\037\240\001\330\020\027\220x\230y\250\002\250\"\250G\2606\270\021\340\010\013\2105\220\003\2201\330\014\022\320\022'\240q\330\020\023\2206\230\022\2307\240$\240g\250T\260\026\260r\270\027\300\001\340\014\022\320\022'\240q\330\020\023\2206\230\022\2307\240$\240g\250U\260!\340\010\020\220\r\230Q\230e\2401\330\010\r\210X\220Q\330\010\r\210Y\220a\330\010\r\320\r \240\001\330\r\022\220\"\220D\320\0307\260q\270\010\300\004\300I\310Q\330\010\r\210Y\220c\230\021\230!\330\010\r\320\r%\240S\250\001\250\021\330\010\r\320\r\"\240!\340\010\013\2108\2202\220Q\330\014\017\210x\220r\230\021\330\020\025\220^\2401\340\020\023\2205\230\003\2301\330\024\032\230*\240A\240Q\330\020\031\230\023\230A\230V\2402\240Q\330\020\023\2208\2302\230Q\330\024\035\230Q\340\024\035\230Q\330\020\025\220^\240?\260!\2606\270\030\300\021\330\020\023\2205\230\013\2407\250#\250Q\330\024\027\220u\230D\240\007\240q\330\030\035\230[\250\t\260\025\260c\270\021\330\014\017\210x\220r\230\021\330\020\025\220\\\240\026\240q\250\001\330\021\031\230\022\2301\330\020\025\220\\\240\026\240q\250\001\340\020\025\220\\\240\026\240q\250\001\340\014\021\220\036\230q\330\014\021\220\034\230V\2401\240A\340\010\r\210_\230H\240B\240g\250R\250q\330\010\r\320\r&\240h\250b\260\007\260r\270\021\330\010\r\320\r#\2408\2502\250W\260B\260a\330\010\r\320\r)\250\030\260\022\2607\270\"\270A\330\010\r\320\r\036\230h\240b\250\007\250r\260\021\340\010\017\210q\200A\330\010\017\320\017!\240\024\240X\250T\260\030\270\024\270Q\330!%\240Q\200A\330\010\017\320\017!\240\024\240X\250T\260\026\260t\2701\200A\360\006\000\024\025\330\032\033\330\026\027\360*\000\t\017\210a\340\010\014\210D\220\004\220K\230t\2407\250#\250Q\330\014\022\220*\230A\230Q\330\010\013\2104\210z\230\024\230W\240H\250M\270\021\330\014\022\220*\230A\230Q\330\010\013\2107\220!\320\023%\240Q\330\014\020\220\001\340\014\020\220\004\220A\320\025'\240q\340\010\t\330\014""\017\210t\2201\330\020\021\220\026\220q\230\004\230A\330\020\023\2204\220t\2307\240)\2501\250A\330\024\025\220V\2301\230A\330\014\017\210~\230S\240\001\330\020\021\220\026\220q\230\001\340\020\021\220\026\220q\320\0303\2602\260Q\330\014\020\220\t\230\024\230Q\330\020\024\220D\230\t\240\024\240^\2601\260F\270!\2707\300&\310\001\330\024\027\220r\230\027\240\003\2401\240C\240y\260\002\260\"\260C\260r\270\025\270c\300\023\300A\330\030\031\330\024\025\220V\2301\330\030\033\2305\240\001\330\035\037\230x\240s\250!\2502\250Y\260c\270\021\270\"\270G\3003\300a\300q\330\035\036\230a\360\010\000\r\020\210t\2207\230!\320\033-\250Q\330\020\021\220\026\220q\200A\330\010\016\210a\330\010\014\210F\220$\220a\330\014\017\210r\220\021\220\"\220K\230s\240!\330\020\023\2203\220a\220r\230\021\230$\230c\240\021\330\024\031\230\021\340\024\031\230\021\330\021\023\2201\220B\220k\240\023\240A\330\020\025\220Q\330\021\023\2201\220B\220k\240\023\240A\330\020\025\220Q\340\020\025\220Q\330\014\017\210w\220a\220s\230%\230q\240\001\240\022\2401\240D\250\004\250C\250q\260\002\260!\2601\330\010\017\210q\200A\330\010\016\210a\210r\220\024\220U\230$\320\036/\250s\260!\2601\260C\260s\270!\330\010\013\2103\210a\210u\220C\220q\330\014\023\2203\220a\220r\230\021\230!\340\014\017\210s\220!\2205\230\003\2301\330\020\026\220h\230a\320\037E\300R\300q\340\020\026\220j\240\001\320!H\310\002\310!\200A\330\010\017\210\177\230a\230t\2408\2504\250v\260T\270\021\200A\330\010\017\210\177\230a\230t\2408\2504\250x\260t\2706\300\024\300Q\200\001\330\004\t\210\033\220A\330\004\006\200i\210q\330\004\006\200f\210A\330\004\006\200j\220\001\330\004\006\320\006\033\2301\330\004\006\200l\220!\330\004\013\2101\200A\330\010\017\210t\2201\220D\230\006\230a\230t\2403\240g\250R\250t\2609\270D\300\003\3005\310\002\310$\310a\200A\330\010\020\220\007\220t\2301\330\020\030\230\004\230A\330\020\031\230\024\230Q\200A\330\010\020\220\007\220t\230;\240a\330\010\017\210v\220R\220q\200A\330\010\017\210t\220;\230c\240\021\330\010\017\210q\330""\020\024\220H\230D\240\005\240T\250\031\260$\3206J\310$\310a\200A\330\010\t\330\023\024\330\017\020\330\014\017\210w\220f\230A\330\020\021\330\014\r\340\010\014\210E\220\037\240\001\330\010\t\320\t\033\2304\230u\240H\250D\260\004\260C\260u\270C\270t\3003\300h\310c\320QZ\320Z^\320^c\320cz\320z|\320|}\330\010\t\320\t\034\230D\240\005\240Y\250d\260$\260c\270\025\270c\300\024\300S\310\010\320PS\320S\\\320\\`\320`e\320e|\320|~\320~\177\330\010\t\210\036\220t\2305\240\001\330\010\t\210\030\220\024\220Q\330\010\t\210\030\220\024\220Q\330\010\013\2104\210q\330\014\r\210_\230B\320\0367\260q\270\001\270\030\300\021\300!\330\035!\240\025\240d\250!\330\014\r\320\r \240\004\240C\240q\330\014\r\320\r\035\230R\230w\240a\240t\2503\250a\330\014\r\320\r \240\004\240A\330\014\r\320\r \240\004\240A\340\014\r\320\r!\240\021\330\014\r\320\r\036\230a\330\010\013\2104\210q\330\014\r\320\r\"\240\"\240G\2501\250D\260\013\2701\330\014\r\320\r%\240T\250\033\260A\340\014\r\320\r#\2401\330\014\r\320\r&\240a\330\010\017\210q\200A\330\010\t\330\023\024\330\017\020\330\014\017\210w\220f\230A\330\020\021\330\014\r\340\010\014\210E\220\034\230Q\330\010\t\210\027\220\004\220E\230\021\330\010\t\210\030\220\024\220U\230!\330\010\t\210\031\220$\220e\2301\330\010\t\210\030\220\024\220Q\330\010\t\210\030\220\024\220Q\330\010\013\2104\210q\330\014\r\210Y\220b\320\0301\260\021\260!\2608\2701\270A\330\027\033\2305\240\004\240A\330\014\r\210W\220D\230\003\2301\330\014\r\210W\220B\220g\230Q\230d\240#\240Q\330\014\r\210Y\220d\230!\330\014\r\210X\220T\230\021\340\014\r\210X\220Q\330\014\r\210X\220Q\330\010\013\2104\210q\330\014\r\210X\220R\220w\230a\230t\240;\250a\330\014\r\210X\220T\230\033\240A\340\014\r\210Y\220a\330\014\r\210Y\220a\330\010\017\210q\320\004B\300!\360\020\000\t\014\2104\210w\220g\230Q\330\014\026\220f\230A\230^\2504\250w\260d\270!\340\014\026\220f\230A\230X\240R\240t\2501\340\010\013\320\013\037\230s\240!\330\014\026\220f\230A\230T\240\024\240W\250C\250r\260\021\340\014\020\220\001\330\014\022""\220\"\220B\320\026*\250\"\250C\250q\260\004\260A\330\020\032\230&\240\001\330\024\030\230\004\230A\230R\230r\320!7\260r\270\022\2703\270b\320@T\320T[\320[^\320^`\320`a\330\020\025\220Q\320\004I\310\021\340\010\013\2101\330\014\022\320\022'\240q\330\020\"\240!\2404\240q\330\020\036\230b\240\004\240A\330\020\024\220I\230T\240\021\330\020\024\220A\340\014\022\320\022'\240q\330\020\"\240!\2404\240q\330\020\024\220A\330\020\024\220I\230T\240\021\330\020\024\220A\330\010\013\2104\210z\230\027\240\001\330\014\017\210|\2304\230y\250\004\250A\330\010\017\210q\200\001\330\004\t\210\034\220Q\220d\230*\240A\330\004\006\320\006\027\220q\330\004\013\2101\200\001\330\004-\250Q\250f\260A\320\000S\320ST\330\004\r\210V\2201\220A\330\004\007\200w\210c\220\021\330\010\017\210\177\230a\230w\240i\250x\260r\270\030\300\021\340\010\017\210\177\230a\230w\240h\250b\260\007\260r\270\023\270H\300B\300c\310\021\200\001\360\010\000\005\016\210T\220\030\230\024\320\0352\260$\260e\2704\320?Q\320QU\320U`\320`d\320de\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\2307\240'\250\025\250c\260\024\3205I\310\027\320PU\320UX\320X\\\320\\`\320`g\320gl\320lo\320os\360\000\000t\001E\002\360\000\000E\002L\002\360\000\000L\002Q\002\360\000\000Q\002T\002\360\000\000T\002X\002\360\000\000X\002b\002\360\000\000b\002i\002\360\000\000i\002n\002\360\000\000n\002q\002\360\000\000q\002u\002\360\000\000u\002D\003\360\000\000D\003K\003\360\000\000K\003L\003\330\004\007\200q\330\010\017\320\0170\260\004\260A\260W\270K\300w\310a\340\010\017\320\0170\260\004\260A\260W\270K\300q\200\001\360\010\000\005\016\210T\220\030\230\024\320\0352\260$\260e\2704\270q\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\2307\240'\250\025\250c\260\024\3205I\310\027\320PU\320UX\320X\\\320\\`\320`g\320gl\320lo\320os\360\000\000t\001E\002\360\000\000E\002L\002\360\000\000L\002M\002\330""\004\007\200q\330\010\017\320\017>\270d\300!\3007\310+\320U\\\320\\]\340\010\017\320\017>\270d\300!\3007\310+\320UV\200\001\360\010\000\005\016\210T\220\030\230\024\230Q\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\2307\240'\250\025\250c\260\024\260T\270\027\300\001\330\004\007\200q\330\010\017\320\017*\250$\250a\250w\260k\300\027\310\001\340\010\017\320\017*\250$\250a\250w\260k\300\021\200\001\360\010\000\005\016\210T\220\030\230\024\230X\240T\320)>\270d\300(\310$\310h\320VZ\320Zo\320os\360\000\000t\001K\002\360\000\000K\002O\002\360\000\000O\002T\002\360\000\000T\002X\002\360\000\000X\002e\002\360\000\000e\002i\002\360\000\000i\002A\003\360\000\000A\003E\003\360\000\000E\003W\003\360\000\000W\003[\003\360\000\000[\003o\003\360\000\000o\003s\003\360\000\000s\003N\004\360\000\000N\004R\004\360\000\000R\004]\004\360\000\000]\004a\004\360\000\000a\004o\004\360\000\000o\004s\004\360\000\000s\004E\005\360\000\000E\005I\005\360\000\000I\005J\005\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\2307\240'\250\025\250c\260\024\3205I\310\027\320PU\320UX\320X\\\320\\c\320cj\320jo\320or\320rv\320vz\360\000\000{\001B\002\360\000\000B\002G\002\360\000\000G\002J\002\360\000\000J\002N\002\360\000\000N\002Z\002\360\000\000Z\002a\002\360\000\000a\002f\002\360\000\000f\002i\002\360\000\000i\002m\002\360\000\000m\002~\002\360\000\000~\002E\003\360\000\000E\003J\003\360\000\000J\003M\003\360\000\000M\003Q\003\360\000\000Q\003d\003\360\000\000d\003k\003\360\000\000k\003p\003\360\000\000p\003s\003\360\000\000s\003w\003\360\000\000w\003A\004\360\000\000A\004H\004\360\000\000H\004M\004\360\000\000M\004P\004\360\000\000P\004T\004\360\000\000T\004e\004\360\000\000e\004l\004\360\000\000l\004m\004\330\004\007\200q\330\010\017\320\017.\250d\260!\2607\270+\300W\310A\340\010\017\320\017.\250d\260!\2607\270+\300Q\200\001\360\010\000\005""\016\210T\220\035\230d\240+\250T\260\031\270$\270g\300T\310\021\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\2308\2407\250%\250s\260$\260f\270G\3001\330\004\007\200q\330\010\017\320\017/\250t\2601\260G\270;\300g\310Q\340\010\017\320\017/\250t\2601\260G\270;\300a\320\004V\320VW\330\010\032\230#\230Q\230d\240!\330\010\032\230#\230Q\230g\240Q\340\010\013\2107\220\"\220A\330\014\025\220Q\340\014\025\220Q\330\010\037\230t\2401\330\010\037\230w\240a\330\010\031\230\021\360\006\000\t\r\210E\220\025\220a\220s\230'\240\022\2401\330\014\035\230Q\330\014\020\220\005\220U\230!\2301\330\020\023\2208\2301\230C\230s\240(\250!\2507\260\"\260B\260b\270\001\330\024&\240a\330\024\027\220\177\240b\250\016\260b\270\001\330\030\031\340\020\030\230\001\330\010\017\210t\2201\220G\2301\320\004W\320WX\330\010\032\230#\230Q\230d\240!\330\010\032\230#\230Q\230g\240Q\340\010\013\2107\220\"\220A\330\014\025\220Q\340\014\025\220Q\330\010\037\230t\2401\330\010\037\230w\240a\330\010\031\230\021\360\006\000\t\r\210E\220\025\220a\220s\230'\240\022\2401\330\014\035\230Q\330\014\020\220\005\220U\230!\2301\330\020\023\2208\2301\230G\2402\240R\240r\250\023\250C\250x\260q\270\001\330\024&\240a\330\024\027\220\177\240b\250\016\260b\270\001\330\030\031\340\020\030\230\001\330\010\017\210t\2201\220C\220w\230b\240\001\320\000;\270=\310\017\320WX\360\010\000\005\014\2101\330\004\013\2101\330\004\n\210!\330\004\010\210\006\210h\220a\330\010\013\2105\220\003\2204\220s\230%\230s\240$\240c\250\025\250c\260\021\330\014\017\210w\220a\220~\240Q\330\020\026\220f\230F\240%\240r\250\026\250v\260U\270\"\270F\300'\310\021\330\014\024\220A\330\014\024\220A\330\r\022\220#\220Q\330\014\017\210w\220a\220~\240Q\330\020\025\220V\2306\240\026\240v\250U\260\"\260F\270'\300\021\330\014\024\220A\330\r\022\220#\220Q\330\014\017\210w\220a\220~\240Q\330\020\025\220V\2306\240\025\240b\250\006\250f\260F\270'\300\021\330\014\024\220A\330\r\022\220#\220Q""\330\014\017\210w\220a\220~\240Q\330\020\025\220V\2306\240\025\240b\250\006\250f\260F\270'\300\021\330\014\024\220A\330\r\022\220#\220Q\330\014\017\210w\220a\220~\240Q\330\020\025\220V\2306\240\026\240v\250U\260\"\260F\270'\300\021\330\014\024\220A\330\r\022\220#\220Q\330\014\017\210w\220a\220~\240Q\330\020\025\220V\2306\240\026\240v\250V\2607\270!\330\r\022\220#\220Q\330\014\017\210w\220a\220~\240Q\330\020\025\220V\2306\240\026\240v\250V\2607\270!\340\014\022\220*\230A\320\035D\300B\300a\330\004\013\2101\320\004&\240c\320)?\270q\340\010\013\2107\220#\220S\230\001\330\014\021\220\037\240\001\240\027\250\r\260S\270\n\300!\340\014\021\220\037\240\001\240\027\250\r\260\\\300\022\3008\3101\330\010\013\2104\210q\330\014\020\220\016\230a\230y\250\001\330\014\016\210j\230\001\330\014\020\220\016\230a\230v\240Q\240a\330\020\033\2307\240!\2404\240t\2501\330#'\240z\260\024\260Q\330\014\021\220\022\2205\230\001\330\014\016\210j\230\001\330\014\020\220\016\230a\230v\240Q\240a\330\020\033\2307\240!\2404\240t\2501\330#'\240z\260\024\260Q\340\014\020\220\016\230a\230q\330\020\"\240+\250W\260A\260T\270\024\270Q\33059\270\021\33059\270\021\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\0230\260\010\270\001\270\021\330\004\007\200|\2207\230!\330\010?\270q\320@`\320`n\320no\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220?\240(\250!\2501\330\004\007\200|\2207\230!\330\0101\260\021\3202D\300N\320RS\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220>\240\030\250\021\250!\330\004\007\200|\2207\230!\330\0100\260\001\3201B\300.\320PQ\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220=\240\010\250\001\250\021\330\004\007\200|\2207\230!\330\010/\250q\3200@\300\016\310a\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\2209\230H\240A\240Q\330\004\007\200|\2207\230!\330\010+\2501\250L\270\016\300a\330\004\013\2101\200\001""\330\004'\240q\250\006\250aACGTacgtTGCAtgca";
    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 < 535; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 120) 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 = 535; i < 615; 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 < 615; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 535;
      for (Py_ssize_t i=0; i<80; ++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;
    double const c_constants[] = {0.};
    for (int i = 0; i < 1; i++) {
      numbertab[i] = PyFloat_FromDouble(c_constants[i]);
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 1;
    int8_t const cint_constants_1[] = {0,-1,1,2,3,4,5,10,11,16,70};
    int32_t const cint_constants_4[] = {1450081L,9874465L,240641895L,246267685L,260241271L};
    for (int i = 0; i < 16; i++) {
      numbertab[i] = PyLong_FromLong((i < 11 ? cint_constants_1[i - 0] : cint_constants_4[i - 11]));
      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<17; ++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 : 12;
} __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 = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 557};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_addval, __pyx_mstate->__pyx_kp_b_iso88591_A_AU_Qa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 975};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_bw, __pyx_mstate->__pyx_n_u_entries, __pyx_mstate->__pyx_n_u_bufsize, __pyx_mstate->__pyx_n_u_newentry, __pyx_mstate->__pyx_n_u_key};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_write_with_buffer, __pyx_mstate->__pyx_kp_b_iso88591_8_9G1_q_q_G1HAQ_3ay_1_k_q_WAYgW, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 78};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_XT_Q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_constr, __pyx_mstate->__pyx_n_u_args};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_copy_2, __pyx_mstate->__pyx_kp_b_iso88591_A_t_a_vRq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 169};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iv};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_is_contained_in, __pyx_mstate->__pyx_kp_b_iso88591_A_3c_1_4wc_1_1_4y_t2XWDTTU_HG2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 191};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iv};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_contains, __pyx_mstate->__pyx_kp_b_iso88591_A_3c_1_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 201};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iv};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_overlaps, __pyx_mstate->__pyx_kp_b_iso88591_A_3c_1_4wc_1_1_4xw_d_HGCSST_HG2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 223};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_step};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_range, __pyx_mstate->__pyx_kp_b_iso88591_2_4AV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 229};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_step};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_range_d, __pyx_mstate->__pyx_kp_b_iso88591_4A_5QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 235};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iv};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_extend_to_include, __pyx_mstate->__pyx_kp_b_iso88591_A_3c_1A_4wc_1_AQ_4xw_d_HGCSST_HG, 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), 247};
    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_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_mstate->__pyx_kp_b_iso88591_A_at84xt6_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 251};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_chrom, __pyx_mstate->__pyx_n_u_start_d, __pyx_mstate->__pyx_n_u_length, __pyx_mstate->__pyx_n_u_strand};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_GenomicInterval_from_directional, __pyx_mstate->__pyx_kp_b_iso88591_SST_V1A_wc_awixr_awhb_r_HBc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 303};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_XT_t1, 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), 306};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_mstate->__pyx_kp_b_iso88591_A_at84vT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 327};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_iv, __pyx_mstate->__pyx_n_u_typecode, __pyx_mstate->__pyx_n_u_storage, __pyx_mstate->__pyx_n_u_memmap_dir, __pyx_mstate->__pyx_n_u_ncv};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_ARS0_c_6_83a_y_1_9E_q_r_F_9E_q_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 393};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_iv, __pyx_mstate->__pyx_n_u_v};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_create_view, __pyx_mstate->__pyx_kp_b_iso88591_A_2XS_AQ_Cq_q_Q_3a_c_S_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 405};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iv, __pyx_mstate->__pyx_n_u_length, __pyx_mstate->__pyx_n_u_startdiff, __pyx_mstate->__pyx_n_u_array};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_extend_to_include, __pyx_mstate->__pyx_kp_b_iso88591_A_2XS_Cq_A_S_q_Cwb_C_Jd_Q_4z_A_t, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 568};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_kp_b_iso88591_A_t1D_at3gRt9D_5_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 571};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_steps, __pyx_mstate->__pyx_kp_b_iso88591_A_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 574};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fun, __pyx_mstate->__pyx_n_u_iv, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_apply, __pyx_mstate->__pyx_kp_b_iso88591_A_D_V1_ar_ir_a_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 582};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_t_c_q_HD_T_6J_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 588};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_array, __pyx_mstate->__pyx_n_u_iv, __pyx_mstate->__pyx_n_u_offset, __pyx_mstate->__pyx_n_u_is_vector_of_sets, __pyx_mstate->__pyx_n_u_storage_2, __pyx_mstate->__pyx_n_u_cv};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_ChromVector_unpickle, __pyx_mstate->__pyx_kp_b_iso88591_A_iq_fA_j_1_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 767};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_chrom, __pyx_mstate->__pyx_n_u_length, __pyx_mstate->__pyx_n_u_start_index, __pyx_mstate->__pyx_n_u_iv};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_add_chrom, __pyx_mstate->__pyx_kp_b_iso88591_c_q_7_S_S_81_4q_ay_j_avQa_7_4t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 790};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_Kt1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 800};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_file_or_filename, __pyx_mstate->__pyx_n_u_strand, __pyx_mstate->__pyx_n_u_track_options, __pyx_mstate->__pyx_n_u_separator, __pyx_mstate->__pyx_n_u_sep, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_chrom, __pyx_mstate->__pyx_n_u_iv, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_write_bedgraph_file, __pyx_mstate->__pyx_kp_b_iso88591_A_a_D_Kt7_Q_AQ_4z_WHM_AQ_7_Q_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 860};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_file_or_filename, __pyx_mstate->__pyx_n_u_strand, __pyx_mstate->__pyx_n_u_typecode, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_header, __pyx_mstate->__pyx_n_u_line, __pyx_mstate->__pyx_n_u_array, __pyx_mstate->__pyx_n_u_chrom, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_iv};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_from_bedgraph_file, __pyx_mstate->__pyx_kp_b_iso88591_A9Gq_7_Q_A_q_Q_4_1_gQa_gQ_Cq_1_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 924};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_strand, __pyx_mstate->__pyx_n_u_pyBigWig, __pyx_mstate->__pyx_n_u_bw, __pyx_mstate->__pyx_n_u_header, __pyx_mstate->__pyx_n_u_chrom, __pyx_mstate->__pyx_n_u_cv, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_entries, __pyx_mstate->__pyx_n_u_bufsize, __pyx_mstate->__pyx_n_u_write_with_buffer, __pyx_mstate->__pyx_n_u_write_with_buffer, __pyx_mstate->__pyx_n_u_iv, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_entry};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_write_bigwig_file, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_D_Kt7_Q_AQ_4z_WHM_AQ_U_XQ_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1003};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_strand, __pyx_mstate->__pyx_n_u_typecode, __pyx_mstate->__pyx_n_u_pyBigWig, __pyx_mstate->__pyx_n_u_BigWig_Reader, __pyx_mstate->__pyx_n_u_bw, __pyx_mstate->__pyx_n_u_chrom_dict, __pyx_mstate->__pyx_n_u_array, __pyx_mstate->__pyx_n_u_chrom, __pyx_mstate->__pyx_n_u_intervals, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_from_bigwig_file, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_Q_Qb_q_Cq_1_Bj_A_D_uJiq_r_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1058};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_steps, __pyx_mstate->__pyx_kp_b_iso88591_A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1071};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_stranded, __pyx_mstate->__pyx_n_u_typecode, __pyx_mstate->__pyx_n_u_chrom_vectors, __pyx_mstate->__pyx_n_u_ga};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_GenomicArray_unpickle, __pyx_mstate->__pyx_kp_b_iso88591_Qd_A_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1082};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_make_translation_table_for_comp, __pyx_mstate->__pyx_kp_b_iso88591_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1089};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_seq};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_reverse_complement, __pyx_mstate->__pyx_kp_b_iso88591_3d_Jaq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1107};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rename};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_get_reverse_complement, __pyx_mstate->__pyx_kp_b_iso88591_A_1_81_4q_b_A_81_4q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1134};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_getstate, __pyx_mstate->__pyx_kp_b_iso88591_A_t1_A_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1139};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_setstate, __pyx_mstate->__pyx_kp_b_iso88591_A_G5_HE_IU_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1144};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_M_V4xt, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1147};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fasta_file, __pyx_mstate->__pyx_n_u_characters_per_line, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_write_to_fasta_file, __pyx_mstate->__pyx_kp_b_iso88591_B_4wgQ_fA_4wd_fAXRt1_s_fAT_WCr, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1169};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_count_array};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_add_bases_to_count_array, __pyx_mstate->__pyx_kp_b_iso88591_A_B_c_a_Ql_3b_AQ_Ql_3b_AQ_t1_E_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1199};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pattern, __pyx_mstate->__pyx_n_u_mismatch_prop};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_trim_left_end, __pyx_mstate->__pyx_kp_b_iso88591_VVW_Qd_QgQ_7_A_Q_Q_t1_wa_E_as_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1223};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pattern, __pyx_mstate->__pyx_n_u_mismatch_prop};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_trim_right_end, __pyx_mstate->__pyx_kp_b_iso88591_WWX_Qd_QgQ_7_A_Q_Q_t1_wa_E_as_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1351};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fastq_file};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_write_to_fastq_file, __pyx_mstate->__pyx_kp_b_iso88591_A_7_6_d_fA_4wd_fAXRt1_T_2Q_XWCr, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1360};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_convert_to_phred, __pyx_mstate->__pyx_n_u_sio};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_get_fastq_str, __pyx_mstate->__pyx_kp_b_iso88591_2_iy_a_s_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1365};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rename};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_get_reverse_complement, __pyx_mstate->__pyx_kp_b_iso88591_I_1_q_4q_b_A_IT_A_q_4q_A_IT_A_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1383};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_count_array};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_add_qual_to_count_array, __pyx_mstate->__pyx_kp_b_iso88591_A_C_4z_A_q_A_Q_m1Kq_q_g_q_AQ_E_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1407};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pattern, __pyx_mstate->__pyx_n_u_max_mm_qual};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_trim_left_end_with_quals, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_QgQ_7_A_Q_Q_t1_wa_4z_A_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1435};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pattern, __pyx_mstate->__pyx_n_u_max_mm_qual};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_trim_right_end_with_quals, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_QgQ_7_A_Q_Q_t1_wa_4z_A_q_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1509};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_qlen, __pyx_mstate->__pyx_n_u_rlen};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_check, __pyx_mstate->__pyx_kp_b_iso88591_A_Jb_A_G1_4vS_Ct6_D_4vS_uE_D_d_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_d_T_gT_G1F_a_vWE_Q_q_t87_s_fG, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_AV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1529};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cigar_string, __pyx_mstate->__pyx_n_u_ref_left, __pyx_mstate->__pyx_n_u_chrom, __pyx_mstate->__pyx_n_u_strand};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_parse_cigar, __pyx_mstate->__pyx_kp_b_iso88591_6m_RS_q_Cs_S_1M_2S_j_5Rq_U_3a_C, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1547};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cigar_pairs, __pyx_mstate->__pyx_n_u_ref_left, __pyx_mstate->__pyx_n_u_chrom, __pyx_mstate->__pyx_n_u_strand};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_build_cigar_list, __pyx_mstate->__pyx_kp_b_iso88591_WX_1_1_ha_5_4s_s_c_c_wa_Q_fF_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_Q_G1F_a_vWE_Q_q_t7_c_T_q_awk, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_2_e4q_G1F_a_vWE_Q_q_t7_c_5I_P, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_1F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_2_e4_QQUU_dde_G1F_a_vWE_Q_q_t, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1717};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_pysam, __pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_to_pysam_AlignedSegment, __pyx_mstate->__pyx_kp_b_iso88591_A_wfA_E_4uHD_CuCt3hcQZZ_cczz_D_Y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1749};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_pysam, __pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_to_pysam_AlignedRead, __pyx_mstate->__pyx_kp_b_iso88591_A_wfA_E_Q_E_U_e1_Q_Q_4q_Yb_1_81A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1781};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_read, __pyx_mstate->__pyx_n_u_samfile, __pyx_mstate->__pyx_n_u_strand, __pyx_mstate->__pyx_n_u_chrom, __pyx_mstate->__pyx_n_u_iv, __pyx_mstate->__pyx_n_u_seq, __pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_code, __pyx_mstate->__pyx_n_u_length};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_from_pysam_AlignedRead, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_4t1_G9AT_F_gQ_D_c_t4vS_q_O7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1829};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_read, __pyx_mstate->__pyx_n_u_samfile, __pyx_mstate->__pyx_n_u_strand, __pyx_mstate->__pyx_n_u_chrom, __pyx_mstate->__pyx_n_u_iv, __pyx_mstate->__pyx_n_u_query_sequence, __pyx_mstate->__pyx_n_u_seq, __pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_code, __pyx_mstate->__pyx_n_u_length};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_from_pysam_AlignedSegment, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_4t1_G9AT_A_5Q_Q_O3fD_s_Q_wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 23, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1891};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_line, __pyx_mstate->__pyx_n_u_qname, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_rname, __pyx_mstate->__pyx_n_u_pos, __pyx_mstate->__pyx_n_u_mapq, __pyx_mstate->__pyx_n_u_cigar, __pyx_mstate->__pyx_n_u_mrnm, __pyx_mstate->__pyx_n_u_mpos, __pyx_mstate->__pyx_n_u_isize, __pyx_mstate->__pyx_n_u_seq, __pyx_mstate->__pyx_n_u_qual, __pyx_mstate->__pyx_n_u_optional_fields, __pyx_mstate->__pyx_n_u_posint, __pyx_mstate->__pyx_n_u_flagint, __pyx_mstate->__pyx_n_u_strand, __pyx_mstate->__pyx_n_u_cigarlist, __pyx_mstate->__pyx_n_u_swq, __pyx_mstate->__pyx_n_u_fields, __pyx_mstate->__pyx_n_u_iv, __pyx_mstate->__pyx_n_u_alnmt, __pyx_mstate->__pyx_n_u_field};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_from_SAM_line, __pyx_mstate->__pyx_kp_b_iso88591_A_WBfAQ_3axr_AQ_gU_vV1_hfARq_3fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1994};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cigar, __pyx_mstate->__pyx_n_u_query_start, __pyx_mstate->__pyx_n_u_mate_start, __pyx_mstate->__pyx_n_u_cop};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_get_sam_line, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_a_4_7_Q_q_4wgQ_t1_AS_r_A_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2029};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tag, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_has_optional_field, __pyx_mstate->__pyx_kp_b_iso88591_A_E_Q_q_Cq_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2041};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tag, __pyx_mstate->__pyx_n_u_res, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_optional_field, __pyx_mstate->__pyx_kp_b_iso88591_A_ar_U_s_1Cs_3auCq_3ar_s_5_1_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2051};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_res, __pyx_mstate->__pyx_n_u_op, __pyx_mstate->__pyx_n_u_tc};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_raw_optional_fields, __pyx_mstate->__pyx_kp_b_iso88591_A_a_F_a_r_Ks_3ar_c_1Bk_A_Q_1Bk_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_XT_d_hVZZoos_t_K_K_O_O_T_T_X, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_1F_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2072};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s_3, __pyx_mstate->__pyx_n_u_split, __pyx_mstate->__pyx_n_u_quote};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_HTSeq__HTSeq_pyx, __pyx_mstate->__pyx_n_u_quotesafe_split, __pyx_mstate->__pyx_kp_b_iso88591_00B_1_a_Qa_Qa_s_7_Q_j_s_7_Q_j_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_CigarOperation, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_7_0_1B_PQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_Alignment, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_9HAQ_7_1L_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_AlignmentWithSequ, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_0_7_q_nno_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_BowtieAlignment, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_1_7_1_2DNRS_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_SAM_Alignment, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_7_q0_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CythonFunctionShared.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* NumpyImportArray.init */
  /*
   * Cython has automatically inserted a call to _import_array since
   * you didn't include one when you cimported numpy. To disable this
   * add the line
   *   <void>numpy._import_array
   */
  #ifdef NPY_FEATURE_VERSION
  #ifndef NO_IMPORT_ARRAY
  if (unlikely(_import_array() == -1)) {
      PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
      "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
      "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
  }
  #endif
  #endif
  
  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;
}

/* 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++) {
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
        Py_INCREF(src[i]);
    }
    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);
}

/* ArgTypeTestFunc (used by ArgTypeTest) */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* RaiseUnexpectedTypeError (used by Intern) */
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;
}

/* Intern */
static PyObject* __Pyx_Intern(PyObject* s) {
    if (unlikely(!PyUnicode_CheckExact(s))) {
        __Pyx_RaiseUnexpectedTypeError("str", s);
        return NULL;
    }
    Py_INCREF(s);
    PyUnicode_InternInPlace(&s);
    return s;
}

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

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

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

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

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* PyUnicode_Unicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
    if (unlikely(obj == Py_None))
        obj = __pyx_mstate_global->__pyx_kp_u_None;
    return __Pyx_NewRef(obj);
}

/* CIntToDigits (used by CIntToPyUnicode) */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode (used by COrdinalToPyUnicode) */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyUnicode_Concat(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyUnicode_Concat(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* COrdinalToPyUnicode (used by CIntToPyUnicode) */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
    return value <= 1114111;
}
static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
    Py_ssize_t padding_length = ulength - 1;
    if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
        char chars[256];
        if (value <= 255) {
            memset(chars, padding_char, (size_t) padding_length);
            chars[ulength-1] = (char) value;
            return PyUnicode_DecodeLatin1(chars, ulength, NULL);
        }
        char *cpos = chars + sizeof(chars);
        if (value < 0x800) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xc0 | (value & 0x1f));
        } else if (value < 0x10000) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xe0 | (value & 0x0f));
        } else {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xf0 | (value & 0x07));
        }
        cpos -= padding_length;
        memset(cpos, padding_char, (size_t) padding_length);
        return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
    }
    if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
        const char chars[1] = {(char) value};
        return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
    }
    {
        PyObject *uchar, *padding_uchar, *padding, *result;
        padding_uchar = PyUnicode_FromOrdinal(padding_char);
        if (unlikely(!padding_uchar)) return NULL;
        padding = PySequence_Repeat(padding_uchar, padding_length);
        Py_DECREF(padding_uchar);
        if (unlikely(!padding)) return NULL;
        uchar = PyUnicode_FromOrdinal(value);
        if (unlikely(!uchar)) {
            Py_DECREF(padding);
            return NULL;
        }
        result = PyUnicode_Concat(padding, uchar);
        Py_DECREF(padding);
        Py_DECREF(uchar);
        return result;
    }
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (long) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(long)*3+2];
    char *dpos, *end = digits + sizeof(long)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    long remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (long) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (long) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (long) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

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

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    if (max_char > 1114111) max_char = 1114111;
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
        Py_INCREF(values[i]);
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    Py_INCREF(key);
    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

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

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

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

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyLong_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyLong_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

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

/* RaiseClosureNameError */
static void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* 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(marker);
            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 !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#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);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    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;
}

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

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        if (unlikely(PyTuple_Check(key))) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args)) {
                PyErr_SetObject(PyExc_KeyError, args);
                Py_DECREF(args);
            }
        } else {
            PyErr_SetObject(PyExc_KeyError, key);
        }
    }
    return value;
}
#endif

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

/* unicode_tailmatch */
static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings,
                                          Py_ssize_t start, Py_ssize_t end, int direction) {
    Py_ssize_t i, count = __Pyx_PyTuple_GET_SIZE(substrings);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(count < 0)) return -1;
    #endif
    for (i = 0; i < count; i++) {
        Py_ssize_t result;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i),
                                     start, end, direction);
#else
        PyObject* sub = __Pyx_PySequence_ITEM(substrings, i);
        if (unlikely(!sub)) return -1;
        result = PyUnicode_Tailmatch(s, sub, start, end, direction);
        Py_DECREF(sub);
#endif
        if (result) {
            return (int) result;
        }
    }
    return 0;
}
static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
                                     Py_ssize_t start, Py_ssize_t end, int direction) {
    if (unlikely(PyTuple_Check(substr))) {
        return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction);
    }
    return (int) PyUnicode_Tailmatch(s, substr, start, end, direction);
}

/* PyObjectCallNoArg (used by PyObjectCallMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}
#endif

/* PyObjectCallMethod0 (used by dict_iter) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[1] = {obj};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_CallNoArg;
    return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
#endif
}

/* RaiseNoneIterError (used by UnpackTupleError) */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError (used by UnpackTuple2) */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else {
      Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t);
 #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(size < 0)) return;
 #endif
      if (size < index) {
        __Pyx_RaiseNeedMoreValuesError(size);
      } else {
        __Pyx_RaiseTooManyValuesError(index);
      }
    }
}

/* UnpackTuple2 (used by dict_iter) */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
        PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) {
    if (likely(is_tuple || PyTuple_Check(tuple))) {
        Py_ssize_t size;
        if (has_known_size) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        size = __Pyx_PyTuple_GET_SIZE(tuple);
        if (likely(size == 2)) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        if (size >= 0) {
            __Pyx_UnpackTupleError(tuple, 2);
        }
        return -1;
    } else {
        return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple);
    }
}
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
    value1 = __Pyx_PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = __Pyx_PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = __Pyx_PyObject_GetIterNextFunc(iter);
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
#if CYTHON_COMPILING_IN_PYPY
#include <string.h>
#endif
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#else
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
#if !CYTHON_AVOID_BORROWED_REFS
static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem) {
    PyObject *key, *value;
    if (unlikely(orig_length != PyDict_Size(iter_obj))) {
        PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
        return -1;
    }
    if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
        return 0;
    }
    if (pitem) {
        PyObject* tuple = PyTuple_New(2);
        if (unlikely(!tuple)) {
            return -1;
        }
        Py_INCREF(key);
        Py_INCREF(value);
        #if CYTHON_ASSUME_SAFE_MACROS
        PyTuple_SET_ITEM(tuple, 0, key);
        PyTuple_SET_ITEM(tuple, 1, value);
        #else
        if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) {
            Py_DECREF(value);
            Py_DECREF(tuple);
            return -1;
        }
        if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) {
            Py_DECREF(tuple);
            return -1;
        }
        #endif
        *pitem = tuple;
    } else {
        if (pkey) {
            Py_INCREF(key);
            *pkey = key;
        }
        if (pvalue) {
            Py_INCREF(value);
            *pvalue = value;
        }
    }
    return 1;
}
#endif
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_AVOID_BORROWED_REFS
    if (source_is_dict) {
        int result;
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_BEGIN_CRITICAL_SECTION(iter_obj);
#endif
        result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem);
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_END_CRITICAL_SECTION();
#endif
        return result;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(tuple_size < 0)) return -1;
        #endif
        if (unlikely(pos >= tuple_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_ASSUME_SAFE_MACROS
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        #else
        next_item = PyTuple_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #endif
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(list_size < 0)) return -1;
        #endif
        if (unlikely(pos >= list_size)) return 0;
        *ppos = pos + 1;
        next_item = __Pyx_PyList_GetItemRef(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

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

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* pybytes_as_double (used by pynumber_float) */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
    PyObject *float_value = PyFloat_FromString(obj);
    if (likely(float_value)) {
        double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
    return (double)-1;
}
static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
    int last_was_punctuation = 1;
    int parse_error_found = 0;
    Py_ssize_t i;
    for (i=0; i < length; i++) {
        char chr = start[i];
        int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
        *buffer = chr;
        buffer += (chr != '_');
        parse_error_found |= last_was_punctuation & is_punctuation;
        last_was_punctuation = is_punctuation;
    }
    parse_error_found |= last_was_punctuation;
    *buffer = '\0';
    return unlikely(parse_error_found) ? NULL : buffer;
}
static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
    int matches = 1;
    char sign = start[0];
    int is_signed = (sign == '+') | (sign == '-');
    start += is_signed;
    length -= is_signed;
    switch (start[0]) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            matches &= (start[1] == 'a' || start[1] == 'A');
            matches &= (start[2] == 'n' || start[2] == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            matches &= (start[1] == 'n' || start[1] == 'N');
            matches &= (start[2] == 'f' || start[2] == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            matches &= (start[3] == 'i' || start[3] == 'I');
            matches &= (start[4] == 'n' || start[4] == 'N');
            matches &= (start[5] == 'i' || start[5] == 'I');
            matches &= (start[6] == 't' || start[6] == 'T');
            matches &= (start[7] == 'y' || start[7] == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
    return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
}
CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
    double value;
    Py_ssize_t i, digits;
    const char *last = start + length;
    char *end;
    while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
        start++;
    while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
        last--;
    length = last - start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    digits = 0;
    for (i=0; i < length; digits += start[i++] != '_');
    if (likely(digits == length)) {
        value = PyOS_string_to_double(start, &end, NULL);
    } else if (digits < 40) {
        char number[40];
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}

/* pynumber_float */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
    double val;
    if (PyLong_CheckExact(obj)) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (likely(__Pyx_PyLong_IsCompact(obj))) {
            val = (double) __Pyx_PyLong_CompactValue(obj);
            goto no_error;
        }
#endif
        val = PyLong_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj)) {
        val = __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        val = __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        val = __Pyx_PyByteArray_AsDouble(obj);
    } else {
        return PyNumber_Float(obj);
    }
    if (unlikely(val == -1 && PyErr_Occurred())) {
        return NULL;
    }
#if CYTHON_USE_PYLONG_INTERNALS
no_error:
#endif
    return PyFloat_FromDouble(val);
}

/* PyObjectCall2Args (used by PyObjectCallMethod1) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectCallMethod1 (used by append) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

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

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

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

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

/* RaiseUnboundLocalError */
static void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* decode_c_bytes (used by decode_bytes) */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    if (unlikely((start < 0) | (stop < 0))) {
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (stop > length)
        stop = length;
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(Py_ssize_t)*3+2];
    char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    Py_ssize_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (Py_ssize_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (Py_ssize_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (Py_ssize_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* UnicodeConcatInPlace */
# if CYTHON_COMPILING_IN_CPYTHON
static int
__Pyx_unicode_modifiable(PyObject *unicode, int unsafe_shared)
{
    if (!__Pyx_IS_UNIQUELY_REFERENCED(unicode, unsafe_shared))
        return 0;
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030F0000
    if (PyUnstable_Unicode_GET_CACHED_HASH(unicode) != -1)
        return 0;
#endif
    if (!PyUnicode_CheckExact(unicode))
        return 0;
    if (PyUnicode_CHECK_INTERNED(unicode))
        return 0;
    return 1;
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    ) {
    PyObject *left = *p_left;
    Py_ssize_t left_len, right_len, new_len;
    if (unlikely(__Pyx_PyUnicode_READY(left) == -1))
        return NULL;
    if (unlikely(__Pyx_PyUnicode_READY(right) == -1))
        return NULL;
    left_len = PyUnicode_GET_LENGTH(left);
    if (left_len == 0) {
        Py_INCREF(right);
        return right;
    }
    right_len = PyUnicode_GET_LENGTH(right);
    if (right_len == 0) {
        Py_INCREF(left);
        return left;
    }
    if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) {
        PyErr_SetString(PyExc_OverflowError,
                        "strings are too large to concat");
        return NULL;
    }
    new_len = left_len + right_len;
    if (__Pyx_unicode_modifiable(left, unsafe_shared)
            && PyUnicode_CheckExact(right)
            && PyUnicode_KIND(right) <= PyUnicode_KIND(left)
            && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) {
        int ret;
        __Pyx_GIVEREF(*p_left);
        ret = PyUnicode_Resize(p_left, new_len);
        __Pyx_GOTREF(*p_left);
        if (unlikely(ret != 0))
            return NULL;
        #if PY_VERSION_HEX >= 0x030d0000
        if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL;
        #else
        _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len);
        #endif
        __Pyx_INCREF(*p_left);
        __Pyx_GIVEREF(*p_left);
        return *p_left;
    } else {
        return __Pyx_PyUnicode_Concat(left, right);
    }
  }
#endif

/* IsLittleEndian (used by BufferFormatCheck) */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
{
  union {
    uint32_t u32;
    uint8_t u8[4];
  } S;
  S.u32 = 0x01020304;
  return S.u8[0] == 4;
}

/* BufferFormatCheck (used by BufferGetAndValidate) */
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              const __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t <= '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case '?': return "'bool'";
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparsable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
  CYTHON_UNUSED_VAR(is_complex);
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
  CYTHON_UNUSED_VAR(is_complex);
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    const __Pyx_StructField* field = ctx->head->field;
    const __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    const __Pyx_StructField* field = ctx->head->field;
    const __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static int
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number, ndim;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return -1;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
    ndim = ctx->head->field->type->ndim;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return -1;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
            PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
            return -1;
        }
        if (*ts != ',' && *ts != ')') {
            PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
            return -1;
        }
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim) {
        PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
        return -1;
    }
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return -1;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return 0;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
        CYTHON_FALLTHROUGH;
      case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
            (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
        CYTHON_FALLTHROUGH;
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}

/* BufferGetAndValidate */
  static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
    if (unlikely(info->buf == NULL)) return;
    if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
    PyBuffer_Release(info);
  }
  static void __Pyx_ZeroBuffer(Py_buffer* buf) {
    buf->buf = NULL;
    buf->obj = NULL;
    buf->strides = __Pyx_zeros;
    buf->shape = __Pyx_zeros;
    buf->suboffsets = __Pyx_minusones;
  }
  static int __Pyx__GetBufferAndValidate(
          Py_buffer* buf, PyObject* obj,  const __Pyx_TypeInfo* dtype, int flags,
          int nd, int cast, __Pyx_BufFmt_StackElem* stack)
  {
    buf->buf = NULL;
    if (unlikely(PyObject_GetBuffer(obj, buf, flags) == -1)) {
      __Pyx_ZeroBuffer(buf);
      return -1;
    }
    if (unlikely(buf->ndim != nd)) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer has wrong number of dimensions (expected %d, got %d)",
                   nd, buf->ndim);
      goto fail;
    }
    if (!cast) {
      __Pyx_BufFmt_Context ctx;
      __Pyx_BufFmt_Init(&ctx, stack, dtype);
      if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
    }
    if (unlikely((size_t)buf->itemsize != dtype->size)) {
      PyErr_Format(PyExc_ValueError,
        "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
        buf->itemsize, (buf->itemsize > 1) ? "s" : "",
        dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
      goto fail;
    }
    if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
    return 0;
  fail:;
    __Pyx_SafeReleaseBuffer(buf);
    return -1;
  }
  
/* BufferIndexError */
  static void __Pyx_RaiseBufferIndexError(int axis) {
    PyErr_Format(PyExc_IndexError,
       "Out of bounds on buffer access (axis %d)", axis);
  }
  
/* PyLongBinop */
  #if !CYTHON_COMPILING_IN_PYPY
  static PyObject* __Pyx_Fallback___Pyx_PyLong_MultiplyCObj(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_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
      CYTHON_MAYBE_UNUSED_VAR(inplace);
      CYTHON_UNUSED_VAR(zerodivision_check);
      const long a = intval;
      long b;
      const PY_LONG_LONG lla = intval;
      PY_LONG_LONG llb;
      if (unlikely(__Pyx_PyLong_IsZero(op2))) {
          return __Pyx_NewRef(op2);
      }
      const int is_positive = __Pyx_PyLong_IsPos(op2);
      const digit* digits = __Pyx_PyLong_Digits(op2);
      const Py_ssize_t size = __Pyx_PyLong_DigitCount(op2);
      if (likely(size == 1)) {
          b = (long) digits[0];
          if (!is_positive) b *= -1;
      } else {
          switch (size) {
              case 2:
                  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                      b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                      if (!is_positive) b *= -1;
                      goto calculate_long;
                  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                      llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                      if (!is_positive) llb *= -1;
                      goto calculate_long_long;
                  }
                  break;
              case 3:
                  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                      b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                      if (!is_positive) b *= -1;
                      goto calculate_long;
                  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                      llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                      if (!is_positive) llb *= -1;
                      goto calculate_long_long;
                  }
                  break;
              case 4:
                  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                      b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                      if (!is_positive) b *= -1;
                      goto calculate_long;
                  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                      llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                      if (!is_positive) llb *= -1;
                      goto calculate_long_long;
                  }
                  break;
          }
          return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
      }
      calculate_long:
          CYTHON_UNUSED_VAR(a);
          CYTHON_UNUSED_VAR(b);
          llb = b;
          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_MultiplyCObj(PyObject *float_val, long intval, int zerodivision_check) {
      CYTHON_UNUSED_VAR(zerodivision_check);
      const long a = intval;
      double b = __Pyx_PyFloat_AS_DOUBLE(float_val);
          double result;
          
          result = ((double)a) * (double)b;
          return PyFloat_FromDouble(result);
  }
  static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
      CYTHON_MAYBE_UNUSED_VAR(intval);
      CYTHON_UNUSED_VAR(zerodivision_check);
      #if CYTHON_USE_PYLONG_INTERNALS
      if (likely(PyLong_CheckExact(op2))) {
          return __Pyx_Unpacked___Pyx_PyLong_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check);
      }
      #endif
      if (PyFloat_CheckExact(op2)) {
          return __Pyx_Float___Pyx_PyLong_MultiplyCObj(op2, intval, zerodivision_check);
      }
      return __Pyx_Fallback___Pyx_PyLong_MultiplyCObj(op1, op2, inplace);
  }
  #endif
  
/* PySequenceMultiply */
  #if CYTHON_USE_TYPE_SLOTS
  static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
      PyObject *result, *pymul = PyLong_FromSsize_t(mul);
      if (unlikely(!pymul))
          return NULL;
      result = PyNumber_Multiply(seq, pymul);
      Py_DECREF(pymul);
      return result;
  }
  static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
      PyTypeObject *type = Py_TYPE(seq);
      if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
          return type->tp_as_sequence->sq_repeat(seq, mul);
      } else {
          return __Pyx_PySequence_Multiply_Generic(seq, mul);
      }
  }
  #endif
  
/* BufferFallbackError */
  static void __Pyx_RaiseBufferFallbackError(void) {
    PyErr_SetString(PyExc_ValueError,
       "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
  }
  
/* CIntToPyUnicode */
  static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int neg_one = (int) -1, const_zero = (int) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                      !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
          PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
          return NULL;
      }
      if (width <= 1) {
          return PyUnicode_FromOrdinal((int) value);
      }
      return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
  }
  static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
      char digits[sizeof(int)*3+2];
      char *dpos, *end = digits + sizeof(int)*3+2;
      const char *hex_digits = DIGITS_HEX;
      Py_ssize_t length, ulength;
      int prepend_sign, last_one_off;
      int remaining;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int neg_one = (int) -1, const_zero = (int) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (format_char == 'X') {
          hex_digits += 16;
          format_char = 'x';
      }
      remaining = value;
      last_one_off = 0;
      dpos = end;
      do {
          int digit_pos;
          switch (format_char) {
          case 'o':
              digit_pos = abs((int)(remaining % (8*8)));
              remaining = (int) (remaining / (8*8));
              dpos -= 2;
              memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
              last_one_off = (digit_pos < 8);
              break;
          case 'd':
              digit_pos = abs((int)(remaining % (10*10)));
              remaining = (int) (remaining / (10*10));
              dpos -= 2;
              memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
              last_one_off = (digit_pos < 10);
              break;
          case 'x':
              *(--dpos) = hex_digits[abs((int)(remaining % 16))];
              remaining = (int) (remaining / 16);
              break;
          default:
              assert(0);
              break;
          }
      } while (unlikely(remaining != 0));
      assert(!last_one_off || *dpos == '0');
      dpos += last_one_off;
      length = end - dpos;
      ulength = length;
      prepend_sign = 0;
      if (!is_unsigned && value <= neg_one) {
          if (padding_char == ' ' || width <= length + 1) {
              *(--dpos) = '-';
              ++length;
          } else {
              prepend_sign = 1;
          }
          ++ulength;
      }
      if (width > ulength) {
          ulength = width;
      }
      if (ulength == 1) {
          return PyUnicode_FromOrdinal(*dpos);
      }
      return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
  }
  
/* GetAttr3 */
  #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
  static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
          return NULL;
      __Pyx_PyErr_Clear();
      Py_INCREF(d);
      return d;
  }
  #endif
  static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
      PyObject *r;
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
      int res = PyObject_GetOptionalAttr(o, n, &r);
      return (res != 0) ? r : __Pyx_NewRef(d);
  #else
    #if CYTHON_USE_TYPE_SLOTS
      if (likely(PyUnicode_Check(n))) {
          r = __Pyx_PyObject_GetAttrStrNoError(o, n);
          if (unlikely(!r) && likely(!PyErr_Occurred())) {
              r = __Pyx_NewRef(d);
          }
          return r;
      }
    #endif
      r = PyObject_GetAttr(o, n);
      return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
  #endif
  }
  
/* ModInt[Py_ssize_t] */
  static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
      Py_ssize_t r = a % b;
      Py_ssize_t adapt_python = (b_is_constant ?
          ((r != 0) & ((r < 0) ^ (b < 0))) :
          ((r != 0) & ((r ^ b) < 0))
      );
      return r + adapt_python * b;
  }
  
/* DivInt[Py_ssize_t] */
  static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
      Py_ssize_t q = a / b;
      Py_ssize_t r = a - q*b;
      Py_ssize_t adapt_python = (b_is_constant ?
          ((r != 0) & ((r < 0) ^ (b < 0))) :
          ((r != 0) & ((r ^ b) < 0))
      );
      return q - adapt_python;
  }
  
/* SetStringIndexingError (used by GetItemIntUnicode) */
  static void __Pyx_SetStringIndexingError(const char* message, int has_gil) {
      if (!has_gil) {
          PyGILState_STATE gil_state = PyGILState_Ensure();
          PyErr_SetString(PyExc_IndexError, message);
          PyGILState_Release(gil_state);
      } else
          PyErr_SetString(PyExc_IndexError, message);
  }
  
/* GetItemIntUnicode */
  static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i,
                                                             int wraparound, int boundscheck, int has_gil) {
      Py_ssize_t length;
      if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return (Py_UCS4)-1;
      if (wraparound | boundscheck) {
          length = __Pyx_PyUnicode_GET_LENGTH(ustring);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely(length < 0)) return (Py_UCS4)-1;
          #endif
          if (wraparound & unlikely(i < 0)) i += length;
          if ((!boundscheck) || likely(__Pyx_is_valid_index(i, length))) {
              return __Pyx_PyUnicode_READ_CHAR(ustring, i);
          } else {
              __Pyx_SetStringIndexingError("string index out of range", has_gil);
              return (Py_UCS4)-1;
          }
      } else {
          return __Pyx_PyUnicode_READ_CHAR(ustring, i);
      }
  }
  
/* PyUnicode_Substring */
  static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
              PyObject* text, Py_ssize_t start, Py_ssize_t stop) {
      Py_ssize_t length;
      #if !CYTHON_COMPILING_IN_LIMITED_API
      if (unlikely(__Pyx_PyUnicode_READY(text) == -1)) return NULL;
      #endif
      length = __Pyx_PyUnicode_GET_LENGTH(text);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(length < 0)) return NULL;
      #endif
      if (start < 0) {
          start += length;
          if (start < 0)
              start = 0;
      }
      if (stop < 0)
          stop += length;
      else if (stop > length)
          stop = length;
      if (stop <= start)
          return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_unicode);
      if (start == 0 && stop == length)
          return __Pyx_NewRef(text);
  #if CYTHON_COMPILING_IN_LIMITED_API
      return PyUnicode_Substring(text, start, stop);
  #else
      return PyUnicode_FromKindAndData(PyUnicode_KIND(text),
          PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start);
  #endif
  }
  
/* PyLongCompare */
  static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
      CYTHON_MAYBE_UNUSED_VAR(intval);
      CYTHON_UNUSED_VAR(inplace);
      if (op1 == op2) {
          return 0;
      }
      #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 1;
              intval = -intval;
          } else {
              if (__Pyx_PyLong_IsNeg(op1))
                  return 1;
          }
          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_NE));
  }
  
/* GetItemIntBytes */
  static CYTHON_INLINE int __Pyx_GetItemInt_Bytes_Fast(PyObject* bytes, Py_ssize_t index,
                                                       int wraparound, int boundscheck, int has_gil) {
      const unsigned char *c_string;
      if (wraparound && index < 0) {
          Py_ssize_t size = __Pyx_PyBytes_GET_SIZE(bytes);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely(size < 0)) return -1;
          #endif
          index += size;
      }
      if (boundscheck) {
          Py_ssize_t size = __Pyx_PyBytes_GET_SIZE(bytes);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely(size < 0)) return -1;
          #endif
          if (unlikely(!__Pyx_is_valid_index(index, size))) {
              __Pyx_SetStringIndexingError("string index out of range", has_gil);
              return -1;
          }
      }
      c_string = __Pyx_PyBytes_AsUString(bytes);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely(!c_string)) return -1;
      #endif
      return (int) c_string[index];
  }
  
/* 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);
      }
  }
  
/* CallNextTpTraverse */
  static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
      PyTypeObject* type = Py_TYPE(obj);
      traverseproc tp_traverse = NULL;
      while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      if (type && tp_traverse)
          return tp_traverse(obj, v, a);
      return 0;
  }
  
/* CallNextTpClear */
  static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
      PyTypeObject* type = Py_TYPE(obj);
      inquiry tp_clear = NULL;
      while (type && __Pyx_PyType_GetSlot(type, tp_clear, inquiry) != current_tp_clear)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      while (type && (tp_clear = __Pyx_PyType_GetSlot(type, tp_clear, inquiry)) == current_tp_clear)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      if (type && tp_clear)
          tp_clear(obj);
  }
  
/* ValidateBasesTuple (used by PyType_Ready) */
  #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
  static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
      Py_ssize_t i, n;
  #if CYTHON_ASSUME_SAFE_SIZE
      n = PyTuple_GET_SIZE(bases);
  #else
      n = PyTuple_Size(bases);
      if (unlikely(n < 0)) return -1;
  #endif
      for (i = 1; i < n; i++)
      {
          PyTypeObject *b;
  #if CYTHON_AVOID_BORROWED_REFS
          PyObject *b0 = PySequence_GetItem(bases, i);
          if (!b0) return -1;
  #elif CYTHON_ASSUME_SAFE_MACROS
          PyObject *b0 = PyTuple_GET_ITEM(bases, i);
  #else
          PyObject *b0 = PyTuple_GetItem(bases, i);
          if (!b0) return -1;
  #endif
          b = (PyTypeObject*) b0;
          if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
          {
              __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
              PyErr_Format(PyExc_TypeError,
                  "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
              __Pyx_DECREF_TypeName(b_name);
  #if CYTHON_AVOID_BORROWED_REFS
              Py_DECREF(b0);
  #endif
              return -1;
          }
          if (dictoffset == 0)
          {
              Py_ssize_t b_dictoffset = 0;
  #if CYTHON_USE_TYPE_SLOTS
              b_dictoffset = b->tp_dictoffset;
  #else
              PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
              if (!py_b_dictoffset) goto dictoffset_return;
              b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
              Py_DECREF(py_b_dictoffset);
              if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
  #endif
              if (b_dictoffset) {
                  {
                      __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
                      PyErr_Format(PyExc_TypeError,
                          "extension type '%.200s' has no __dict__ slot, "
                          "but base type '" __Pyx_FMT_TYPENAME "' has: "
                          "either add 'cdef dict __dict__' to the extension type "
                          "or add '__slots__ = [...]' to the base type",
                          type_name, b_name);
                      __Pyx_DECREF_TypeName(b_name);
                  }
  #if !CYTHON_USE_TYPE_SLOTS
                dictoffset_return:
  #endif
  #if CYTHON_AVOID_BORROWED_REFS
                  Py_DECREF(b0);
  #endif
                  return -1;
              }
          }
  #if CYTHON_AVOID_BORROWED_REFS
          Py_DECREF(b0);
  #endif
      }
      return 0;
  }
  #endif
  
/* PyType_Ready */
  CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
      while (t) {
          PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
          if (bases) {
              return 1;
          }
          t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
      }
      return 0;
  }
  static int __Pyx_PyType_Ready(PyTypeObject *t) {
  #if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION)
      (void)__Pyx_PyObject_CallMethod0;
  #if CYTHON_USE_TYPE_SPECS
      (void)__Pyx_validate_bases_tuple;
  #endif
      return PyType_Ready(t);
  #else
      int r;
      if (!__Pyx_PyType_HasMultipleInheritance(t)) {
          return PyType_Ready(t);
      }
      PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
      if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
          return -1;
  #if !defined(PYSTON_MAJOR_VERSION)
      {
          int gc_was_enabled;
      #if PY_VERSION_HEX >= 0x030A00b1
          gc_was_enabled = PyGC_Disable();
          (void)__Pyx_PyObject_CallMethod0;
      #else
          PyObject *ret, *py_status;
          PyObject *gc = NULL;
          #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                  !CYTHON_COMPILING_IN_GRAAL
          gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
          #endif
          if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
          if (unlikely(!gc)) return -1;
          py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
          if (unlikely(!py_status)) {
              Py_DECREF(gc);
              return -1;
          }
          gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
          Py_DECREF(py_status);
          if (gc_was_enabled > 0) {
              ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
              if (unlikely(!ret)) {
                  Py_DECREF(gc);
                  return -1;
              }
              Py_DECREF(ret);
          } else if (unlikely(gc_was_enabled == -1)) {
              Py_DECREF(gc);
              return -1;
          }
      #endif
          t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
  #if PY_VERSION_HEX >= 0x030A0000
          t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
  #endif
  #else
          (void)__Pyx_PyObject_CallMethod0;
  #endif
      r = PyType_Ready(t);
  #if !defined(PYSTON_MAJOR_VERSION)
          t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
      #if PY_VERSION_HEX >= 0x030A00b1
          if (gc_was_enabled)
              PyGC_Enable();
      #else
          if (gc_was_enabled) {
              PyObject *tp, *v, *tb;
              PyErr_Fetch(&tp, &v, &tb);
              ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
              if (likely(ret || r == -1)) {
                  Py_XDECREF(ret);
                  PyErr_Restore(tp, v, tb);
              } else {
                  Py_XDECREF(tp);
                  Py_XDECREF(v);
                  Py_XDECREF(tb);
                  r = -1;
              }
          }
          Py_DECREF(gc);
      #endif
      }
  #endif
      return r;
  #endif
  }
  
/* SetVTable */
  static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
      PyObject *ob = PyCapsule_New(vtable, 0, 0);
      if (unlikely(!ob))
          goto bad;
  #if CYTHON_COMPILING_IN_LIMITED_API
      if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
  #else
      if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
  #endif
          goto bad;
      Py_DECREF(ob);
      return 0;
  bad:
      Py_XDECREF(ob);
      return -1;
  }
  
/* GetVTable (used by MergeVTables) */
  static void* __Pyx_GetVtable(PyTypeObject *type) {
      void* ptr;
  #if CYTHON_COMPILING_IN_LIMITED_API
      PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
  #else
      PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
  #endif
      if (!ob)
          goto bad;
      ptr = PyCapsule_GetPointer(ob, 0);
      if (!ptr && !PyErr_Occurred())
          PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
      Py_DECREF(ob);
      return ptr;
  bad:
      Py_XDECREF(ob);
      return NULL;
  }
  
/* MergeVTables */
  static int __Pyx_MergeVtables(PyTypeObject *type) {
      int i=0;
      Py_ssize_t size;
      void** base_vtables;
      __Pyx_TypeName tp_base_name = NULL;
      __Pyx_TypeName base_name = NULL;
      void* unknown = (void*)-1;
      PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
      int base_depth = 0;
      {
          PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
          while (base) {
              base_depth += 1;
              base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
          }
      }
      base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
      base_vtables[0] = unknown;
  #if CYTHON_COMPILING_IN_LIMITED_API
      size = PyTuple_Size(bases);
      if (size < 0) goto other_failure;
  #else
      size = PyTuple_GET_SIZE(bases);
  #endif
      for (i = 1; i < size; i++) {
          PyObject *basei;
          void* base_vtable;
  #if CYTHON_AVOID_BORROWED_REFS
          basei = PySequence_GetItem(bases, i);
          if (unlikely(!basei)) goto other_failure;
  #elif !CYTHON_ASSUME_SAFE_MACROS
          basei = PyTuple_GetItem(bases, i);
          if (unlikely(!basei)) goto other_failure;
  #else
          basei = PyTuple_GET_ITEM(bases, i);
  #endif
          base_vtable = __Pyx_GetVtable((PyTypeObject*)basei);
  #if CYTHON_AVOID_BORROWED_REFS
          Py_DECREF(basei);
  #endif
          if (base_vtable != NULL) {
              int j;
              PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
              for (j = 0; j < base_depth; j++) {
                  if (base_vtables[j] == unknown) {
                      base_vtables[j] = __Pyx_GetVtable(base);
                      base_vtables[j + 1] = unknown;
                  }
                  if (base_vtables[j] == base_vtable) {
                      break;
                  } else if (base_vtables[j] == NULL) {
                      goto bad;
                  }
                  base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
              }
          }
      }
      PyErr_Clear();
      PyMem_Free(base_vtables);
      return 0;
  bad:
      {
          PyTypeObject* basei = NULL;
          PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
          tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base);
  #if CYTHON_AVOID_BORROWED_REFS
          basei = (PyTypeObject*)PySequence_GetItem(bases, i);
          if (unlikely(!basei)) goto really_bad;
  #elif !CYTHON_ASSUME_SAFE_MACROS
          basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
          if (unlikely(!basei)) goto really_bad;
  #else
          basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
  #endif
          base_name = __Pyx_PyType_GetFullyQualifiedName(basei);
  #if CYTHON_AVOID_BORROWED_REFS
          Py_DECREF(basei);
  #endif
      }
      PyErr_Format(PyExc_TypeError,
          "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
  #if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
  really_bad: // bad has failed!
  #endif
      __Pyx_DECREF_TypeName(tp_base_name);
      __Pyx_DECREF_TypeName(base_name);
  #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
  other_failure:
  #endif
      PyMem_Free(base_vtables);
      return -1;
  }
  
/* DelItemOnTypeDict (used by SetupReduce) */
  static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
      int result;
      PyObject *tp_dict;
  #if CYTHON_COMPILING_IN_LIMITED_API
      tp_dict = __Pyx_GetTypeDict(tp);
      if (unlikely(!tp_dict)) return -1;
  #else
      tp_dict = tp->tp_dict;
  #endif
      result = PyDict_DelItem(tp_dict, k);
      if (likely(!result)) PyType_Modified(tp);
      return result;
  }
  
/* SetupReduce */
  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
    int ret;
    PyObject *name_attr;
    name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name);
    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_4
  #define __PYX_HAVE_RT_ImportType_3_2_4
  static PyTypeObject *__Pyx_ImportType_3_2_4(PyObject *module, const char *module_name, const char *class_name,
      size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_4 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_4 &&
              ((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_4 && (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
  
/* ClassMethod */
  static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
      if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
          return PyClassMethod_New(method);
      }
  #else
  #if CYTHON_COMPILING_IN_PYPY
      if (PyMethodDescr_Check(method))
  #else
      if (__Pyx_TypeCheck(method, &PyMethodDescr_Type))
  #endif
      {
  #if CYTHON_COMPILING_IN_LIMITED_API
          return PyErr_Format(
              PyExc_SystemError,
              "Cython cannot yet handle classmethod on a MethodDescriptorType (%S) in limited API mode. "
              "This is most likely a classmethod in a cdef class method with binding=False. "
              "Try setting 'binding' to True.",
              method);
  #elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
          PyTypeObject *d_type = GraalPyDescrObject_GetType(method);
          return PyDescr_NewClassMethod(d_type, GraalPyMethodDescrObject_GetMethod(method));
  #elif CYTHON_COMPILING_IN_GRAAL
          PyTypeObject *d_type = PyDescrObject_GetType(method);
          return PyDescr_NewClassMethod(d_type, PyMethodDescrObject_GetMethod(method));
  #else
          PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
          PyTypeObject *d_type = descr->d_common.d_type;
          return PyDescr_NewClassMethod(d_type, descr->d_method);
  #endif
      }
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
      else if (PyMethod_Check(method)) {
          return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
      }
      else {
          return PyClassMethod_New(method);
      }
  #else
      {
          PyObject *func=NULL;
          PyObject *builtins, *classmethod, *classmethod_str, *result=NULL;
          if (__Pyx_TypeCheck(method, __pyx_mstate_global->__Pyx_CachedMethodType)) {
              func = PyObject_GetAttrString(method, "__func__");
              if (!func) goto bad;
          } else {
              func = method;
              Py_INCREF(func);
          }
          builtins = PyEval_GetBuiltins(); // borrowed
          if (unlikely(!builtins)) goto bad;
          classmethod_str = PyUnicode_FromString("classmethod");
          if (unlikely(!classmethod_str)) goto bad;
          classmethod = PyObject_GetItem(builtins, classmethod_str);
          Py_DECREF(classmethod_str);
          if (unlikely(!classmethod)) goto bad;
          result = PyObject_CallFunctionObjArgs(classmethod, func, NULL);
          Py_DECREF(classmethod);
          bad:
          Py_XDECREF(func);
          return result;
      }
  #endif
  }
  
/* GetNameInClass */
  static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
      PyObject *result;
      PyObject *dict;
      assert(PyType_Check(nmspace));
  #if CYTHON_USE_TYPE_SLOTS
      dict = ((PyTypeObject*)nmspace)->tp_dict;
      Py_XINCREF(dict);
  #else
      dict = PyObject_GetAttr(nmspace, __pyx_mstate_global->__pyx_n_u_dict);
  #endif
      if (likely(dict)) {
          result = PyObject_GetItem(dict, name);
          Py_DECREF(dict);
          if (result) {
              return result;
          }
      }
      PyErr_Clear();
      __Pyx_GetModuleGlobalNameUncached(result, name);
      return result;
  }
  
/* ListPack */
  static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) {
      va_list va;
      PyObject *l = PyList_New(n);
      va_start(va, n);
      if (unlikely(!l)) goto end;
      for (Py_ssize_t i=0; i<n; ++i) {
          PyObject *arg = va_arg(va, PyObject*);
          Py_INCREF(arg);
          if (__Pyx_PyList_SET_ITEM(l, i, arg) != (0)) {
              Py_CLEAR(l);
              goto end;
          }
      }
      end:
      va_end(va);
      return l;
  }
  
/* 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;\
      }
  
/* CheckUnpickleChecksum */
  static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
      PyObject *pickle_module = PyImport_ImportModule("pickle");
      if (unlikely(!pickle_module)) return;
      PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
      Py_DECREF(pickle_module);
      if (unlikely(!pickle_error)) return;
      if (checksum2 == checksum1) {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
              checksum, checksum1, members);
      } else if (checksum3 == checksum2) {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
              checksum, checksum1, checksum2, members);
      } else {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
              checksum, checksum1, checksum2, checksum3, members);
      }
      Py_DECREF(pickle_error);
  }
  static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
      int found = 0;
      found |= checksum1 == checksum;
      found |= checksum2 == checksum;
      found |= checksum3 == checksum;
      if (likely(found))
          return 0;
      __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
      return -1;
  }
  
/* 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
  
/* 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
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int neg_one = (int) -1, const_zero = (int) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          int val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (int) -1;
          val = __Pyx_PyLong_As_int(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                              return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                              return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                              return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (int) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(int) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                              return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                              return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                              return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                              return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                              return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                              return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(int) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
          } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          int val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (int) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (int) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (int) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (int) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((int) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((int) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (int) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to int");
      return (int) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to int");
      return (int) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const long neg_one = (long) -1, const_zero = (long) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          long val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (long) -1;
          val = __Pyx_PyLong_As_long(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                              return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                              return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                              return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (long) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(long) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                              return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                              return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                              return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                              return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                              return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                              return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(long) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
          } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          long val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (long) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (long) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (long) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (long) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((long) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((long) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (long) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to long");
      return (long) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to long");
      return (long) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const long neg_one = (long) -1, const_zero = (long) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(long) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(long) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(long) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(long),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE 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;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE npy_uint8 __Pyx_PyLong_As_npy_uint8(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 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_uint8 val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (npy_uint8) -1;
          val = __Pyx_PyLong_As_npy_uint8(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_uint8, __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_uint8) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(npy_uint8) >= 2 * PyLong_SHIFT)) {
                              return (npy_uint8) (((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(npy_uint8) >= 3 * PyLong_SHIFT)) {
                              return (npy_uint8) (((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) >= 4 * PyLong_SHIFT)) {
                              return (npy_uint8) (((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)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_uint8) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(npy_uint8) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(npy_uint8, __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_uint8) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT)) {
                              return (npy_uint8) (((npy_uint8)-1)*(((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT)) {
                              return (npy_uint8) ((((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT)) {
                              return (npy_uint8) (((npy_uint8)-1)*(((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT)) {
                              return (npy_uint8) ((((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) - 1 > 4 * PyLong_SHIFT)) {
                              return (npy_uint8) (((npy_uint8)-1)*(((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(npy_uint8, 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_uint8) - 1 > 4 * PyLong_SHIFT)) {
                              return (npy_uint8) ((((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(npy_uint8) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, long, PyLong_AsLong(x))
          } else if ((sizeof(npy_uint8) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          npy_uint8 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_uint8) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (npy_uint8) -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_uint8) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (npy_uint8) 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_uint8) * 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_uint8) 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_uint8) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((npy_uint8) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((npy_uint8) 1) << (sizeof(npy_uint8) * 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_uint8) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to npy_uint8");
      return (npy_uint8) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to npy_uint8");
      return (npy_uint8) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_intp(npy_intp value) {
  #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 (is_unsigned) {
          if (sizeof(npy_intp) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(npy_intp) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(npy_intp) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(npy_intp) <= 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(npy_intp),
                                       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(npy_intp));
          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
      }
  }
  
/* UpdateUnpickledDict */
  static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
      PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
      if (unlikely(!state_dict)) {
          return -1;
      }
      int non_empty = PyObject_IsTrue(state_dict);
      if (non_empty == 0) {
          Py_DECREF(state_dict);
          return 0;
      } else if (unlikely(non_empty == -1)) {
          return -1;
      }
      PyObject *dict;
      #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
      dict = PyObject_GetAttrString(obj, "__dict__");
      #else
      dict = PyObject_GenericGetDict(obj, NULL);
      #endif
      if (unlikely(!dict)) {
          Py_DECREF(state_dict);
          return -1;
      }
      int result;
      if (likely(PyDict_CheckExact(dict))) {
          result = PyDict_Update(dict, state_dict);
      } else {
          PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
          if (likely(obj_result)) {
              Py_DECREF(obj_result);
              result = 0;
          } else {
              result = -1;
          }
      }
      Py_DECREF(state_dict);
      Py_DECREF(dict);
      return result;
  }
  static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
      Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(state_size == -1)) return -1;
      #endif
      if (state_size <= index) {
          return 0;
      }
      return __Pyx__UpdateUnpickledDict(obj, state, index);
  }
  
/* FormatTypeName */
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
  static __Pyx_TypeName
  __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
  {
      PyObject *module = NULL, *name = NULL, *result = NULL;
      #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
      name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                                 __pyx_mstate_global->__pyx_n_u_qualname);
      #else
      name = PyType_GetQualName(tp);
      #endif
      if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
      module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                                 __pyx_mstate_global->__pyx_n_u_module);
      if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
      if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
          result = name;
          name = NULL;
          goto done;
      }
      result = PyUnicode_FromFormat("%U.%U", module, name);
      if (unlikely(result == NULL)) goto bad;
    done:
      Py_XDECREF(name);
      Py_XDECREF(module);
      return result;
    bad:
      PyErr_Clear();
      if (name) {
          result = name;
          name = NULL;
      } else {
          result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__34);
      }
      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 */
